Curtis Kennington created NIFI-14454:
----------------------------------------
Summary: Counter values are recorded as 0 in Prometheus Metrics
Key: NIFI-14454
URL: https://issues.apache.org/jira/browse/NIFI-14454
Project: Apache NiFi
Issue Type: Bug
Components: NiFi API
Affects Versions: 2.3.0
Reporter: Curtis Kennington
When using NiFi 1.x, we used Counters to provide custom metrics - these were
commonly used to identify failures in the flow (e.g. SFTP failed, etc.). These
were exposed in Prometheus format via PrometheusReportingTask.
When upgraded to NiFi 2.x, the PrometheusReportingTask was removed in favour of
the {{nifi-api/flow/metrics/prometheus}} API. However (potentially as this API
is flow orientated?) the counters have a value of 0:
{quote}nifi_processor_counters\{processor_name="Inc upload success
counter",counter_name="billing_upload_success",processor_id="bb721341-39ed-3c32-70be-1972da8770d7",instance="004d0f09-0196-1000-d983-0eb3588c281c",}
0.0
{quote}
In the counter API we can see that these counters have positive values set:
{quote} {
"id": "12fa996f-b0fb-3df0-afee-0fa598768c25",
"context": "All UpdateCounter's",
"name": "billing_upload_success",
"valueCount": 100,
"value": "100"
},
{quote}
Is this a defect, or are we implementing our metrics incorrectly?
How can we expose the counters as prometheus metrics, so we can raise our own
alarms for operators to take human manual actions when something goes wrong?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)