Skip to content

Adds Labkit::Metrics behind an environment variable

What does this MR do and why?

Part of Replace prometheus client in the Rails app (mon... (gitlab-com/gl-infra/observability/team#4160 - closed).

Depends on Adding the Metrics module (gitlab-org/ruby/gems/labkit-ruby!135 - merged).

Adds Labkit::Metrics behind an environment variable.

The coverage pipeline is failing (as expected):

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

  1. export LABKIT_METRICS_ENABLED=true
  2. gdk start
  3. 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.

Edited by Hercules Merscher

Merge request reports

Loading