Skip to content

Provide way to set default tags for all metrics #5

Description

@domdorn

I need to have a way to add certain tags to all metrics, e.g. I want to globally create a tag "application" with value "myApp" that then gets added to all metrics, e.g.

the response from the prometheus endpoint:

$ curl -i http://localhost:8080/metrics
HTTP/1.1 200 OK
content-type: text/plain
content-length: 278

# TYPE count_all_requests counter
# HELP count_all_requests Some help
count_all_requests{method="POST",handler="/users"}  2.0 1655210796102
# TYPE count_all_requests counter
# HELP count_all_requests Some help
count_all_requests{method="GET",handler="/users"}  1.0 1655210796102⏎

changes to

$ curl -i http://localhost:8080/metrics
HTTP/1.1 200 OK
content-type: text/plain
content-length: 278

# TYPE count_all_requests counter
# HELP count_all_requests Some help
count_all_requests{application="myApp",method="POST",handler="/users"}  2.0 1655210796102
# TYPE count_all_requests counter
# HELP count_all_requests Some help
count_all_requests{application="myApp",method="GET",handler="/users"}  1.0 1655210796102⏎

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions