Skip to content

Commit

Permalink
feat: use check label in metrics (#2257)
Browse files Browse the repository at this point in the history
* feat: use check label in metrics

* feat: accept additional check labels for metrics from the CLI

* chore: update chart
  • Loading branch information
adityathebe authored Oct 21, 2024
1 parent 59d477e commit 2cbb486
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 128 deletions.
4 changes: 4 additions & 0 deletions api/v1/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

// List of additional check label keys that should be included in the check metrics.
// By default the labels metrics are not exposed.
var AdditionalCheckMetricLabels []string

const (
OnTransformMarkHealthy = "MarkHealthy"
OnTransformMarkUnhealthy = "MarkUnhealthy"
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ spec:
{{- if (tpl .Values.otel.collector .) }}
- --otel-collector-url={{ tpl .Values.otel.collector . | default "" }}
{{- end }}
{{- if .Values.labelsAllowList}}
- --metric-labels-allowlist={{ join "," .Values.labelsAllowList }}
{{- end}}
{{- if (tpl .Values.otel.serviceName .) }}
- --otel-service-name={{ tpl .Values.otel.serviceName . | default "canary-checker" }}
{{- end }}
Expand Down
Loading

0 comments on commit 2cbb486

Please sign in to comment.