Prometheus custom PromQL: is the "Metric" section broken?

Hi,

I can’t understand how to create Metrics from custom Prometheus queries with PromQL.
The rule contains checkbox “Metrics”. But once activated, it asks me to select metrics from an existing (long) list of metrics (which do NOT come from Prometheus).

Also, the “filter by host and service” does not make sense to me.

image

From my understanding, it should be enough to have a checkbox “create metric”, because the metric label is already set with the very first field.

I hope I’m not wrong, but I don’t think this component is correct here. I find it elsewhere when it comes to selecting existing metrics for reports, etc. But this is about creating a metric.

My feeling is further substantiated by the fact that this Metric component does not contain any further help at all, compared to all other components of this WATO page.
The documentation also skips this field completely.
it looks somehow “forgotten”:
image

Questions here in the forum on how to get metrics from PromQL-Queries are a) rare and b) the few existing ones are unanswered.

Can someone clarify this?

Thanks,
Simon

Hi Simon,

Thank you for your message. As you correctly noted, the listed metrics are not part of Prometheus itself. The list contains all registered metrics on Checkmk’s site (which are defined here checkmk/cmk/gui/plugins/metrics at master · tribe29/checkmk · GitHub). In the case of the custom PromQL, selecting the metric gives you the option to display your queried value with the correct unit and a title in the context of the graph. I agree with you that this should be better addressed in the documentation and I will create a follow up ticket to address this issue

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.