|
55 | 55 | UserSignupsPerActivationAndDomainGaugeVec *prometheus.GaugeVec |
56 | 56 | // MasterUserRecordGaugeVec reflects the current number of MasterUserRecords, labelled with their email address domain (`internal` vs `external`) |
57 | 57 | MasterUserRecordGaugeVec *prometheus.GaugeVec |
58 | | - // HostOperatorVersionGaugeVec reflects the current version of the host-operator (via the `version` label) |
59 | | - HostOperatorVersionGaugeVec *prometheus.GaugeVec |
| 58 | + // HostOperatorVersionGaugeVec reflects the current short commit used to identify the version of the host-operator (via the `commit` label) |
| 59 | + HostOperatorVersionGaugeVec *prometheus.GaugeVec // DEPRECATED: use HostOperatorShortCommitGaugeVec instead |
| 60 | + // HostOperatorShortCommitGaugeVec reflects the current short git commit of the host-operator (via the `commit` label) |
| 61 | + HostOperatorShortCommitGaugeVec *prometheus.GaugeVec |
| 62 | + // HostOperatorCommitGaugeVec reflects the current full git commit of the host-operator (via the `commit` label) |
| 63 | + HostOperatorCommitGaugeVec *prometheus.GaugeVec |
60 | 64 | // ToolchainStatusGaugeVec reflects the current status of the toolchainstatus, labelled with the status |
61 | 65 | ToolchainStatusGaugeVec *prometheus.GaugeVec |
62 | 66 | ) |
@@ -100,7 +104,9 @@ func initMetrics() { |
100 | 104 | SpaceGaugeVec = newGaugeVec("spaces_current", "Current number of Spaces (per member cluster)", "cluster_name") |
101 | 105 | UserSignupsPerActivationAndDomainGaugeVec = newGaugeVec("users_per_activations_and_domain", "Number of UserSignups per activations and domain", []string{"activations", "domain"}...) |
102 | 106 | MasterUserRecordGaugeVec = newGaugeVec("master_user_records", "Number of MasterUserRecords per email address domain ('internal' vs 'external')", "domain") |
103 | | - HostOperatorVersionGaugeVec = newGaugeVec("host_operator_version", "Current version of the host operator", "commit") |
| 107 | + HostOperatorVersionGaugeVec = newGaugeVec("host_operator_version", "Short commit used to identify the version of the host operator", "commit") |
| 108 | + HostOperatorCommitGaugeVec = newGaugeVec("host_operator_commit", "Full commit used to identify the version of the host operator", "commit") |
| 109 | + HostOperatorShortCommitGaugeVec = newGaugeVec("host_operator_short_commit", "Short commit used to identify the version of the host operator", "commit") |
104 | 110 | ToolchainStatusGaugeVec = newGaugeVec("toolchain_status", "Current status of the toolchain components", "component") |
105 | 111 | // Histograms |
106 | 112 | UserSignupProvisionTimeHistogram = newHistogram("user_signup_provision_time", "UserSignup provision time in seconds") |
@@ -199,8 +205,9 @@ func RegisterCustomMetrics() []prometheus.Collector { |
199 | 205 | collectors = append(collectors, v) |
200 | 206 | } |
201 | 207 |
|
202 | | - // expose the HostOperatorVersionGaugeVec metric (static ie, 1 value per build/deployment) |
203 | | - HostOperatorVersionGaugeVec.WithLabelValues(version.Commit[0:7]).Set(1) |
| 208 | + HostOperatorVersionGaugeVec.WithLabelValues(version.Commit[0:7]).Set(1) // the HostOperatorVersionGaugeVec is set to `1`, Grafana will display the 'commit' label as the version for the instant record |
| 209 | + HostOperatorCommitGaugeVec.WithLabelValues(version.Commit).SetToCurrentTime() // automatically set the value to the current time, so that the highest value is the current commit |
| 210 | + HostOperatorShortCommitGaugeVec.WithLabelValues(version.Commit[0:7]).SetToCurrentTime() // automatically set the value to the current time, so that the highest value is the current commit |
204 | 211 |
|
205 | 212 | logger.Info("custom metrics registered") |
206 | 213 | return collectors |
|
0 commit comments