pcp icon indicating copy to clipboard operation
pcp copied to clipboard

[RFE] Retrieve top X instances using derived metrics

Open andreasgerstmayr opened this issue 4 years ago • 4 comments

Use Case: It's desirable to show only the top X instances, for example showing the top X CPU or MEM-using processes on the system on a chart in Grafana.

The Grafana way is that the query should specify the selected data, so in our case we need a derived metrics function getting the top X instances of a metric. Afaics the current way is that PCP client tools perform the filtering, but with Grafana it's favorable that the filtering happens on the server side to reduce the amount of transferred data (proc metrics tend to have lots of instances) and keep it flexible (query language is more flexible than UI options).

andreasgerstmayr avatar Mar 29 '21 13:03 andreasgerstmayr

Has this been implemented yet?

mallilinux1980 avatar Jul 22 '23 17:07 mallilinux1980

Not in derived metrics, no. The pmseries(1) query language supports topN instances now though if that helps (for our PCP Redis datasource in grafana-pcp). But the derived metrics from libpcp do not support this concept (hence, the Vector datasource in grafana-pcp does not support it).

natoscott avatar Jul 22 '23 23:07 natoscott

Great if you could refer me to some docs on how to set it up.

mallilinux1980 avatar Jul 23 '23 13:07 mallilinux1980

These are your best starting points ... https://pcp.readthedocs.io/en/latest/UAG/TimeSeriesQuerying.html https://pcp.readthedocs.io/en/latest/HowTos/scaling/index.html

natoscott avatar Jul 23 '23 22:07 natoscott