Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add etcd notifier #1003

Closed
wants to merge 1 commit into from
Closed

Add etcd notifier #1003

wants to merge 1 commit into from

Conversation

dtnaylor
Copy link

Add notifier that puts/deletes keys in an etcd KV store using etcd's grpc-gateway.

I’m not sure how much demand for this there is, so if you don’t think it’s worth supporting, then consider this a +1 for #701.

A sample configuration:

# sample etcd notifier config that writes a KV pair when an alert fires
# and deletes it when the alert is resolved
etcd_configs:
 - firing:
     url: http://localhost:2379/v3alpha/kv/put
     key_annotation: 'etcd_key'
     value_annotation: 'etcd_value'
   resolved:
     url: http://localhost:2379/v3alpha/kv/deleterange
     key_annotation: 'etcd_key'
     value_annotation: 'etcd_value'

And a sample rule:

ALERT QueueFull
  IF queue_occupancy > 0.9
  FOR 5s
  LABELS { severity = “warning” }
  ANNOTATIONS {
    summary = “…”,
    etcd_key = "/queue_occupancy/{{ $labels.queue_name }}",
    etcd_value = "{{ $value }}",
  }

@stuartnelson3
Copy link
Contributor

Thanks for the pr! As you noticed, we're not actively adding notifiers at the moment as we try to figure out something more flexible. For the time being, we recommend implementing custom notifiers via the webhook notifier.

@dtnaylor
Copy link
Author

Great, we'll stay tuned to see what you come up with :)

In case it helps your planning, the two things we need in this case that the webhook notifier doesn't (currently) offer are (1) the ability to add custom keys to the POSTed JSON and (2) the ability to base64 encode the values (maybe base64encode could be added as a template function for Prometheus alerts?).

hh pushed a commit to ii/alertmanager that referenced this pull request Aug 5, 2018
It is quite common to put /var/lib/docker itself on a separate partition
and that should be monitored as well.

Signed-off-by: Johannes Wienke <[email protected]>
hh pushed a commit to ii/alertmanager that referenced this pull request May 25, 2019
* Fix ordering of CHANGE items by PR number.
* Add missing CHANGE for prometheus#1003

Signed-off-by: Ben Kochie <[email protected]>
hh pushed a commit to ii/alertmanager that referenced this pull request Jun 2, 2019
* Fix ordering of CHANGE items by PR number.
* Add missing CHANGE for prometheus#1003

Signed-off-by: Ben Kochie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants