digitalocean / prometheus-client-c

A Prometheus Client in C
Other
160 stars 79 forks source link

Is there a way not to expose process_* metrics? #56

Open nicolacdnll opened 3 years ago

nicolacdnll commented 3 years ago

As the title says, is there a way not to expose process_* metrics?

I've given a quick look at the code and prom_collector_registry_t->disable_process_metrics seems the knob I'm looking for, but it seems it's never used. Besides, it seems that collecting and exposing process metrics is enabled by default: https://github.com/digitalocean/prometheus-client-c/blob/c57034d196582d99267d027abb52a05a55dc07f6/prom/src/prom_collector_registry.c#L91-L99

I guess that one could always edit and recompile the library but I was looking for something out of the box.

xmcqueen commented 3 years ago

If its been enabled by default for some time, it seems best to add a new cli option to turn them off via that disable_process_metrics setting you found.

@nicolacdnll are you going to put a PR for this?

nicolacdnll commented 3 years ago

I might, but definitely not in the upcoming 2-3 weeks.