diff --git a/charts/opentelemetry-operator/examples/default/rendered/tests/test-service-connection.yaml b/charts/opentelemetry-operator/examples/default/rendered/tests/test-service-connection.yaml index 1827cbbca..17e6d1a82 100644 --- a/charts/opentelemetry-operator/examples/default/rendered/tests/test-service-connection.yaml +++ b/charts/opentelemetry-operator/examples/default/rendered/tests/test-service-connection.yaml @@ -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 @@ -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 diff --git a/charts/opentelemetry-operator/templates/prometheusrule.yaml b/charts/opentelemetry-operator/templates/prometheusrule.yaml index 3f7b4d2fd..32b1c871c 100644 --- a/charts/opentelemetry-operator/templates/prometheusrule.yaml +++ b/charts/opentelemetry-operator/templates/prometheusrule.yaml @@ -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 }} @@ -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 }} diff --git a/charts/opentelemetry-operator/values.schema.json b/charts/opentelemetry-operator/values.schema.json index a141329d0..f7cbce1eb 100644 --- a/charts/opentelemetry-operator/values.schema.json +++ b/charts/opentelemetry-operator/values.schema.json @@ -953,6 +953,14 @@ "required": [], "properties": {}, "examples": [{}] + }, + "duration": { + "type": "string", + "default": {}, + "title": "The prometheusRule duration to be considered firing", + "required": [], + "properties": {}, + "examples": [{}] } }, "examples": [{ diff --git a/charts/opentelemetry-operator/values.yaml b/charts/opentelemetry-operator/values.yaml index 3f48f025b..da89226f1 100644 --- a/charts/opentelemetry-operator/values.yaml +++ b/charts/opentelemetry-operator/values.yaml @@ -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