From b19d18c8bcb0b05f0db5d64b9fb3b7a9407bb511 Mon Sep 17 00:00:00 2001 From: Shaunak Deshmukh Date: Tue, 20 Sep 2022 12:40:34 +0530 Subject: [PATCH] Enable promlinter and enhance exposed metrics. (#2550) * Enable promlinter * Rename archives metric and update dashboard, linter Co-authored-by: shaunak_deshmukh --- .golangci.yaml | 1 + charts/fission-all/dashboards/.lint | 4 +--- charts/fission-all/dashboards/fission-admin-dashboard.json | 4 ++-- pkg/storagesvc/metrics.go | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 9801cf42..c567a733 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -14,6 +14,7 @@ linters: - misspell - nakedret - unconvert + - promlinter # Enable in future # - bodyclose # - dogsled diff --git a/charts/fission-all/dashboards/.lint b/charts/fission-all/dashboards/.lint index ebc2e84c..88e55378 100644 --- a/charts/fission-all/dashboards/.lint +++ b/charts/fission-all/dashboards/.lint @@ -8,6 +8,4 @@ exclusions: target-instance-rule: reason: "Most panels dont need to be filtered by instance" panel-units-rule: - reason: "Some panels are using the 'number' unit which throws a linting error." - target-counter-agg-rule: - reason: "disabled for fission_archives_total. This metric should be not have total due to naming conventions as its a gauge, not a counter" \ No newline at end of file + reason: "Some panels are using the 'number' unit which throws a linting error." \ No newline at end of file diff --git a/charts/fission-all/dashboards/fission-admin-dashboard.json b/charts/fission-all/dashboards/fission-admin-dashboard.json index 5e2b5cc8..b1122968 100644 --- a/charts/fission-all/dashboards/fission-admin-dashboard.json +++ b/charts/fission-all/dashboards/fission-admin-dashboard.json @@ -879,7 +879,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "fission_archives_total", + "expr": "fission_archives", "legendFormat": "Namespace: {{namespace}} Pod: {{pod}}", "range": true, "refId": "A" @@ -970,7 +970,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(fission_archives_total[$__rate_interval])", + "expr": "rate(fission_archives[$__rate_interval])", "legendFormat": "Namespace: {{namespace}} Pod: {{pod}}", "range": true, "refId": "A" diff --git a/pkg/storagesvc/metrics.go b/pkg/storagesvc/metrics.go index 35a94ba0..ed60e71d 100644 --- a/pkg/storagesvc/metrics.go +++ b/pkg/storagesvc/metrics.go @@ -9,7 +9,7 @@ var ( functionLabels = []string{} totalArchives = promauto.NewGaugeVec( prometheus.GaugeOpts{ - Name: "fission_archives_total", + Name: "fission_archives", Help: "Number of archives stored", }, functionLabels,