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

alert rule can use defined value? #4658

Closed
fumanne opened this Issue Sep 26, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@fumanne
Copy link

fumanne commented Sep 26, 2018

My one metrics looks like this:

ceph_osd_up{ceph_daemon="osd.0",cluster="aaaaa",endpoint="http-metrics",instance="172.20.198.250:9283",job="rook-ceph-mgr",namespace="rook",pod="rook-ceph-mgr0-79f59b566-2lqvd",service="rook-ceph-mgr"}

ceph_osd_up{ceph_daemon="osd.1",endpoint="http-metrics",instance="172.20.164.17:9283",job="rook-ceph-mgr",namespace="rook",pod="rook-ceph-mgr0-79f59b566-snzx5",service="rook-ceph-mgr"}

first metrics have cluster label, second have not cluster label
When I configure alert rule. I want to show cluster in every metrics (but the second rule have not cluster label).
Whether alert rule can support the default label value which I can defined (if metrics have no this label).
I mean alert rule looks like this:
description: {{ $labels.ceph_daemon }} In {{ $labels.cluster | default bbbb }} is Down'

@SuperQ

This comment has been minimized.

Copy link
Member

SuperQ commented Sep 26, 2018

You can fix this in your query with label_replace().

label_replace(ceph_osd_up, "cluster", "bbbb", "cluster", "")
@SuperQ

This comment has been minimized.

Copy link
Member

SuperQ commented Sep 26, 2018

For usage questions/help, please use our community. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@SuperQ SuperQ closed this Sep 26, 2018

@fumanne

This comment has been minimized.

Copy link
Author

fumanne commented Sep 26, 2018

@SuperQ
Wow..... wonderful!!!.... thanks you very much

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 25, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.