Skip to content

Filtering metrics #557

@fxposter

Description

@fxposter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues or PRs opened by an external contributorhelp wantedIssues identified as good community contribution opportunitiesrefinedIssues that are ready to be prioritizedstalePull requests/issues with no activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions