-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from ccremer/fronius-prom
[fronius-exporter] Add prometheus service monitor
- Loading branch information
Showing
7 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
## Prometheus Operator | ||
|
||
This chart features templates for [Prometheus Operator][prometheus-operator] if desired. | ||
If you'd like to add additional Prometheus labels to all metrics, you could make use of relabelings: | ||
|
||
```yaml | ||
serviceMonitor: | ||
enabled: true | ||
metricRelabelings: | ||
- targetLabel: site | ||
replacement: my-home | ||
``` | ||
<!--- | ||
Common/Useful Link references from values.yaml | ||
--> | ||
[resource-units]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes | ||
[prometheus-operator]: https://github.com/coreos/prometheus-operator | ||
[prom-relabel-config]: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
charts/fronius-exporter/templates/prometheus/service-monitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{- if .Values.serviceMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ template "fronius-exporter.fullname" . }}-servicemonitor | ||
namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }} | ||
labels: | ||
{{- include "fronius-exporter.labels" . | nindent 4 }} | ||
{{- with .Values.serviceMonitor.additionalLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.serviceMonitor.annotations }} | ||
annotations: | ||
{{ toYaml .Values.serviceMonitor.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "fronius-exporter.selectorLabels" . | nindent 6 }} | ||
{{- if .Values.serviceMonitor.namespace }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
{{- end }} | ||
endpoints: | ||
- path: /metrics | ||
port: http | ||
interval: {{ .Values.serviceMonitor.scrapeInterval }} | ||
{{- with .Values.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
telegraf: | ||
enabled: true | ||
globalTags: | ||
key1: value1 | ||
key2: value2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters