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

Collector Exporter: Support regex matching for metric resource_filters #447

Closed
jsirianni opened this issue Jun 30, 2022 · 1 comment · Fixed by #535
Closed

Collector Exporter: Support regex matching for metric resource_filters #447

jsirianni opened this issue Jun 30, 2022 · 1 comment · Fixed by #535
Assignees
Labels
enhancement New feature or request priority: p3

Comments

@jsirianni
Copy link

It would be nice if metric.resource_filters supported regex matching in addition to string prefix.

If I want to always copy all resource attributes, I need to define resource_filters like this:

...
          metric:
            resource_filters:
              - prefix: a
              - prefix: A
              - prefix: b
              - prefix: B
              ...
              - prefix: z
              - prefix: Z
...

It would be nice if I could accomplish the same thing using the filter * or have an option to skip matching entirely and just copy all resource attributes to metric labels.

This is a big friction point for customers because they need to define a resource prefix for every receiver in their pipeline. Failing to do so will result in duplicate metric / time series errors. For example, Rabbitmq has metrics on a per queue basis. If The system has multiple queues, the Google API will reject these metrics (because they appear are duplicates) if the user has not configured the correct resource filter prefix.

This configuration will not work until the user has added the correct resource filter prefix:

receivers:
  rabbitmq:
    endpoint: http://localhost:15672
    collection_interval: 60s
    # From environment. See README.md.
    username: $RABBITMQ_USERNAME
    password: $RABBITMQ_PASSWORD

exporters: 
  googlecloud:

service:
  pipelines:
    metrics:
      receivers:
      - rabbitmq
      exporters:
      - googlecloud

These resource attributes are critical but omitted by default.

@dashpole
Copy link
Contributor

Just curious, does this work?

          metric:
            resource_filters:
              - prefix: ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: p3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants