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

Clarify attributes also use regex #31496

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

breedx-splk
Copy link
Contributor

Disclaimer: I didn't actually manage find the place in the code where this happens, so please pump the brakes if this is off-base/wrong.

The description of match_type for regexp does not mention attributes, but the example config in the tests looks like it uses regexp. This could lead a user to think that regex cannot be used for attribute values when reading the docs here.

The docs around the attribute value also indicated "exact", which could lead a user to believe that regex wasn't supported.

@breedx-splk breedx-splk requested review from a team and jpkrohling February 29, 2024 01:27
@github-actions github-actions bot added the processor/attributes Attributes processor label Feb 29, 2024
@crobert-1 crobert-1 added Skip Changelog PRs that do not require a CHANGELOG.md entry documentation Improvements or additions to documentation labels Feb 29, 2024
@crobert-1
Copy link
Member

I looked into this a bit, the attributes referred to here are coming from here.

There's a comment that states only strict match type is supported which is original to the functionality. However, soon after filtering was added for attributes, the ability to use regex to filter attribute values if they're a string was added. This regex matching was approved by original authors and maintainers, and is now widely used by different components in the collector (I see regex references in the filter processor and ottl as well).

Because of this, I believe the comments are simply out of date and we should update the documentation as you're doing. 👍

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@atoulme atoulme added the ready to merge Code review completed; ready to merge by maintainers label Mar 9, 2024
@djaglowski djaglowski merged commit d780086 into open-telemetry:main Mar 12, 2024
147 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 12, 2024
codeboten pushed a commit that referenced this pull request Mar 12, 2024
…nality (#31517)

Context:
#31496 (comment)

I believe strict matching was originally the only supported option for
attributes, and regex was added shortly after. I believe this comment
was missed with the update, so it's out of date. Refer to the referenced
comment above for more context and references.
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
Disclaimer: I didn't actually manage find the place in the code where
this happens, so please pump the brakes if this is off-base/wrong.

The description of `match_type` for `regexp` does not mention
attributes, but the [example config in the
tests](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor/testdata/config.yaml#L303)
looks like it uses regexp. This could lead a user to think that regex
cannot be used for attribute values when reading the docs here.

The docs around the attribute value also indicated "exact", which could
lead a user to believe that regex wasn't supported.
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
…nality (open-telemetry#31517)

Context:
open-telemetry#31496 (comment)

I believe strict matching was originally the only supported option for
attributes, and regex was added shortly after. I believe this comment
was missed with the update, so it's out of date. Refer to the referenced
comment above for more context and references.
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
Disclaimer: I didn't actually manage find the place in the code where
this happens, so please pump the brakes if this is off-base/wrong.

The description of `match_type` for `regexp` does not mention
attributes, but the [example config in the
tests](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor/testdata/config.yaml#L303)
looks like it uses regexp. This could lead a user to think that regex
cannot be used for attribute values when reading the docs here.

The docs around the attribute value also indicated "exact", which could
lead a user to believe that regex wasn't supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation processor/attributes Attributes processor ready to merge Code review completed; ready to merge by maintainers Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants