-
Notifications
You must be signed in to change notification settings - Fork 45
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
Customize label selector for prometheus-operator
-managed ServiceMonitors
#2199
Labels
kind:debt
Technical debt
topic:deployment
Bugs in or enhancements to deployment stages
topic:docs
Documentation
topic:monitoring
Everything related to monitoring of services in a running cluster
topic:solutions
Anything related to external "Solutions" integration with the platform
Comments
gdemonet
added
topic:docs
Documentation
topic:deployment
Bugs in or enhancements to deployment stages
moonshot
topic:solutions
Anything related to external "Solutions" integration with the platform
topic:monitoring
Everything related to monitoring of services in a running cluster
labels
Jan 21, 2020
This was referenced May 13, 2020
Merged
alexandre-allard
added a commit
that referenced
this issue
May 4, 2021
The selector is for Probe, ServiceMonitor and PrometheusRule objects and it must match the label `metalk8s.scality.com/monitor: ''` We also add this labels to all resources deployed by the kube-prometheus-stack chart as there is actually no way to only add it to specific resources (except for PrometheusRule). Refs: #2199
alexandre-allard
added a commit
that referenced
this issue
May 4, 2021
We now use custom label selector `metalk8s.scality.com/monitor` instead of the default one `release` and `app` to target ServiceMonitors, PrometheusRules and Probes. kube-prometheus chart render command: ``` ./charts/render.py prometheus-operator \ charts/kube-prometheus-stack.yaml \ charts/kube-prometheus-stack/ \ --namespace metalk8s-monitoring \ --service-config grafana \ metalk8s-grafana-config \ metalk8s/addons/prometheus-operator/config/grafana.yaml \ metalk8s-monitoring \ --service-config prometheus \ metalk8s-prometheus-config \ metalk8s/addons/prometheus-operator/config/prometheus.yaml \ metalk8s-monitoring \ --service-config alertmanager \ metalk8s-alertmanager-config \ metalk8s/addons/prometheus-operator/config/alertmanager.yaml \ metalk8s-monitoring \ --service-config dex \ metalk8s-dex-config \ metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \ --drop-prometheus-rules charts/drop-prometheus-rules.yaml \ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls ``` Refs: #2199
alexandre-allard
added a commit
that referenced
this issue
May 4, 2021
alexandre-allard
added a commit
that referenced
this issue
May 5, 2021
alexandre-allard
added a commit
that referenced
this issue
May 5, 2021
alexandre-allard
added a commit
that referenced
this issue
May 7, 2021
The selector is for Probe, ServiceMonitor and PrometheusRule objects and it must match the label `metalk8s.scality.com/monitor: ''` We also add this labels to all resources deployed by the kube-prometheus-stack chart as there is actually no way to only add it to specific resources (except for PrometheusRule). Refs: #2199
alexandre-allard
added a commit
that referenced
this issue
May 7, 2021
We now use custom label selector `metalk8s.scality.com/monitor` instead of the default one `release` and `app` to target ServiceMonitors, PrometheusRules and Probes. kube-prometheus chart render command: ``` ./charts/render.py prometheus-operator \ charts/kube-prometheus-stack.yaml \ charts/kube-prometheus-stack/ \ --namespace metalk8s-monitoring \ --service-config grafana \ metalk8s-grafana-config \ metalk8s/addons/prometheus-operator/config/grafana.yaml \ metalk8s-monitoring \ --service-config prometheus \ metalk8s-prometheus-config \ metalk8s/addons/prometheus-operator/config/prometheus.yaml \ metalk8s-monitoring \ --service-config alertmanager \ metalk8s-alertmanager-config \ metalk8s/addons/prometheus-operator/config/alertmanager.yaml \ metalk8s-monitoring \ --service-config dex \ metalk8s-dex-config \ metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \ --drop-prometheus-rules charts/drop-prometheus-rules.yaml \ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls ``` Refs: #2199
alexandre-allard
added a commit
that referenced
this issue
May 7, 2021
alexandre-allard
added a commit
that referenced
this issue
May 7, 2021
alexandre-allard
added a commit
that referenced
this issue
May 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind:debt
Technical debt
topic:deployment
Bugs in or enhancements to deployment stages
topic:docs
Documentation
topic:monitoring
Everything related to monitoring of services in a running cluster
topic:solutions
Anything related to external "Solutions" integration with the platform
Component: monitoring, salt
Why this is needed:
When Solutions (and most likely, their Operators) set up metrics scraping by the Prometheus provided by MetalK8s, they can either:
ServiceMonitor
objectsOur current deployment of
prometheus-operator
only looks atServiceMonitor
s that match therelease=prometheus-operator
label. This can be too generic if other Prometheus Operators are deployed in the cluster, and doesn't make much sense outside of the Helm chart context.What should be done:
Instead, we should define and use a custom label for these, e.g.
metalk8s.scality.com/monitor=""
.We should also document this label clearly in Solution developer docs (see #1994).
Implementation proposal (strongly recommended):
Test plan:
Epic: #1994
The text was updated successfully, but these errors were encountered: