Commit 36046c63 authored by Stan Hu's avatar Stan Hu

Add GitLab revision to Prometheus metric

This allows us to see the exact Git revision used:

```
$ curl -s http://localhost:8080/-/metrics | grep revision
deployments{version="14.1.0-pre",revision="fbba57a1"} 1
```

Changelog: added
parent 459799dd
......@@ -49,7 +49,7 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
Gitlab::Metrics::Samplers::PumaSampler.instance.start
end
Gitlab::Metrics.gauge(:deployments, 'GitLab Version', {}, :max).set({ version: Gitlab::VERSION }, 1)
Gitlab::Metrics.gauge(:deployments, 'GitLab Version', {}, :max).set({ version: Gitlab::VERSION, revision: Gitlab.revision }, 1)
unless Gitlab::Runtime.sidekiq?
Gitlab::Metrics::RequestsRackMiddleware.initialize_metrics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment