Hi Christian,

I'm in the same boat as you and I've found its possible to use the
sampleLabelValue query param I personally pass
(RootProcessGroup|ProcessGroup) to it.

https://github.com/apache/nifi/blob/main/nifi-framework-bundle%2Fnifi-framework%2Fnifi-web%2Fnifi-web-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fnifi%2Fweb%2Fapi%2FFlowResource.java#L576

The main drawback is it still iterates all the component metrics in the
backend but at least your Prometheus will not need to store so much.

I was thinking that the metrics endpoint should bring back the metrics
reporting strategy as a query parameter that just applies to the NIFI
metrics registry.

-Eric

On Mon, Jun 23, 2025, 3:24 AM Christian Wahl <[email protected]>
wrote:

> Hey guys,
>
> In NiFi 1.x I have used the PrometheusReportingTask and the Metrics
> reporting strategy was set to "Root Process Group”.
>
> On 2.x I can fetch the data from the REST API endpoint
> /nifi-api/flow/metrics/prometheus, but I can’t figure out how to restrict
> it to only the Root Process Group like before.
> Without any restrictions I get the metrics for every single component,
> which is too much to handle (50-60k metrics).
>
> Has anyone an idea on how I can replicate the old behavior?
>
> Kind regards,
> Christian Wahl

Reply via email to