abhishekrb19 commented on code in PR #14935:
URL: https://github.com/apache/druid/pull/14935#discussion_r1313236260
##########
extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/PrometheusEmitter.java:
##########
@@ -207,6 +207,15 @@ public void close()
} else {
exec.shutdownNow();
flush();
+
+ if (pushGateway != null && config.isDeleteOnShutdown()) {
+ try {
+ pushGateway.delete(config.getNamespace(),
ImmutableMap.of(config.getNamespace(), identifier));
Review Comment:
Will this operation delete _all_ task metrics, including any non-stale
metrics that were recently flushed above? What do you think about leveraging
`push_time_seconds` added by the PushGateway and use that to cleanup only stale
metrics that are older than a defined TTL. Something like:
- Query prometheus for `push_time_seconds{identifier}` - this will require
additional prometheus server config, though.
- Then delete the identifier metrics only if the timestamp is older than say
1 minute.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]