nlopes / actix-web-prom

Actix-web middleware to expose Prometheus metrics
MIT License
93 stars 56 forks source link

Add support for setting additional labels #8

Closed rabadin closed 4 years ago

rabadin commented 5 years ago

Drive-by: update README.md file.

A typical use-case is this: an actix-based application is deployed in k8s as a deployment and thus each replica will expose a different /metrics endpoint. Adding a instance=<replicaID> label to the metrics means that prometheus will see each replica as a different series and will be able to aggregate the metrics across replicas.

nlopes commented 4 years ago

Does it make sense to also pass through variable_labels if we're doing this? I'd rather not break the api twice. What do you think?

rabadin commented 4 years ago

Does it make sense to also pass through variable_labels if we're doing this? I'd rather not break the api twice. What do you think?

While I understand the concern, I don't think it makes sense to expose variable_labels to the end user: here the variable_labels are something actix-web-prom uses internally (for instance http_requests_total uses the endpoint, method and status variable labels).