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

Filtering metrics #557

Open
fxposter opened this issue Nov 21, 2023 · 6 comments
Open

Filtering metrics #557

fxposter opened this issue Nov 21, 2023 · 6 comments
Labels
community Issues or PRs opened by an external contributor help wanted Issues identified as good community contribution opportunities refined Issues that are ready to be prioritized

Comments

@fxposter
Copy link

Is your feature request related to a problem? Please describe.
What do you think about the ability to not show all metrics. There are cases when exporter has a lot of metrics (for example, there are a lot of upstream servers) and the user doesn't need all of them.

Describe the solution you'd like
I propose having the ability to apply 2 types of filters:

  1. show only metrics that match user-specified regex
  2. show only metrics that have non-zero values (this is very useful for metrics like nginxplus_upstream_server_fails or nginxplus_upstream_server_unavail, which are usually zeros all the time)

Describe alternatives you've considered
it is usually possible to reject some metrics on scraper side, but it's less efficient and usually "what metrics are exposed" and "what metrics are gathered" are controlled by different parties, so I just propose to add this ability to the project.

I'm happy to do the PR if the idea is accepted.

@lucacome
Copy link
Member

Hi @fxposter,

This seems like an interesting feature. How would you enable the filters?

@lucacome lucacome added the backlog candidate Pull requests/issues that are candidates to be backlog items label Dec 19, 2023

This comment was marked as outdated.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Mar 19, 2024
@brianehlert
Copy link

brianehlert commented Mar 19, 2024

Since the proliferation of metrics is primarily caused by NGINX Plus it seems that the most straightforward way to introduce a filter would be by excluding / including based on the N+ API paths as the basis for metrics groups.
Ignoring the N+ API version but the group after.
Focusing on the GETs here: https://demo.nginx.com/swagger-ui/

Things like zone names are highly configuration dependent and could be relatively simple to disrupt. But I can see how something like that could relate to the regex suggestion.

@github-actions github-actions bot removed the stale Pull requests/issues with no activity label Mar 20, 2024

This comment was marked as outdated.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Jun 18, 2024
@lucacome lucacome added community Issues or PRs opened by an external contributor and removed stale Pull requests/issues with no activity labels Jun 20, 2024
@mpstefan mpstefan added help wanted Issues identified as good community contribution opportunities backlog Pull requests/issues that are backlog items and removed backlog candidate Pull requests/issues that are candidates to be backlog items labels Jul 3, 2024
@mpstefan
Copy link

mpstefan commented Jul 3, 2024

Hey @fxposter, sorry it took us so long to come back around on this. We just changed the way these projects are managed and saw this request for enhancement. We think it makes sense to pursue a filter for these metrics if you want to take a look at doing the PR. If not, we marked this for "help wanted" if anyone else would like to pick it up!

@fxposter
Copy link
Author

fxposter commented Jul 5, 2024

hello, nice to hear that. I'll try to do the PR within next two weeks then.

@mpstefan mpstefan added the refined Issues that are ready to be prioritized label Jul 17, 2024
@mpstefan mpstefan removed the backlog Pull requests/issues that are backlog items label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues or PRs opened by an external contributor help wanted Issues identified as good community contribution opportunities refined Issues that are ready to be prioritized
Projects
None yet
Development

No branches or pull requests

4 participants