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

[Enhancement] Allow user to add labels on serviceMonitor #432

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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
namespace: {{ template "starrockscluster.namespace" . }}
labels:
cluster: {{ template "starrockscluster.name" . }}
{{- if .Values.metrics.serviceMonitor.labels }}
{{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http
Expand Down Expand Up @@ -35,6 +38,9 @@ metadata:
namespace: {{ template "starrockscluster.namespace" . }}
labels:
cluster: {{ template "starrockscluster.name" . }}
{{- if .Values.metrics.serviceMonitor.labels }}
{{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: webserver
Expand Down Expand Up @@ -66,6 +72,9 @@ metadata:
namespace: {{ template "starrockscluster.namespace" . }}
labels:
cluster: {{ template "starrockscluster.name" . }}
{{- if .Values.metrics.serviceMonitor.labels }}
{{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: webserver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ datadog:
# This configuration is used to integrate with external system Prometheus.
metrics:
serviceMonitor:
# Enable a prometheus ServiceMonitor
# Whether to expose metrics to Prometheus by ServiceMonitor.
# Note: make sure the prometheus operator is installed in your cluster.
# If prometheus is not installed by operator, you can add annotations on k8s service to expose metrics.
# see https://github.com/StarRocks/starrocks-kubernetes-operator/blob/main/doc/integration/integration-prometheus-grafana.md#51-turn-on-the-prometheus-metrics-scrape-by-adding-annotations for more details.
enabled: false
# Prometheus ServiceMonitor labels
labels: {}
# scraper: prometheus-operator
# Prometheus ServiceMonitor interval
interval: 15s

Expand Down
5 changes: 4 additions & 1 deletion helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ starrocks:
# This configuration is used to integrate with external system Prometheus.
metrics:
serviceMonitor:
# Enable a prometheus ServiceMonitor
# Whether to expose metrics to Prometheus by ServiceMonitor.
# Note: make sure the prometheus operator is installed in your cluster.
# If prometheus is not installed by operator, you can add annotations on k8s service to expose metrics.
# see https://github.com/StarRocks/starrocks-kubernetes-operator/blob/main/doc/integration/integration-prometheus-grafana.md#51-turn-on-the-prometheus-metrics-scrape-by-adding-annotations for more details.
enabled: false
# Prometheus ServiceMonitor labels
labels: {}
# scraper: prometheus-operator
# Prometheus ServiceMonitor interval
interval: 15s

Expand Down
Loading