Skip to content

Commit

Permalink
fix keda_scaler_error_total duplicate metric
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Wozniak <[email protected]>
  • Loading branch information
wozniakjan committed Apr 15, 2024
1 parent 6e5f45c commit 31dd060
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions config/grafana/keda-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by(job) (rate(keda_scaler_errors_total{}[5m]))",
"expr": "sum by(job) (rate(keda_scaler_detail_errors_total{}[5m]))",
"legendFormat": "{{ job }}",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -313,7 +313,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by(scaler) (rate(keda_scaler_errors_total{exported_namespace=~\"$namespace\", scaledObject=~\"$scaledObject\", scaler=~\"$scaler\"}[5m]))",
"expr": "sum by(scaler) (rate(keda_scaler_detail_errors_total{exported_namespace=~\"$namespace\", scaledObject=~\"$scaledObject\", scaler=~\"$scaler\"}[5m]))",
"legendFormat": "{{ scaler }}",
"range": true,
"refId": "A"
Expand Down
32 changes: 16 additions & 16 deletions pkg/metricscollector/prommetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ var (
},
[]string{"version", "git_commit", "goversion", "goos", "goarch"},
)
scalerErrorsTotalDeprecated = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaler",
Name: "errors_total",
Help: "DEPRECATED - will be removed in 2.16 - use a `sum(scaler_errors_total{scaler!=\"\"})` over all scalers",
},
[]string{},
)
scalerMetricsValue = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: DefaultPromMetricsNamespace,
Expand All @@ -64,7 +55,7 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaler",
Name: "metrics_latency",
Help: "DEPRECATED - will be removed in 2.16 use 'scaler_metrics_latency_seconds' instead.",
Help: "DEPRECATED - will be removed in 2.16 use 'keda_scaler_metrics_latency_seconds' instead.",
},
metricLabels,
)
Expand Down Expand Up @@ -100,15 +91,24 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaler",
Name: "errors",
Help: "DEPRECATED - will be removed in 2.16 - use 'scaler_errors_total' instead.",
Help: "DEPRECATED - will be removed in 2.16 - use 'keda_scaler_detail_errors_total' instead.",
},
metricLabels,
)
scalerErrors = prometheus.NewCounterVec(
scalerErrorsTotalDeprecated = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaler",
Name: "errors_total",
Help: "DEPRECATED - will be removed in 2.16 - use a `sum(keda_scaler_detail_errors_total{scaler!=\"\"})` over all scalers",
},
[]string{},
)
scalerErrors = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaler",
Name: "detail_errors_total",
Help: "The total number of errors encountered for each scaler.",
},
metricLabels,
Expand All @@ -118,7 +118,7 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "scaled_object",
Name: "errors",
Help: "DEPRECATED - will be removed in 2.16 - use 'scaled_object_errors_total' instead.",
Help: "DEPRECATED - will be removed in 2.16 - use 'keda_scaled_object_errors_total' instead.",
},
[]string{"namespace", "scaledObject"},
)
Expand Down Expand Up @@ -147,7 +147,7 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "trigger",
Name: "totals",
Help: "DEPRECATED - will be removed in 2.16 - use 'trigger_registered_total' instead.",
Help: "DEPRECATED - will be removed in 2.16 - use 'keda_trigger_registered_total' instead.",
},
[]string{"type"},
)
Expand All @@ -165,7 +165,7 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "resource",
Name: "totals",
Help: "DEPRECATED - will be removed in 2.16 - use 'resource_handled_total' instead.",
Help: "DEPRECATED - will be removed in 2.16 - use 'keda_resource_handled_total' instead.",
},
[]string{"type", "namespace"},
)
Expand All @@ -183,7 +183,7 @@ var (
Namespace: DefaultPromMetricsNamespace,
Subsystem: "internal_scale_loop",
Name: "latency",
Help: "DEPRECATED - will be removed in 2.16 - use 'internal_scale_loop_latency_seconds' instead.",
Help: "DEPRECATED - will be removed in 2.16 - use 'keda_internal_scale_loop_latency_seconds' instead.",
},
[]string{"namespace", "type", "resource"},
)
Expand Down

0 comments on commit 31dd060

Please sign in to comment.