Skip to content

prometheus duplicate metrics #1941

@jayasai470

Description

@jayasai470

prometheus metrics endpoint return duplicate metrics and not updating them properly on a SimpleWebServer api endpoints.

Steps to reproduce
Created a sample repo which reproduces this issue. https://github.com/jayasai470/opentelemetry-cpp-sample

What is the expected behavior?
Get metrics without duplicates

What is the actual behavior?

# HELP http_server_duration_count 1.8.1
# TYPE http_server_duration_count counter
http_server_duration_count{method="GET",status="200",path="/api/health"} 3 1674066565733
http_server_duration_count{method="GET",status="200",path="/api/test"} 2 1674066565733
# HELP http_server_duration_count 1.8.1
# TYPE http_server_duration_count counter
http_server_duration_count{method="GET",status="200",path="/api/test"} 2 1674066566733
http_server_duration_count{method="GET",status="200",path="/api/health"} 3 1674066566733

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions