Skip to content

Commit

Permalink
[stable/prometheus-statsd-exporter] add ServiceMonitor support for pr…
Browse files Browse the repository at this point in the history
…ometheus-statsd-exporter (#578)

* add svm support for prometheus-statsd-exporter

* docs: add metrics vars docs for prometheus-statsd-exporter

* bump chart version

* fix docs linter

* bump version
  • Loading branch information
abarrak authored Apr 22, 2024
1 parent d07618a commit 913e63a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
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

0 comments on commit 913e63a

Please sign in to comment.