Skip to content

Commit

Permalink
Added support for custom service scrape-enable annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Holmes authored and sstarcher committed Jul 12, 2021
1 parent 5a533ab commit 409058f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The following table lists the configurable parameters of the helm-exporter chart
| securityContext | object | `{}` | SecurityContext for a container |
| service.port | int | `9571` | Port for Service to listen on. |
| service.type | string | `"ClusterIP"` | Service type |
| service.customScrapeEnableAnnotation | string | `""` | Custom annotation to enable scraping. If empty, `prometheus.io/scrape: "true"` will be used |
| serviceAccount.create | bool | `true` | Create a default serviceaccount to use |
| serviceAccount.name | string | `default` | Name for prometheus serviceaccount |
| serviceMonitor.create | bool | `false` | Set to true if using the Prometheus Operator |
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
{{- include "helm-exporter.labels" . | nindent 4 }}
annotations:
{{- if not .Values.serviceMonitor.create }}
prometheus.io/scrape: "true"
{{ .Values.service.customScrapeEnableAnnotation | default "prometheus.io/scrape: \"true\"" }}
{{- end }}
{{- if .Values.service.annotations }}
{{ .Values.service.annotations | toYaml | indent 4}}
Expand Down

0 comments on commit 409058f

Please sign in to comment.