Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change alert definition meta
Browse files Browse the repository at this point in the history
Mooli Tayer committed Jan 15, 2018
1 parent a80fca5 commit 07521ba
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -49,14 +49,14 @@ def extract_event_data(event)
#
# {
# "annotations": {
# "message": "Node ocp-compute01.10.35.48.236.nip.io is down",
# "severity": "HIGH",
# "description": "Node ocp-compute01.10.35.48.236.nip.io is down",
# "source": "ManageIQ",
# "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# },
# "endsAt": "0001-01-01T00:00:00Z",
# "generatorURL": "http://prometheus-4018548653-w3str:9090/graph?g0.expr=container_fs_usage_bytes%7Bcontainer_name%3D%22%22%2Cdevice%3D%22%2Fdev%2Fmapper%2Fvg0-lv_root%22%7D+%3E+4e%2B07&g0.tab=0",
# "labels": {
# "severity": "HIGH",
# "alertname": "Node down",
# "beta_kubernetes_io_arch": "amd64",
# "beta_kubernetes_io_os": "linux",
@@ -77,7 +77,7 @@ def extract_event_data(event)

annotations = event["annotations"]
event[:url] = annotations["url"]
event[:severity] = parse_severity(annotations["severity"])
event[:severity] = parse_severity(labels["severity"])
labels = event["labels"]
# TODO(mtayer): remove after https://github.com/ManageIQ/manageiq/pull/16339
event[:ems_ref] = incident_identifier(labels, annotations, event["startsAt"])
@@ -86,7 +86,7 @@ def extract_event_data(event)
:source => "DATAWAREHOUSE",
:timestamp => Time.zone.now,
:event_type => "datawarehouse_alert",
:message => annotations["message"],
:message => annotations["description"],
:ems_ref => incident_identifier(labels, annotations, event["startsAt"]),
:full_data => event.to_h
}.merge(

0 comments on commit 07521ba

Please sign in to comment.