Skip to content

Commit

Permalink
Merge pull request #141 from mrohlof-protofy/master
Browse files Browse the repository at this point in the history
Make Prometheus ServiceMonitor optional
  • Loading branch information
nepalez authored Jul 26, 2023
2 parents a5c7114 + 1277266 commit 4c7722b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ Options to configure ServiceMonitor for Prometheus Operator.
|-----|-----------|-------|
|**features.prometheus.enabled**|Set IMGPROXY_PROMETHEUS_BIND environment variable to bind metrics to port 8081|`false`|
|**features.prometheus.namespace**|Set IMGPROXY_PROMETHEUS_NAMESPACE environment variable to prepend prefix to the names of metrics|`""`|
|**resources.serviceMonitor.enabled**|Use a ServiceMonitor to collect metrics|`true`|
|**resources.serviceMonitor.honorLabels**|Chooses the metric's labels on collisions with target labels|`true`|
|**resources.serviceMonitor.interval**|Interval at which metrics should be scraped (if it differs from default one)|`0`|
|**resources.serviceMonitor.namespace**|Namespace with PrometheusOperator|`monitoring`|
Expand Down
1 change: 1 addition & 0 deletions imgproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ Options to configure ServiceMonitor for Prometheus Operator.
|-----|-----------|-------|
|**features.prometheus.enabled**|Set IMGPROXY_PROMETHEUS_BIND environment variable to bind metrics to port 8081|`false`|
|**features.prometheus.namespace**|Set IMGPROXY_PROMETHEUS_NAMESPACE environment variable to prepend prefix to the names of metrics|`""`|
|**resources.serviceMonitor.enabled**|Use a ServiceMonitor to collect metrics|`true`|
|**resources.serviceMonitor.honorLabels**|Chooses the metric's labels on collisions with target labels|`true`|
|**resources.serviceMonitor.interval**|Interval at which metrics should be scraped (if it differs from default one)|`0`|
|**resources.serviceMonitor.namespace**|Namespace with PrometheusOperator|`monitoring`|
Expand Down
4 changes: 2 additions & 2 deletions imgproxy/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.features.prometheus.enabled }}
{{- if and (.Values.features.prometheus.enabled) (.Values.resources.serviceMonitor.enabled) }}
{{- with .Values.resources.serviceMonitor }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down Expand Up @@ -36,4 +36,4 @@ spec:
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions imgproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ resources:
pathType: ImplementationSpecific

serviceMonitor:
enabled: true
honorLabels: true
interval: 0
namespace: ""
Expand Down

0 comments on commit 4c7722b

Please sign in to comment.