-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Right now with gcloud-aio-pubsub==6.3.0 subscriber module records metrics with prometheus_client with no way to configure this behavior or turn it off
The doctoring from init mentions this behavior
...
If you like pull-based metrics like Prometheus you will be pleased to know that
the subscriber records Prometheus metrics in the form
gcloud_aio_pubsub_<metric>, which will have no effect if you don't use
Prometheus to scrape app metrics:
...
What it does not mention is that it will have an effect if you do use Prometheus to scrape app metrics, and can interfere with your configuration
In my setup I run multiprocess application and do record Prometheus metrics. The only way to make prometheus_client library to work with multiprocesses is to set PROMETHEUS_MULTIPROC_DIR env var and create the directory. gcloud-aio-pubsub does not expects this use case and does not check the env var to create a directory.
Doing it prior to the library import or mocking the internal .metrics modules is possible but will be a kludge, not a clean solution
I would much appreciate if metrics collection would be opt in by default (or at least possible to opt out with pip optional dependencies mechanism or env var). IMHO it should be opt in as most users don't need and don't expect those metrics
I will be happy to make the required changes myself, just let me know if you (the owners and maintainers) are ok with the proposal, and which solution you would prefer