Skip to content

Commit

Permalink
feat: Add ServiceMonitor for data-prepper
Browse files Browse the repository at this point in the history
Signed-off-by: Davi Arnaut <[email protected]>
  • Loading branch information
darnaut committed Nov 9, 2024
1 parent e43cf7d commit 809b79e
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 2 deletions.
24 changes: 23 additions & 1 deletion charts/data-prepper/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,29 @@ 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).

---
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [0.1.1]
### Added
- ServiceMonitor resource for Prometheus monitoring
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [0.1.0]
### Added
- Create initial version of data-prepper helm chart

### Changed
### Deprecated
### Removed
### Fixed
### Security
2 changes: 1 addition & 1 deletion charts/data-prepper/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 3 additions & 0 deletions charts/data-prepper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ We welcome contributions! Please read our [CONTRIBUTING.md](../../CONTRIBUTING.m
| tolerations | list | `[]` | |
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |
| serviceMonitor.enabled | Enables the creation of a [ServiceMonitor] resource for Prometheus monitoring. Requires the Prometheus Operator to be installed in your Kubernetes cluster. | `false` |
| serviceMonitor.path | Path where metrics are exposed | `/metrics/sys` |
| serviceMonitor.interval | Interval at which metrics should be scraped by Prometheus | `30s` |

## License

Expand Down
19 changes: 19 additions & 0 deletions charts/data-prepper/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "data-prepper.fullname" . }}-service-monitor
labels:
{{- include "data-prepper.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "data-prepper.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.serviceMonitor.metricsPortName | default "server" }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/data-prepper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,18 @@ nodeSelector: {}
tolerations: []

affinity: {}

# ServiceMonitor Configuration
# Allows Prometheus to scrape metrics from the Data Prepper server.
serviceMonitor:
# Set to true to enable the ServiceMonitor resource
enabled: false

# HTTP path where metrics are exposed.
path: /metrics/sys

# Frequency at which Prometheus will scrape metrics.
interval: 30s

# additional labels to be added to the ServiceMonitor
labels: {}

0 comments on commit 809b79e

Please sign in to comment.