Adds Labkit::Metrics behind an environment variable
What does this MR do and why?
Depends on Adding the Metrics module (gitlab-org/ruby/gems/labkit-ruby!135 - merged).
Adds Labkit::Metrics
behind an environment variable.
- Pipeline run with
LABKIT_METRICS_ENABLED: "true”
: https://gitlab.com/gitlab-org/gitlab/-/pipelines/1855538344 - Pipeline run without
LABKIT_METRICS_ENABLED
set: https://gitlab.com/gitlab-org/gitlab/-/pipelines/1857261519
The coverage pipeline is failing (as expected):
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10277200332
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10279133990
In one case, with LABKIT_METRICS_ENABLED=true
, it complains that Gitlab::Metrics::Prometheus
isn't hit, which is correct, since only Gitlab::Metrics::Labkit
will be used. And vice-versa.
The change request to toggle the environment variable in gstg is available here.
A follow-up MR will get rid of Gitlab::Metrics::Prometheus
, as part of Replace prometheus client in the Rails app (mon... (gitlab-com/gl-infra/observability/team#4160 - closed).
References
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- export LABKIT_METRICS_ENABLED=true
- gdk start
- Visit http://127.0.0.1/-/metrics
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.