forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prometheus-operator alerts support for manager (open-telemetry#266)
- Loading branch information
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
charts/opentelemetry-operator/templates/prometheusrule.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{- if and .Values.manager.prometheusRule.enabled .Values.manager.serviceMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ include "opentelemetry-operator.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "opentelemetry-operator.labels" . | nindent 4 }} | ||
{{- range $key, $value := .Values.manager.prometheusRule.extraLabels }} | ||
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
{{- if .Values.manager.prometheusRule.groups }} | ||
{{- toYaml .Values.manager.prometheusRule.groups | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.manager.prometheusRule.defaultRules.enabled }} | ||
- name: managerRules | ||
rules: | ||
- alert: ReconcileErrors | ||
expr: rate(controller_runtime_reconcile_total{result="error"}[5m]) > 0 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
annotations: | ||
description: '{{`Reconciliation errors for {{ $labels.controller }} is increasing and has now reached {{ humanize $value }} `}}' | ||
runbook_url: 'Check manager logs for reasons why this might happen' | ||
- alert: WorkqueueDepth | ||
expr: workqueue_depth > 0 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
annotations: | ||
description: '{{`Queue depth for {{ $labels.name }} has reached {{ $value }} `}}' | ||
runbook_url: 'Check manager logs for reasons why this might happen' | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters