sensu / sensu-go

Simple. Scalable. Multi-cloud monitoring.
https://sensu.io
MIT License
1.02k stars 175 forks source link

Silenced API #369

Closed portertech closed 6 years ago

portertech commented 7 years ago

Sensu 1.X provides a set of API endpoints for managing Event silencing, the "Silenced API". Sensu 1.X silencing is based on Sensu client subscription and check name. Silencing also supports a basic wildcard/splat (match all) for the client subscription and/or check name.

The Sensu 1.X Silenced API documentation can be found at: https://sensuapp.org/docs/1.0/api/silenced-api.html#sensu-silenced-api

The Sensu 1.X Silenced API Ruby code can be found at: https://github.com/sensu/sensu/blob/master/lib/sensu/api/routes/silenced.rb

To get an idea of what the Sensu 1.X server does, the Ruby code can be found at: https://github.com/sensu/sensu/blob/9059bf10125221cd4806cc0ad6758f43fe216e8b/lib/sensu/server/process.rb#L455-L496

The Sensu 2.X API must implement the Silenced API. The technical implementation will likely differ due to the change in storage technologies. Silencing in 2.X is based on Agent subscription and check name.

portertech commented 7 years ago

I will create the other, related, silencing ticket in the AM.

portertech commented 7 years ago

The Sensu 2.X backend Silenced implementation is fairly straightforward, we're just going to add a few notes here, instead of another ticket.

Eventd needs to check for the existence of Silenced Entries for an event, if one or more exists, mark the Event as "silenced".

Pipelined needs a built-in filter to exclude "silenced" Events. The filter is applied to all Event handlers (and their pipelines) unless a handler has "handle_silenced": true. The 1.X "handle_silenced" documentation can be found at: https://sensuapp.org/docs/1.0/reference/handlers.html#handler-attributes (under "handle_silenced")

portertech commented 7 years ago

eventd to determine if an event has been silenced, settings event.Silenced to true.

palourde commented 7 years ago

CoS

Tasks

mercul3s commented 7 years ago

Should this work include managing silenced events with sensuctl, or just the web api for now?

portertech commented 7 years ago

@mercul3s just the web API for now. sensuctl silencing will be a separate ticket fo sho 👍