-
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 Prometheus label selector #3356
Customize Prometheus label selector #3356
Conversation
Hello alexandre-allard-scality,My role is to assist you with the merge of this Status report is not available. |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
Putting @scality/storage and @scality/object as reviewers so they are aware of this breaking change. |
For @scality/storage and @scality/object: you can add this new label next to the ones already in place, to be compatible with 'current' MetalK8s as well as 'future' MetalK8s. Then, the current labels can be removed over time, once 'current' MetalK8s is no longer supported (by your application). |
Worth a changelog entry no ? |
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
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
f56e8b6
to
530683c
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
/approve |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
The following options are set: approve |
@@ -1,18 +1,26 @@ | |||
# CHANGELOG | |||
|
|||
## Release 2.10.0 (in development) | |||
## Enhancements | |||
### Enhancements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh 👍
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue None. Goodbye alexandre-allard-scality. |
Oversight from #3356, with this PodMonitor objects are selected using the same label.
Oversight from #3356, with this PodMonitor objects are selected using the same label. Re-render prometheus-operator salt state using: ``` ./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 \ --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls ```
Oversight from #3356, with this PodMonitor objects are selected using the same label. Re-render prometheus-operator salt state using: ``` ./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 \ --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls ```
Component: charts, salt
Context:
Actually we use default label selector from kube-prometheus-stack charts
release: prometheus-operator
andapp: prometheus-operator
for Prometheus to be able to retrieveServiceMonitor
andPrometheusRules
objects.Those labels do not make real sense and should be replaced by something more meaningful.
Summary:
Replace the default selector by a new one
metalk8s.scality.com/monitor: ''
.Acceptance criteria:
Monitoring still works as expected.
Closes: #2199