Turn off and remove method instrumentation
In #122311 (closed), we're removing InfluxDB
I thought this would also remove the method instrumentation code in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/initializers/zz_metrics.rb, as we only had these metrics in InfluxDB.
However, @splattael correctly pointed out that we support those in Prometheus too: https://gitlab.com/gitlab-org/gitlab/-/blob/v12.10.0-ee/lib/gitlab/metrics/method_call.rb#L11
The reason these aren't on GitLab.com's metrics is because they're behind a feature flag, which is documented: https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html#metrics-controlled-by-a-feature-flag
This means that the code in the initializer still runs and potentially adds some overhead to these methods. I'd like us to:
- Plan to remove this in 14.0.
- For now, disable the instrumentation unless it's needed. I think we can do a feature flag check in an initializer (
config/initializers/sidekiq.rb
does one), but if not, maybe another way to remove this. - Measure the impact of disabling the instrumentation.