Here’s the translation of your question for Stack Overflow:
I have a Prometheus-related question.
I expect the method
label to appear consistently as GET
and POST
:
acs_go_http_requests_in_flight{method="GET",route="/ads/v1/mobile_leaderboard"} 0
acs_go_http_requests_in_flight{method="POST",route="/ads/v1/mobile_leaderboard"} 0
acs_go_http_requests_in_flight{method="GET",route="/ads/v1/promo_banner"} 0
acs_go_http_requests_in_flight{method="POST",route="/ads/v1/promo_banner"} 0
... and so on
However, in reality, the method
label appears inconsistently, sometimes interchanging GET
and POST
. Occasionally, it even shows as GETT
:
acs_go_http_requests_in_flight{method="GETT",route="/ads/v1/promo_banner"} 0
Here is a link to the relevant code:
middleware.go#L85-L121
I’ve seen a similar error message before, but I don’t think I’m registering the metric multiple times:
An error has occurred while serving metrics:
was collected before with the same name and label values
What could be causing this issue in my code?