Closed berkobob closed 1 year ago
I haven't looked into your code, but one idea that I have: Are you using a browser and maybe the browser is performing two calls? Favicon? Options request? But I can try to have a look later today.
You are quite right. When I do a curl from the command line the counter increments by 1! How do I avoid this problem in production, or does prometheus sort that out?
It depends, you will probably not have a counter for the metrics endpoint and the metrics endpoint would be called/scraped by prometheus.
For other endpoints you could make sure to exclude favicons / OPTIONS requests. But it depends if you want to know about them or not. They can also generate load / errors.
I'm just writing my first exporter. I'm sure I'm just doing something stupid but everytime I make a request my Counter goes up by 2!
1st response:
2nd response: