pcp icon indicating copy to clipboard operation
pcp copied to clipboard

Push PCP metrics to Prometheus

Open mallilinux1980 opened this issue 2 years ago • 6 comments

How to expose pcp metrics to Prometheus? Can fluentbit be leveraged push metrics to Prometheus remote write?

mallilinux1980 avatar Jul 24 '23 10:07 mallilinux1980

pmproxy(1) provies a /metrics endpoint - see the pmwebapi(3) man page for more details.

natoscott avatar Jul 24 '23 10:07 natoscott

Actual question was around how to push metrics to Prometheus instead of Prometheus pulling from target pmproxy which may not suit well for enterprise environment.

mallilinux1980 avatar Jul 24 '23 17:07 mallilinux1980

To achieve what you're after we'd need a pcp2prometheus or pcp2openmetrics utility I think. It doesn't exist yet but there are many similar tools in PCP - it would be great if someone were to take this one on (little python project).

natoscott avatar Jul 24 '23 22:07 natoscott

Some sample python code I wrote a little while ago that may be useful here. It show's how to convert PCP metric metadata into openmetrics format: https://gist.github.com/natoscott/5186664bab2ebbba8e7596f81d3d5feb

natoscott avatar Jul 24 '23 22:07 natoscott

Thanks for prompt response.

we’re thinking to use this as an alternative provided fluentbit is enabled every collector host. Do you have any thoughts or concerns?

https://docs.fluentbit.io/manual/pipeline/outputs/prometheus-remote-write#

pcp2json + fluentbit -> Prometheus remote write

mallilinux1980 avatar Jul 25 '23 03:07 mallilinux1980

No reason it wont work AFAICT. It would be more efficient to combine the pcp2json+fluentbit into a single pcp2openmetrics script though, but I guess you need to work with what is available today.

natoscott avatar Jul 25 '23 03:07 natoscott

pcp2openmetrics(1) exists since pcp-6.2.1.

natoscott avatar Aug 19 '24 23:08 natoscott