discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

Is there an option to populate metrics on startup? #290

Open NickLarsenNZ opened 10 months ago

NickLarsenNZ commented 10 months ago

When I start prometheus_exporter for delayed job, I don't see metrics until a job has run. So after deploying a new version of the app, we have no metrics for a while.

Is there, or could there in future be an option to get current metrics on startup? I expect this might be difficult/impossible since the metrics are probably populated on a function call, but thought I would ask just in case.

NickLarsenNZ commented 10 months ago

For example, the vertical dotted line is where the container came up. But it took many hours (until the job ran) to get a metric to appear. Ant it lasted until a new version of the app was deployed and then we had to wait for more metrics to appear.

It makes for rather patchy graphs when we are releasing many times per day but job schedules are fixed to certain times of the day.

image
benoittgt commented 2 months ago

You could trigger an event but which value do you want? 0?