Skip to content

Support lookarounds for allow and deny lists? #2594

@rexagod

Description

@rexagod

What happened: Currently, allow and deny lists are mutually exclusive, and only one of them can be specified at a time. So, for instance, if we want to "deny" all but one metric, for e.g., deny kube_*_created but don't deny kube_namespace_created, that's not possible as the standard regexp package has to guarantee an O(n) runtime complexity (or less) for all operations, which is not possible for lookarounds.

What you expected to happen: Using something like https://github.com/dlclark/regexp2#compare-regexp-and-regexp2 that allows for lookarounds in such expressions.

How to reproduce it (as minimally and precisely as possible): go run . --kubeconfig=$KUBECONFIG --metric-denylist='^kube_(?<=namespace_created).*_created$' doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions