Exposing prometheus metrics failing with 500 error

118 views
Skip to first unread message

Geet Manghnani

unread,
Jul 13, 2022, 9:29:56 PM7/13/22
to Prometheus Users
I get the following error in some situations.

```
was collected before with the same name and label values
```

On the restart of the target service where the metrics are exposed, It exposes the metrics initially but later start throwing 500 to the prometheus on scrape.

On accessing the /metrics endpoint, I see this in the return.

was collected before with the same name and label values

Could someone help me understand why I am getting this error?
I am using golang client of prometheus 

I am using go fiber to expose the metrics.

func MetricsRoutes(api fiber.Router) {
api.Get("/metrics", adaptor.HTTPHandler(promhttp.Handler()))
}

On my local setup It works fine and only in some environment, i get the. 500 error 
Reply all
Reply to author
Forward
0 new messages