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

[stable/prometheus-statsd-exporter] add ServiceMonitor support for prometheus-statsd-exporter #578

Merged
merged 5 commits into from
Apr 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion stable/prometheus-statsd-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v0.18.0
description: StatsD to Prometheus metrics exporter
name: prometheus-statsd-exporter
version: 0.1.3
version: 0.1.4
home: https://github.com/prometheus/statsd_exporter
sources:
- https://github.com/prometheus/statsd_exporter
Expand Down
6 changes: 5 additions & 1 deletion stable/prometheus-statsd-exporter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prometheus-statsd-exporter

![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![AppVersion: v0.18.0](https://img.shields.io/badge/AppVersion-v0.18.0-informational?style=flat-square)
![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![AppVersion: v0.18.0](https://img.shields.io/badge/AppVersion-v0.18.0-informational?style=flat-square)

StatsD to Prometheus metrics exporter

Expand Down Expand Up @@ -53,6 +53,10 @@ helm install my-release deliveryhero/prometheus-statsd-exporter -f values.yaml
| image.repository | string | `"prom/statsd-exporter"` | |
| image.tag | string | `"v0.18.0"` | |
| imagePullSecrets | list | `[]` | |
| metrics.additionalLabels | object | `{}` | |
| metrics.enabled | bool | `false` | |
| metrics.scrapeInterval | string | `"30s"` | |
| metrics.scrapeTimeout | string | `"10s"` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podSecurityContext | object | `{}` | |
Expand Down
28 changes: 28 additions & 0 deletions stable/prometheus-statsd-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if and .Values.metrics.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "prometheus-statsd-exporter.fullname" . }}
labels:
name: {{ include "prometheus-statsd-exporter.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.metrics.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "prometheus-statsd-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
endpoints:
- port: frontend
{{- if .Values.metrics.scrapeInterval }}
interval: {{ .Values.metrics.scrapeInterval }}
{{- end }}
{{- if .Values.metrics.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.scrapeTimeout }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions stable/prometheus-statsd-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ securityContext: {}
service:
type: ClusterIP

metrics:
enabled: false
additionalLabels: {}
scrapeInterval: 30s
scrapeTimeout: 10s

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down
Loading