Commit Graph

1 Commits

Author SHA1 Message Date
Povilas Versockas 8cc8d4018d
[mdatagen] allow filtering out metrics based on resource attributes (#9660)
**Description:**
This PR allows filtering out metrics based on resource attributes. For
example:

```
        resource_attributes:                                                                      
          k8s.pod.name:
            enabled: true 
            exclude:
              #- strict: "kube-apiserver-kind-control-plane"
              - regexp: "kube-.*"
              - regexp: "coredns-.*"
              - strict: "coredns"
              - strict: "kindnet-mpb2p"
```

Would remove metrics that match regex or strict rules on resource
attributes.

**Link to tracking Issue:**
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/25134

**Testing:** 
- Tested with k8scluster receiver in kind cluster.
- unit tests added
**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2024-04-11 21:17:41 -07:00