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

Feat: export correct namespace #307

Conversation

BGrasnick
Copy link
Contributor

This PR makes the ServiceMonitor relabel namespace to have the same value as container_namespace instead of "openshift-kepler-operator" applied after scraping so that it is more straight-forward to use the metrics.

Also adds label "openshift.io/cluster-monitoring": "true" so that the metrics get scraped by openshift-monitoring instead of user workload monitoring which makes usage more straight-forward.
I am not sure if this is wanted for kepler-operator but in our use case it would be much better. In case this is not the intended behaviour, we can just revert the corresponding commit.

Was tested and works on OpenShift 4.11 cluster.

Addresses #302

…(which is the same as container_namespace) applied after scraping

Signed-off-by: Bastien Grasnick <[email protected]>
@sthaha sthaha added discussion needed Pre enhancement discussion do-not-merge labels Nov 20, 2023
@BGrasnick BGrasnick force-pushed the feat/302-export-correct-namespace-and-make-metrics-available-to-cluster-monitoring branch from b430c78 to 49559f5 Compare November 20, 2023 14:23
…kload monitoring"

This reverts commit 1e395b7.

Signed-off-by: Bastien Grasnick <[email protected]>
@BGrasnick BGrasnick force-pushed the feat/302-export-correct-namespace-and-make-metrics-available-to-cluster-monitoring branch from 49559f5 to b82f99e Compare November 20, 2023 14:24
@BGrasnick BGrasnick changed the title Feat: export correct namespace and make metrics available to cluster monitoring Feat: export correct namespace Nov 20, 2023
Comment on lines +492 to +499
metricRelabelings := []*monv1.RelabelConfig{{
Action: "replace",
SourceLabels: []monv1.LabelName{
"container_namespace",
},
TargetLabel: "namespace",
}}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BGrasnick Have you tested this on OpenShift? IIUC, this will not be honoured in openshift if you use User Project Monitoring.

@sthaha
Copy link
Collaborator

sthaha commented Mar 11, 2024

@BGrasnick I am going to close this due to the reason mentioned above. Please feel free to reopen if you have found a solution for this. Meanwhile we have added the dashboards to developer view as well. So any user with view role to the kepler deployment namespace should be able to see all metrics.
See #369

@sthaha sthaha closed this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion needed Pre enhancement discussion do-not-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants