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

Relabelings #74

Closed
mateuszdrab opened this issue Mar 31, 2024 · 4 comments
Closed

Relabelings #74

mateuszdrab opened this issue Mar 31, 2024 · 4 comments
Assignees

Comments

@mateuszdrab
Copy link
Contributor

Hey

Just raising an idea that relabelings and metric relabelings should be configurable on the service monitor resource from the helm chart.

I need to relabel container and pod labels to match what kube state metrics provides.

@jmcgrath207 jmcgrath207 self-assigned this Mar 31, 2024
@jmcgrath207
Copy link
Owner

jmcgrath207 commented Mar 31, 2024

Agree. I created a prerelease 1.6.3-rc01 for you to test my changes.

https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics/releases/tag/1.6.3-rc01

The changes are in #76, which works with empty values when observed in Grafana.

Admittedly, I am not super familiar with this. If your change works, could you send me a test case of the values you supplied? I want to add it to our tests.

Thanks!

@mateuszdrab
Copy link
Contributor Author

mateuszdrab commented Apr 1, 2024

Thanks for implementing the change so quickly.

I'm trying to deploy the chart with the below values but there's an error, think it might be an indentation issue.
Error: UPGRADE FAILED: YAML parse error on k8s-ephemeral-storage-metrics/templates/metrics.yaml: error converting YAML to JSON: yaml: line 16: did not find expected key

serviceMonitor:
  relabelings:
    - sourceLabels: [pod_name]
      targetLabel: pod
    - sourceLabels: [pod_namespace]
      targetLabel: namespace
    # drop labels pod_.*
    - regex: "pod_(.*)"
      action: labeldrop

Chart deploys fine without relabelings in the values

Copilot suggesting moving from indent 4 to indent 8

@jmcgrath207
Copy link
Owner

No worries. I see, you beat me to it 🥇 I merged. Thanks for your contribution. I will release it soon here.

@jmcgrath207
Copy link
Owner

jmcgrath207 commented Apr 2, 2024

1.6.3 was just released with our change.

In hindsight, I should have used those labels in your test case 😅. I might do so for 2.0 after refactoring for unit testing.

If you see any other issues or improvements, feel free to raise an issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants