Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ServiceMonitor for data-prepper #619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: {}
Loading