pcp
pcp copied to clipboard
[RFE] Retrieve top X instances using derived metrics
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).
Has this been implemented yet?
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).
Great if you could refer me to some docs on how to set it up.
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