parca-dev / parca

Continuous profiling for analysis of CPU and memory usage, down to the line number and throughout time. Saving infrastructure cost, improving performance, and increasing reliability.
https://parca.dev/
Apache License 2.0
4.04k stars 210 forks source link

Jsonnet: make scrape_configs in configmap configurable #307

Open yeya24 opened 2 years ago

yeya24 commented 2 years ago

Now in the jsonnet lib, the configmap is very basic and doesn't support adding additional scrape configs. For us who still rely on getting memory profiles via /pprof, it is not easy to configure it now.

maxbrunet commented 2 years ago

I have written a couple rudimentary Jsonnet functions that provide an experience similar to PodMonitor/ServiceMonitor from the prometheus-operator (promcfg.go), but not sure if this is something you would want to deal with in the repo at this point (a parca operator would be better but definitly way too early for that)

yeya24 commented 2 years ago

@maxbrunet That would be very helpful for us!

metalmatze commented 2 years ago

Very cool. Yeah, I'm not sure if we want these objects directly in Parca itself. We never really discussed a Parca Operator so far, so it'd be interesting to get other opinions on this matter. :relaxed:

maxbrunet commented 2 years ago

I have shared the utilities here for now: https://github.com/maxbrunet/parca-jsonnet-libs

Basically, s/(Pod|Service)Monitors/\1Profilers/.

Here is the interesting usage bit: maxbrunet/parca-jsonnet-libs@743f821/examples/parca.libsonnet#L10-L69

Their implementation:

Let me know if there is any interest to do something from that.