Skip to content

Commit

Permalink
[operator] Allow PrometheusRule duration set
Browse files Browse the repository at this point in the history
  • Loading branch information
araiu committed Nov 14, 2024
1 parent f770492 commit 6f18515
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ metadata:
name: "example-opentelemetry-operator-metrics"
namespace: default
labels:
<<<<<<< HEAD
helm.sh/chart: opentelemetry-operator-0.74.2
=======
helm.sh/chart: opentelemetry-operator-0.74.1
>>>>>>> adf0eeca ([operator] Allow PrometheusRule duration set)
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -43,7 +47,11 @@ metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
<<<<<<< HEAD
helm.sh/chart: opentelemetry-operator-0.74.2
=======
helm.sh/chart: opentelemetry-operator-0.74.1
>>>>>>> adf0eeca ([operator] Allow PrometheusRule duration set)
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
Expand Down
4 changes: 2 additions & 2 deletions charts/opentelemetry-operator/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
rules:
- alert: ReconcileErrors
expr: rate(controller_runtime_reconcile_total{controller="opentelemetrycollector",result="error"}[5m]) > 0
for: 5m
for: {{ .Values.manager.prometheusRule.defaultRules.duration }}
labels:
severity: warning
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleLabels }}
Expand All @@ -38,7 +38,7 @@ spec:
{{- end }}
- alert: WorkqueueDepth
expr: workqueue_depth{name="opentelemetrycollector"} > 0
for: 5m
for: {{ .Values.manager.prometheusRule.defaultRules.duration }}
labels:
severity: warning
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleLabels }}
Expand Down
8 changes: 8 additions & 0 deletions charts/opentelemetry-operator/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,14 @@
"required": [],
"properties": {},
"examples": [{}]
},
"duration": {
"type": "string",
"default": {},
"title": "The prometheusRule duration to be considered firing",
"required": [],
"properties": {},
"examples": [{}]
}
},
"examples": [{
Expand Down
2 changes: 2 additions & 0 deletions charts/opentelemetry-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ manager:
additionalRuleLabels: {}
## Additional annotations for PrometheusRule alerts
additionalRuleAnnotations: {}
## Alerts are considered firing once they have been returned for this long.
duration: 5m
# additional labels on the PrometheusRule object
extraLabels: {}
# add annotations on the PrometheusRule object
Expand Down

0 comments on commit 6f18515

Please sign in to comment.