You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
While testing the Prometheus metrics, I noticed that the metric labels are not escaped correctly.
Example ra_metrics for 2 quorum queues:
"qq on the default vhost
queue \qq on the vhost "myvhost:
# TYPE rabbitmq_detailed_raft_log_commit_index gauge
# HELP rabbitmq_detailed_raft_log_commit_index Raft log commit index
rabbitmq_detailed_raft_log_commit_index{vhost=""myvhost",queue="\qq"} 2
rabbitmq_detailed_raft_log_commit_index 8
rabbitmq_detailed_raft_log_commit_index{vhost="/",queue=""qq"} 2
rabbitmq_detailed_raft_log_commit_index 10
# TYPE rabbitmq_detailed_raft_log_last_written_index gauge
# HELP rabbitmq_detailed_raft_log_last_written_index Raft log last written index
rabbitmq_detailed_raft_log_last_written_index{vhost=""myvhost",queue="\qq"} 2
rabbitmq_detailed_raft_log_last_written_index 8
rabbitmq_detailed_raft_log_last_written_index{vhost="/",queue=""qq"} 2
rabbitmq_detailed_raft_log_last_written_index 10
Reproduction steps
Start a RabbitMQ node locally.
Create a quorum queue with name "qq.
(Optional) Create a new vhost "myvhost and add a quorum queue named \qq.
label_value can be any sequence of UTF-8 characters, but the backslash (\), double-quote ("), and line feed (\n) characters have to be escaped as \\, \", and \n, respectively.
Describe the bug
Hi,
While testing the Prometheus metrics, I noticed that the metric labels are not escaped correctly.
Example
ra_metrics
for 2 quorum queues:"qq
on the default vhost\qq
on the vhost"myvhost
:Reproduction steps
"qq
."myvhost
and add a quorum queue named\qq
.Expected behavior
Label values are escaped correctly as per Prometheus Exposition Format.
For example:
Additional context
I took a quick look at the dependent
prometheus.erl
library. Looks like it escapes the label values. Not sure why RabbitMQ doesn't.https://github.com/deadtrickster/prometheus.erl/blob/b78e17eda43c7fcb2c05f76c7dd80db969cd8479/src/formats/prometheus_text_format.erl#L238-L245
The text was updated successfully, but these errors were encountered: