You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Joe Witt (Jira)" <ji...@apache.org> on 2020/01/14 18:03:00 UTC

[jira] [Resolved] (NIFI-6902) PrometheusReportingTask doesn't work with Output ports

     [ https://issues.apache.org/jira/browse/NIFI-6902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Witt resolved NIFI-6902.
----------------------------
    Resolution: Fixed

> PrometheusReportingTask doesn't work with Output ports
> ------------------------------------------------------
>
>                 Key: NIFI-6902
>                 URL: https://issues.apache.org/jira/browse/NIFI-6902
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.10.0
>            Reporter: Tom Brisland
>            Assignee: Matt Burgess
>            Priority: Major
>              Labels: reporting_task
>             Fix For: 1.11.0
>
>         Attachments: 0001-NIFI-6902-Update-PrometheusReportingTask-to-supply-c.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Placing an OutputPort anywhere on the canvas causes the following stacktrace when querying the Prometheus metrics.
>  
> {code:java}
> java.lang.IllegalArgumentException: Incorrect number of labels. at io.prometheus.client.SimpleCollector.labels(SimpleCollector.java:64) at org.apache.nifi.reporting.prometheus.api.PrometheusMetricsUtil.createNifiMetrics(PrometheusMetricsUtil.java:483) at org.apache.nifi.reporting.prometheus.PrometheusReportingTask.lambda$onScheduled$0(PrometheusReportingTask.java:121) at org.apache.nifi.reporting.prometheus.PrometheusServer$MetricsServlet.doGet(PrometheusServer.java:71) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:876) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1347) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1249) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:505) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917) at java.lang.Thread.run(Thread.java:748)
> {code}
>  
> This appears to be because the parentGroupId isn't provided in PrometheusMetricsUtil on this line 
> {code:java}
> AMOUNT_FLOWFILES_RECEIVED.labels(instanceId, portComponentType, portComponentName, portComponentId).set(portStatus.getFlowFilesReceived());{code}
> despite being specified as a label here
> {code:java}
> private static final Gauge AMOUNT_FLOWFILES_RECEIVED = Gauge.build()
>         .name("nifi_amount_flowfiles_received")
>         .help("Total number of FlowFiles received by the component")
>         .labelNames("instance", "component_type", "component_name", "component_id", "parent_id")
>         .register(NIFI_REGISTRY);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)