Skip to content

Add setting for filtering empty containers on Prometheus queries#7777

Open
jweak wants to merge 2 commits into
masterfrom
metrics-query-setting
Open

Add setting for filtering empty containers on Prometheus queries#7777
jweak wants to merge 2 commits into
masterfrom
metrics-query-setting

Conversation

@jweak

@jweak jweak commented May 25, 2023

Copy link
Copy Markdown
Contributor

Adds a setting for applying the old Prometheus queries which were changed in this PR #6679

This change made it so that some setups are observing metrics as doubled. container!="" does filter those values.

image

We have this change only for operator provider since it's the only one that had that change. We'll show the setting for Auto Detect or Operator values since those are the ones that could lead into using the operator Prometheus provider.

#7299

Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
@jweak jweak requested a review from a team as a code owner May 25, 2023 11:04
@jweak jweak requested review from a team, ixrock and jim-docker and removed request for a team May 25, 2023 11:04
@jweak jweak added the area/metrics All the things related to metrics label May 25, 2023
@jweak jweak added this to the 6.6.0 milestone May 25, 2023
@jweak jweak added the bug Something isn't working label May 25, 2023
@github-actions

github-actions Bot commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@dragoangel

Copy link
Copy Markdown

Can this PR get merged?

@ErikLundJensen

Copy link
Copy Markdown

Any progress? Would be great to get it into the next release.

@Nova-Logic

Copy link
Copy Markdown

@jweak please resolve the conflicts, community really need this

@Nova-Logic

Copy link
Copy Markdown

@jim-docker @ixrock please review this PR

@pasztorl

Copy link
Copy Markdown

Hi! There is any update on this please?

@2martens

2martens commented Mar 6, 2024

Copy link
Copy Markdown

It appears that this repo is no longer maintained.

@Nova-Logic

Copy link
Copy Markdown

very sad to see that this project is dead

@roman-parkhunovskyi

Copy link
Copy Markdown

This is a must have.

@pasztorl

Copy link
Copy Markdown

lens is not dead, official site links to this repository, but I can't see any communication about how this repo maintained now and the future. I hope lens crew will announce something about this.

@circlingthesun

Copy link
Copy Markdown

I've got kube-prometheus-stack configured and it has container!="" configured on all the graphana dashboards. Would be good to have this on lens.

@circlingthesun

Copy link
Copy Markdown

The bundled lens metrics doesn't have this issue, so I did some more digging and found:

https://stackoverflow.com/questions/69281327/why-container-memory-usage-is-doubled-in-cadvisor-metrics/69282328#69282328

So I modified my helm values for kube-prometheus-stack with:

kubelet:  
  serviceMonitor:
    cAdvisorMetricRelabelings:
      - sourceLabels: [container, __name__, pod]
        regex: ";container_.+;.+"
        action: drop

And that took care of the duplicate metrics for kube-prometheus-stack as the above thread suggested.

@dragoangel

dragoangel commented Dec 1, 2024

Copy link
Copy Markdown

The bundled lens metrics doesn't have this issue, so I did some more digging and found:

https://stackoverflow.com/questions/69281327/why-container-memory-usage-is-doubled-in-cadvisor-metrics/69282328#69282328

So I modified my helm values for kube-prometheus-stack with:

kubelet:  
  serviceMonitor:
    cAdvisorMetricRelabelings:
      - sourceLabels: [container, __name__, pod]
        regex: ";container_.+;.+"
        action: drop

And that took care of the duplicate metrics for kube-prometheus-stack as the above thread suggested.

This is the point, that's a proper way is just to use container!="" and do not change metrics in way they work.

@circlingthesun

Copy link
Copy Markdown

@dragoangel yeah. This seems to be a pretty simple thing to fix, but it's been over a year and a half. So I prefer to work around this rather than look at bad metrics for the foreseeable future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/metrics All the things related to metrics bug Something isn't working PR: needs rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants