Skip to content

Commit

Permalink
chore: templatize prometheus alert rule severity and labels (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisingal authored Jul 10, 2024
1 parent e6336f4 commit ee42696
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# org.apache.helix:helix-core (from upstream opensource shaded dependency. will be taken care during upgrade.)
CVE-2023-38647 exp:2024-06-30
CVE-2023-38647 exp:2024-08-31

# org.apache.avro:avro (from upstream opensource shaded dependency. will be taken care during upgrade.)
CVE-2023-39410 exp:2024-06-30
CVE-2023-39410 exp:2024-08-31

# org.apache.commons:commons-compress
CVE-2024-25710 exp:2024-06-30
CVE-2024-26308 exp:2024-06-30
CVE-2024-25710 exp:2024-08-31
CVE-2024-26308 exp:2024-08-31

# io.airlift:aircompressor
CVE-2024-36114 exp:2024-08-31
11 changes: 9 additions & 2 deletions helm/templates/controller/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
monitoring: shared
{{- if .Values.controller.prometheusrule.annotations }}
annotations:
{{- toYaml .Values.controller.prometheusrule.annotations | nindent 4 }}
{{- end }}
spec:
groups:
- name: pinot
Expand All @@ -21,7 +25,10 @@ spec:
message: '{{`{{ $value }}`}} segments in table {{`{{ $labels.table }}`}} are in Error state'
expr: sum by(pod, table, tabletype) (pinot_controller_segmentsinerrorstate_value) > 0
for: 10s
for: {{ dig "PinotErrorSegments" "for" "1m" .Values.controller.prometheusrule }}
labels:
severity: critical
productgroup: platform-infrastructure
severity: {{ dig "PinotErrorSegments" "severity" "critical" .Values.controller.prometheusrule }}
{{- with .Values.controller.prometheusrule.additionalRuleLabels }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,14 @@ controller:

servicemonitor:
enabled: false
interval: 15s
interval: 30s
secure: false
tlsConfig: {}

prometheusrule:
annotations: {}
additionalRuleLabels: {}

podDisruptionBudget:
enabled: false
maxUnavailable: 1
Expand Down

0 comments on commit ee42696

Please sign in to comment.