valeriansaliou / vigil

🚦 Microservices Status Page. Monitors a distributed infrastructure and sends alerts (Slack, SMS, etc.).
https://crates.io/crates/vigil-server
Mozilla Public License 2.0
1.7k stars 125 forks source link

Add support to delete replicas #78

Closed NikoGrano closed 3 years ago

NikoGrano commented 3 years ago

In some cases replica is required to be removed to avoid false-positives. Example case.

Endpoint URL:

HTTP DELETE https://status.example.com/reporter/<probe_id>/<node_id>/

Where:

Request headers:

Request data:

Adjust the request data to your replica context and send it as HTTP DELETE:

{
  "replica": "<replica_id>"
}

Where:

First time writing rust, don't shoot me 😅

ref #77

valeriansaliou commented 3 years ago

Thanks! Looks good.

valeriansaliou commented 3 years ago

All good for me, will issue a Vigil release and bump all Reporter libraries.

Note that I've normalized code w/ Vigil code style + remapped the DELETE URL to contain the replica_id, which is more RESTful. Ref: 12ef1153a8aab80613986c8a3ae1a016f55d0ed4

Thanks again!

valeriansaliou commented 3 years ago

NodeJS library updated, I've done it a bit differently and integrated the flush option in the existing .end() method: https://github.com/valeriansaliou/node-vigil-reporter#2-teardown-reporter

v1.3.0 of the library has been published on NPM.

NikoGrano commented 3 years ago

Thanks, I started working on typescript implementation before you published new one. https://github.com/NikoGrano/ts-vigil-reporter

Feel free to mention. if you want.

valeriansaliou commented 3 years ago

Thanks added :)