Skip to content

Commit

Permalink
app: remove lockhash gauge (#1186)
Browse files Browse the repository at this point in the history
Remove `lockHashGauge` as we now have `cluster_hash` label for all metrics.

category: misc
ticket: none
  • Loading branch information
xenowits authored Sep 28, 2022
1 parent 7b9504d commit 3383d66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ func Run(ctx context.Context, conf Config) (err error) {
}

initStartupMetrics(
lockHashHex,
p2p.PeerName(tcpNode.ID()),
lock.Threshold,
len(lock.Operators),
Expand Down
9 changes: 1 addition & 8 deletions app/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ var (
Help: "Set to 1 if monitoring api `/readyz` endpoint returned 200 or else 0",
})

lockHashGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "cluster",
Name: "lock_hash",
Help: "Constant gauge with label set to current cluster lock hash",
}, []string{"lock_hash"})

thresholdGauge = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "cluster",
Name: "threshold",
Expand All @@ -86,14 +80,13 @@ var (
}, []string{"network"})
)

func initStartupMetrics(lockHash, peerName string, threshold, numOperators, numValidators int, forkVersion []byte) {
func initStartupMetrics(peerName string, threshold, numOperators, numValidators int, forkVersion []byte) {
startGauge.SetToCurrentTime()
setNetworkGauge(forkVersion)

hash, _ := version.GitCommit()
gitGauge.WithLabelValues(hash).Set(1)
versionGauge.WithLabelValues(version.Version).Set(1)
lockHashGauge.WithLabelValues(lockHash).Set(1)
peerNameGauge.WithLabelValues(peerName).Set(1)

thresholdGauge.Set(float64(threshold))
Expand Down
15 changes: 8 additions & 7 deletions testutil/compose/static/grafana/dash_simnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"iteration": 1664348030745,
"links": [],
"liveNow": false,
"panels": [
Expand Down Expand Up @@ -100,7 +101,7 @@
"frameIndex": 0,
"showHeader": false
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand All @@ -109,7 +110,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "(\n sum(app_git_commit{job=\"$node\"}) by (git_hash)\n)\n + on(job) group_left(version)\n(\n 0 * sum(app_version{job=\"$node\"}) by (version)\n)\n + on(job) group_left(lock_hash)\n(\n 0 * sum(cluster_lock_hash{job=\"$node\"}) by (lock_hash)\n)\n + on(job) group_left(peer_name)\n(\n 0 * sum(app_peer_name{job=\"$node\"}) by (peer_name)\n)\n + on(job) group_left(network)\n(\n 0 * sum(cluster_network{job=\"$node\"}) by (network)\n)",
"expr": "(\n sum(app_git_commit{job=\"$node\"}) by (git_hash)\n)\n + on(job) group_left(version)\n(\n 0 * sum(app_version{job=\"$node\"}) by (version)\n)\n + on(job) group_left(peer_name)\n(\n 0 * sum(app_peer_name{job=\"$node\"}) by (peer_name)\n)\n + on(job) group_left(network)\n(\n 0 * sum(cluster_network{job=\"$node\"}) by (network)\n)\n + on(job) group_left(cluster_hash)\n(\n 0 * sum(cluster_operators{job=\"$node\"}) by (cluster_hash)\n)",
"hide": false,
"instant": true,
"interval": "",
Expand Down Expand Up @@ -217,7 +218,7 @@
},
"textMode": "auto"
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -375,7 +376,7 @@
},
"textMode": "auto"
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -542,7 +543,7 @@
},
"textMode": "auto"
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -771,7 +772,7 @@
}
]
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -2053,7 +2054,7 @@
},
"showHeader": true
},
"pluginVersion": "9.0.4",
"pluginVersion": "9.0.0",
"targets": [
{
"datasource": {
Expand Down

0 comments on commit 3383d66

Please sign in to comment.