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

Change alert definition meta #217

Merged
merged 1 commit into from
Jan 21, 2018
Merged

Conversation

moolitayer
Copy link

@moolitayer moolitayer commented Jan 15, 2018

@moolitayer
Copy link
Author

@cben @zeari please review

@moolitayer
Copy link
Author

moolitayer commented Jan 15, 2018

@aweiteka
Copy link

Match changes in https://github.com/openshift/origin/pull/17608/files

I will push a change to openshift/origin#17608 to match labels convention "info|warning|error"

@@ -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"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this line work? it seems labels is only set on next line?

@cben
Copy link
Contributor

cben commented Jan 16, 2018

What happens if you have old rules?
Once you switch to new rules, can you still have old alerts in queue?
Looks like code won't crash, at worst message will be nil & severity will default to "error". 👍

@moolitayer
Copy link
Author

Thanks @cben, I added some tests.

I don't think there are backward compatibility issues. I'm aiming to have this in the first released version of Prometheus alerts.

# TODO(mtayer): remove after https://github.com/ManageIQ/manageiq/pull/16339
event[:ems_ref] = incident_identifier(labels, annotations, event["startsAt"])
event[:resolved] = event["status"] == "resolved"
{
:source => "DATAWAREHOUSE",
:timestamp => Time.zone.now,
:event_type => "datawarehouse_alert",
:message => annotations["message"],
:message => annotations["description"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're settling on a convention where 'summary' is the short string (general data) and 'description' is the more verbose, detailed string (with specific data). For example:

alert: DockerLatencyHigh
expr: round(max(kubelet_docker_operations_latency_microseconds{quantile="0.9"})
  BY (instance) / 1e+06, 0.1) > 1
for: 5m
labels:
  severity: warning
annotations:
  summary: Docker latency is high
  description: Docker latency is {{ $value }} seconds for 90% of kubelet operations

As an operator, the more compact 'summary' is what I would want displayed inline, expanding to display 'description' if I want more details.

Copy link
Author

@moolitayer moolitayer Jan 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the screen is designed to have only one type of message.
And although we persist both we pass only the long name to the alert and show in the screen.

Would you like to open a bug for this to change?

# "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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be one of info|warning|error?

@miq-bot
Copy link
Member

miq-bot commented Jan 18, 2018

Checked commit moolitayer@918e9e5 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

Copy link
Contributor

@cben cben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let me know when OK to merge.
(does this depend on openshift/origin#17608?)

@moolitayer
Copy link
Author

(does this depend on openshift/origin#17608?)

No, it is does not, while this is only about agreeing on the metadata it is important that we release our first version of this based on that agreement. Ready for merge.

@cben cben merged commit 700ec3f into ManageIQ:master Jan 21, 2018
simaishi pushed a commit that referenced this pull request Jan 26, 2018
@simaishi
Copy link

Gaprindashvili backport details:

$ git log -1
commit c53d253a77309b4443d93816a504fb0e6b1f5b5e
Author: Beni Cherniavsky-Paskin <[email protected]>
Date:   Sun Jan 21 21:38:26 2018 +0200

    Merge pull request #217 from moolitayer/change_alert_meta
    
    Change alert definition meta
    (cherry picked from commit 700ec3fa6ca9dda1f8def99328481d6ae034f45c)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1539067

@agrare agrare added this to the Sprint 78 Ending Jan 29, 2018 milestone Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants