Replace metrics FF with environment variable
What does this MR do and why?
Describe in detail what your merge request does and why.
Replace metrics FF with environment variable
We want a way to easily enable/disable the Rust native extension to
prometheus-client-mmap
. Initially we added the prom_metrics_rust
feature flag in !119005 (merged), but when
enabled on staging this did nothing.
It turns out that metrics run in a separate WEbrick
process that does
not have the ability to access feature flags. The approach taken in a
similar situation in the past,
!84567 (merged) was
to check for an environment variable, so we replace the FF with a check
against environment variable GITLAB_RUST_METRICS_EXTENSION
.
This is less ergonomic than feature flags, but is the simplest option to get things moving.
How to set up and validate locally
- Enable sidekiq and web exporters in GDK and reconfigure:
gitlab: monitoring: sidekiq_exporter: enabled: true web_exporter: enabled: true
- Add
GITLAB_RUST_METRICS_EXTENSION=true
toProcfile
forrails-web
andrails-background-jobs
-
curl localhost:<EXPORTER_PORT>/metrics
and confirm metrics are returned
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.