Export prometheus metric for read-only mode
Exports a Prometheus metrics showing whether a virtual storage is in read-only mode or not.
Relates to #2789 (closed)
Merge request reports
Activity
changed milestone to %13.1
added Category:Gitaly Observability backstage [DEPRECATED] devopscreate groupgitaly + 1 deleted label
- Resolved by Patrick Steinhardt
assigned to @samihiltunen and unassigned @pks-t
- Resolved by Sami Hiltunen
@samihiltunen One nit, otherwise this looks fine to me. You should probably assign a second reviewer, though.
unassigned @pks-t
151 151 s.primaryNode = newPrimary 152 152 s.isReadOnly = s.readOnlyAfterFailover 153 153 154 metrics.ReadOnlyGauge.WithLabelValues(s.shardName).Set(metrics.Bool(s.isReadOnly)) @johncai I'll leave this as it is. This is where the value originates from so it is the most up to date value. I considered moving this to
updateMetrics
but it requires more changes without a clear gain. The metrics being separate gauges, it is still possible for the primary gauge to be inconsistent with read-only mode gauge even if moved in toupdateMetrics
. This could be fixed by the approach in #2809 (closed) but I'll leave it for later until the proposal is accepted.changed this line in version 2 of the diff
- Resolved by Sami Hiltunen
@samihiltunen some nits only, not blocking so I'll pre-approve
unassigned @johncai
enabled an automatic merge when the pipeline for 0d5e6b09 succeeds
mentioned in commit 5c49063c