I have written prometheus Custom exporter which expose metric from my app and it runs in a loop
Lets say in first run , if i do list sessions, I may get 4 entries and all 4 will be created as Guage metrics
After sometime one session is completed, now I have only 3 entries and custom exporter will update the value for al 3 entries. But when i get metrics from custom exporter, 4th one with older value will be still there and it wont go away overtime
I saw it is handled nicely in node exporter, kube-state-metrics etc.. when pod/node goes down, we dont see entry in prometheus
Is it prometheus configuration or any settings I have to do in custom exporter
I was thinking to keep a backup data and compare and use /delete_series API to delete older entries. I am not sure this is right way to handle this.
Samarth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.