abhishekrb19 commented on code in PR #19026:
URL: https://github.com/apache/druid/pull/19026#discussion_r2898807438


##########
extensions-contrib/prometheus-emitter/src/main/java/org/apache/druid/emitter/prometheus/PrometheusEmitter.java:
##########
@@ -145,6 +167,9 @@ public void emit(Event event)
   private void emitMetric(ServiceMetricEvent metricEvent)
   {
     String name = metricEvent.getMetric();
+    if (shouldFilterOutMetric(name)) {
+      return;
+    }

Review Comment:
   Hmm, instead of doing this for every single emitter, what do you think about 
adding an abstract class that implements `MetricFilteringEmitter implements 
Emitter` and overrides `emit()` ? This class can have awareness about global 
configs instantiated from the specific sub-class Emitters like 
PrometheusEmitter, LoggingEmitter, etc and delegate the filtering to it if the 
config is enabled or just fall back to current behavior? I will think about 
this more. @jtuglu1 - do you have suggestions here?



-- 
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]

Reply via email to