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

Expose resource alarms as Prometheus metrics #2653

Closed
dcorbacho opened this issue Nov 20, 2020 · 7 comments · Fixed by #3312
Closed

Expose resource alarms as Prometheus metrics #2653

dcorbacho opened this issue Nov 20, 2020 · 7 comments · Fixed by #3312

Comments

@dcorbacho
Copy link
Contributor

Alarms could make it into a core metrics table as binary entries and be reported by Prometheus.
CC @MarcialRosales

@michaelklishin
Copy link
Member

Good idea.

@michaelklishin michaelklishin changed the title Export rabbit alarms in Prometheus Expose resource alarms as Prometheus metrics Nov 30, 2020
@deadtrickster
Copy link
Collaborator

I can write a collector that calls rabbit_alarm:get_alarms and exposes alarms as metrics with nodes as labels. Is this what you had in mind?

@deadtrickster
Copy link
Collaborator

this is how one of the unofficial exporters handles alarms:

https://github.com/kbudde/rabbitmq_exporter#node---counter

@deadtrickster deadtrickster self-assigned this Jul 29, 2021
@gerhard
Copy link
Contributor

gerhard commented Jul 29, 2021

That sounds like a great idea @deadtrickster!

This comment from a larger 2019 discussion with @brian-brazil explains why node labels should not be used. Has this recommendation changed? This is the reason why we make extensive use of * on(instance) group_left(rabbitmq_cluster, rabbitmq_node) in all our PromQL.

I'm thinking:

rabbitmq_memory_alarm 0
rabbitmq_disk_alarm 0

By the way:

%% Because all metrics are from RabbitMQ's perspective,
%% cached for up to 5 seconds by default (configurable),
%% we prepend rabbitmq_ to all metrics emitted by this collector.
%% Some metrics are for Erlang (erlang_), Mnesia (schema_db_) or the System (io_),
%% as observed by RabbitMQ.
-define(METRIC_NAME_PREFIX, "rabbitmq_").

@deadtrickster
Copy link
Collaborator

ok right, instance label is enough already. so boolean metrics for each resource type without any labels.

@lhoguin
Copy link
Contributor

lhoguin commented Jul 30, 2021

Anything else worth importing from the unofficial exporter?

deadtrickster added a commit that referenced this issue Aug 16, 2021
mergify bot pushed a commit that referenced this issue Aug 17, 2021
close #2653

(cherry picked from commit 9fed915)
mergify bot pushed a commit that referenced this issue Aug 17, 2021
close #2653

(cherry picked from commit 9fed915)

# Conflicts:
#	deps/rabbitmq_prometheus/src/rabbit_prometheus_dispatcher.erl
#	release-notes/3.9.4.md
@michaelklishin michaelklishin added this to the 3.9.4 milestone Aug 17, 2021
@johanneswuerbach
Copy link
Contributor

Anything else worth importing from the unofficial exporter?

In our setup we also use the rabbitmq_partitions metric, would it also make sense to port this one?

There is another issue open for that though #2508

michaelklishin pushed a commit that referenced this issue Nov 11, 2021
close #2653

(cherry picked from commit 9fed915)

Conflicts:
	deps/rabbitmq_prometheus/src/rabbit_prometheus_dispatcher.erl
	release-notes/3.9.4.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants