lordgamez commented on code in PR #1385:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1385#discussion_r960440737


##########
METRICS.md:
##########
@@ -46,77 +46,88 @@ To use the publisher a port should also be configured where 
the metrics will be
 
        nifi.metrics.publisher.PrometheusMetricsPublisher.port=9936
 
-The last option defines which metric classes should be exposed through the 
metrics publisher in configured with a comma separated value:
+The following option defines which metric classes should be exposed through 
the metrics publisher in configured with a comma separated value:
 
        # in minifi.properties
 
        
nifi.metrics.publisher.metrics=QueueMetrics,RepositoryMetrics,GetFileMetrics,DeviceInfoNode,FlowInformation
 
+An agent identifier should also be defined to identify which agent the metric 
is exposed from. If not set, the hostname is used as the identifier.
+
+       # in minifi.properties
+
+       nifi.metrics.publisher.agent.identifier=Agent1
+
 ## Metrics
 
 The following section defines the currently available metrics to be published 
by the MiNiFi C++ agent.
 
 NOTE: In Prometheus all metrics are extended with a `minifi_` prefix to mark 
the domain of the metric. For example the `connection_name` metric is published 
as `minifi_connection_name` in Prometheus.
 
+## Generic labels

Review Comment:
   Updated in 0a19f946e806c662e17edf7ab4959aa5f66da3c2



##########
extensions/prometheus/tests/PrometheusMetricsPublisherTest.cpp:
##########
@@ -98,11 +100,12 @@ 
TEST_CASE_METHOD(PrometheusPublisherTestFixtureWithDummyExposer, "Test adding me
     auto collection = stored_metric->Collect();
     for (const auto& metric_family : collection) {
       for (const auto& prometheus_metric : metric_family.metric) {
-        for (const auto& label : prometheus_metric.label) {
-          if (label.name == "metric_class") {
-            REQUIRE(ranges::find(valid_metrics_without_flow, label.value) != 
ranges::end(valid_metrics_without_flow));
-          }
-        }
+        auto metric_class_label_it = ranges::find_if(prometheus_metric.label, 
[](const auto& label) { return label.name == "metric_class"; });
+        REQUIRE(metric_class_label_it != ranges::end(prometheus_metric.label));
+        REQUIRE(ranges::find(valid_metrics_without_flow, 
metric_class_label_it->value) != ranges::end(valid_metrics_without_flow));

Review Comment:
   Updated in 0a19f946e806c662e17edf7ab4959aa5f66da3c2



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