Commit Graph

34 Commits

Author SHA1 Message Date
Luna Mendes 6b82684d5a adapters: handle 204's on HttpAdapter
- adapters: add debug info on ping errors
2018-10-15 19:34:54 -03:00
Luna Mendes 37724f2d21 elstat.alerts: use ints instead of bool queries 2018-09-26 03:58:53 -03:00
Luna Mendes 867d7d1e69 elstat.adapters: only log on errors
always logging was giving quite the disk usage on prod.
2018-09-25 18:22:11 -03:00
Luna Mendes 9f5d42c89c add downtime calculation on alerts
- add timestamp on alert embeds
 - make Alert.post receive the worker instead of service info
2018-09-25 18:16:22 -03:00
Luna Mendes 227087284b blueprints.api: use downtime in milliseconds, not seconds
This was giving way too optimistic availability rates.
2018-09-05 21:41:33 -03:00
Luna Mendes 93630f64ef adapters: change "error not found" to "packet lost" 2018-09-05 21:23:58 -03:00
Luna Mendes 5428dcee3c change uptimes to daily, weekly and monthly
- /api/current_status renamed to /api/quick
 - add week_uptime and month_uptime to responses
2018-09-05 21:17:26 -03:00
Luna Mendes e14720a8c8 remove print debug 2018-09-03 22:40:47 -03:00
Luna Mendes 3437bd2b72 Add better error messages
- Add status.json with HTTP status code table
 - Add error fetching on PingAdapter
 - Give warning on no alerts set
2018-09-03 22:39:41 -03:00
Luna Mendes 7a2f9a95c7 add alerts
- worker: change Adapter._construct to receive an extra arg
 - worker: hardcode a bad result and write it off on workloop fail
2018-08-30 22:22:02 -03:00
Luna Mendes 3dd37c0bf1 small logging changes 2018-08-08 19:37:57 -03:00
Luna Mendes d36d3d7449 blueprints.api: quickfix 2018-08-08 17:37:36 -03:00
Luna Mendes 86c99c8fee blueprints.api: add calc_uptime, uptime field on api 2018-08-08 17:30:51 -03:00
Luna Mendes 93de3dfda0 worker: remove unecessary log call 2018-08-08 16:55:30 -03:00
Luna Mendes 6c94b50ba0 incidents: fix bug 2018-07-19 18:42:34 -03:00
slice a44574249a
backend: INC_UPDATE -> INCIDENT_UPDATE 2018-07-18 15:06:31 -07:00
slice d842ebfccb
give c field when publishing incident 2018-07-18 12:47:07 -07:00
slice cea693102f
PUT /api/incidents -> POST /api/incidents 2018-07-18 12:46:58 -07:00
slice 11df05b998
unnest /api/incidents/current 2018-07-18 12:40:39 -07:00
slice 194129a5f2
/api/incident -> /api/incidents
for consistency
2018-07-18 12:39:43 -07:00
Luna Mendes 4407fbd6df docs/streaming: add incident op codes and payloads 2018-07-18 05:01:32 -03:00
Luna Mendes 9c2dbeaf59 incidents: add rest of basic API
- change all ISO timestamp strings to unix timestamps
 - add patch_incident and new_stage

 - streaming: remove INC_UPDATE_STAGE
 - manager: change primary key on instance_stages table

This requires a table change across all elstat instances, since
we changed the primary key on instance_stages.
2018-07-18 04:28:22 -03:00
Luna Mendes dcadfd4c76 blueprints.incidents: add api base
- add getting a single incident, getting multiple (with pages), and
 creating an incident

 - blueprints.streaming: add incident related OP codes
 - consts: add IncidentType
 - manager: add incidents channel, add publish_incident
 - elstat: add snowflake.py
2018-07-17 22:59:11 -03:00
Luna Mendes e3a3e1b77b
worker: publish new status upon worker crash 2018-07-14 22:30:29 -03:00
Luna Mendes 83b2d88311
change adapter response type to dict
this simplifies a lot of code since tuples are immutable.

 - adapters: add Adapter._construct
 - worker: set status state to False on worker crash
2018-07-14 22:27:06 -03:00
Luna Mendes ecf6234cfe elstat.adapters: add latency to db spec
Since this is a change to the table schema for all services using the
ping adapter, you will have to delete the tables relating to them.

 - elstat.blueprints: add incidents blueprint (WIP)
 - elstat.blueprints: add decorators.py
 - elstat.blueprints: add errors.py
 - elstat.manager: add incidents & incident_stages tables
 - run: add handler for ApiError
2018-07-13 23:20:09 -03:00
Luna Mendes 31a0f2b989
Add streaming API documentation
- streaming: add sub/unsub OP codes, changing from the old behavior of
    just giving a channels array.
 - streaming: properly check payloads against their data and send
    proper errors.

 - manager: add unsubscribe()
2018-07-11 18:23:47 -03:00
Luna Mendes 3fa27f5de6
move blueprints inside elstat folder
- add OP.DATA
 - manager: add _websockets map
 - manager: add basic publish logic
 - worker: add timestamps to published messages
2018-07-11 17:00:39 -03:00
Luna Mendes 3ec64d5bdd
worker: add basic _dispatch_work logic 2018-07-11 03:42:31 -03:00
Luna Mendes 7e6d9d5402
add channel creation
dynamically create channels by adapter's specs.

 - add cleanup tasks for ServiceManager and ServiceWorker
2018-07-11 02:48:00 -03:00
Luna Mendes 053762f69f
blueprints: add streaming blueprint
clients can connect and subscribe to different channels
and they will get messages from those channels (basic pub/sub)

this is useful in the case of a client wanting issue updates
in real time, which is better than the client having to poll
/api/status every now and then.

 - manager: add ServiceManager.subscribe and .unsub_all
2018-07-10 20:03:07 -03:00
Luna Mendes d92c09772e
add public api
- generalize elixire adapter into http adapter
 - fix ping adapter not sending a tuple
 - add ServiceWorker.process_work to insert results into the database
2018-07-09 02:48:44 -03:00
Luna Mendes 359c62efd6 Add proper adapter implementations
also add table making for the db
2018-07-08 00:38:14 -03:00
Luna Mendes 9ed1ec60cf add ServiceManager & ServiceWorker 2018-07-07 20:51:43 -03:00