szaszm commented on code in PR #1340:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1340#discussion_r899183077


##########
METRICS.md:
##########
@@ -0,0 +1,153 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+      http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Apache NiFi - MiNiFi - C++ Metrics Readme.
+
+
+This readme defines the metrics published by Apache NiFi. All options defined 
are located in minifi.properties.
+
+## Table of Contents
+
+- [Description](#description)
+- [Configuration](#configuration)
+- [Metrics](#metrics)
+
+## Description
+
+Apache NiFi MiNiFi C++ can communicate metrics about the agent's status, that 
can be a system level or component level metric.
+These metrics are exposed through the agent implemented metric publishers that 
can be configured in the minifi.properties.
+Aside from the publisher exposed metrics, metrics are also sent through C2 
protocol of which there is more information in the
+[C2 documentation](C2.md#metrics).
+
+## Configuration
+
+To configure the a metrics publisher first we have to set which publisher 
class should be used:
+
+       # in minifi.properties
+
+       nifi.metrics.publisher.class=PrometheusMetricsPublisher
+
+Currently PrometheusMetricsPublisher is the only available publisher in MiNiFi 
C++ which publishes metrics to a Prometheus server.
+To use the publisher a port should also be configured where the metrics will 
be available to be scraped through:
+
+       # in minifi.properties
+
+       nifi.metrics.publisher.port=9936

Review Comment:
   Even if there can only be one publisher, I want to prepare the configuration 
to future publishers that don't use exactly one TCP or UDP port. It would be a 
shame if the next implementation of the interface had to break the config of 
Prometheus+MiNiFi users.
   
   I'm fine with the other option being `nifi.metrics.publisher.class` and 
possibly still supporting a comma-separated list of classes later. It can stay 
as zero or one classes now, and change later, since that change doesn't break 
backwards compatibility. I don't think that a differently named property and a 
string split by commas is too much extra complexity in exchange for better 
future proofing.



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