Skip to content

Commit

Permalink
Merge pull request #37 from jozefhalgas/feature/prometheus-rulu
Browse files Browse the repository at this point in the history
PrometheusRule template
  • Loading branch information
richardartoul authored Mar 13, 2024
2 parents 0082cf8 + c1ba07a commit 5c16017
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
6 changes: 6 additions & 0 deletions charts/warpstream-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.10] - 2024-03-13

### Added

- Prometheus rule template added

## [0.10.9] - 2024-03-6

### Added
Expand Down
2 changes: 1 addition & 1 deletion charts/warpstream-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: warpstream-agent
description: WarpStream Agent for Kubernetes.
type: application
version: 0.10.9
version: 0.10.10
appVersion: v538
icon: https://avatars.githubusercontent.com/u/132156278
home: https://docs.warpstream.com/warpstream/
Expand Down
17 changes: 17 additions & 0 deletions charts/warpstream-agent/templates/prometheus-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.prometheusRule.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "warpstream-agent.fullname" . }}
labels:
{{- include "warpstream-agent.labels" . | nindent 4 }}
{{- with .Values.prometheusRule.labels }}
{{- tpl (toYaml . | nindent 4) $ }}
{{- end }}
spec:
groups:
{{- with .Values.prometheusRule.groups }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/warpstream-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ serviceMonitor:
targetLabels: []
honorLabels: true

prometheusRule:
## If true, a PrometheusRule CRD is created for a prometheus operator
## https://github.com/coreos/prometheus-operator
##
enabled: false
labels: {}
groups:
- name: groupName
rules:
- alert: alertName
expr: 'alert expression'
for: 5m
labels:
severity: high
annotations:
identifier: 'Alert identifier.'
msg: Alert message.

## list of hosts and IPs that will be injected into the pod's hosts file
hostAliases: []
# - ip: "127.0.0.1"
Expand Down

0 comments on commit 5c16017

Please sign in to comment.