noblenumbat360 commented on a change in pull request #5447:
URL: https://github.com/apache/nifi/pull/5447#discussion_r740655325



##########
File path: 
nifi-nar-bundles/nifi-extension-utils/nifi-prometheus-utils/src/main/java/org/apache/nifi/prometheus/util/PrometheusMetricsUtil.java
##########
@@ -101,20 +98,6 @@ public static CollectorRegistry 
createNifiMetrics(NiFiMetricsRegistry nifiMetric
         final String componentId = StringUtils.isEmpty(status.getId()) ? 
DEFAULT_LABEL_STRING : status.getId();
         final String componentName = StringUtils.isEmpty(status.getName()) ? 
DEFAULT_LABEL_STRING : status.getName();
 
-        // Clear all collectors to deal with removed/renamed components -- for 
root PG only
-        if("RootProcessGroup".equals(componentType)) {

Review comment:
       Thanks for the response.
   Removing this code does not cause a regression in PrometheusReportingTask. 
The correct behavior is confirmed by the existing tests starting on line 142 in 
PrometheusReportingTaskIT.java as well as manually confirmed.
   The removed code is no longer needed because a new NiFiMetricsRegistry is 
created (line 142 in PrometheusReportingTask.java) before each call to 
createNifiMetrics.
   This change was introduced in NIFI-7379 Support multiple instances of 
Prometheus registries/metrics.
   
   In hindsight, I should have had the removed code as a separate ticket as it 
isn't required to be removed to fix the bug I reported in NIFI-8272. Although 
it is all related so I did the work together.
   




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to