Skip to content

Add metric availability to instrumentation classes

Michał Wielich requested to merge michold-add-instrumentation-availability into master

What does this MR do and why?

This MR adds the possibility to define an instrumentation metric's availability. We want to do it to make future migration of metrics included in UsageData possible.

Related to #352875 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Add a new instrumentation metric, based on on our guide.
  2. Use available? { true } notation inside the metric's class.
  3. Run Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values) in the rails console. When the metric class' available? block returns true, the generated payload should include the newly added metric. When the available? block returns false, the payload should not include the metric.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michał Wielich

Merge request reports