I have a springboot Kotlin web service that uses Actuator (spring-boot-starter-actuator
) and micrometer (micrometer-registry-prometheus
) to expose metrics to a prometheus scraper.
To monitor the size of operations in a queue I use a custom Gauge
val gauge = Gauge.build()
.name("operation_queue_size")
.help("Size of queue")
.register(collectorRegistry)
# later
gauge.inc()
# or
gauge.dec()
I would like to improve this metric adding a tag that represents the type of the operation in the queue, but didn't find any appropriate method on the Builder class.
The goal would be to expose a metric like:
operation_queue_size{op_type="deletions"} 999
operation_queue_size{op_type="insertions"} 999
Thanks.