Skip to content

Commit

Permalink
Clarify attributes also use regex (open-telemetry#31496)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
breedx-splk authored and DougManton committed Mar 13, 2024
1 parent dccf911 commit d10d5bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions processor/attributesprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ attributes:
# It is supported to have more than one specified, but all of the specified
# conditions must evaluate to true for a match to occur.
# match_type controls how items in "services" and "span_names" arrays are
# interpreted. Possible values are "regexp" or "strict".
# match_type controls how items in "services", "span_names", and "attributes"
# arrays are interpreted. Possible values are "regexp" or "strict".
# This is a required field.
match_type: {strict, regexp}
Expand Down Expand Up @@ -284,12 +284,12 @@ attributes:
metric_names: [<item1>, ..., <itemN>]
# Attributes specifies the list of attributes to match against.
# All of these attributes must match exactly for a match to occur.
# All of these attributes must match for a match to occur.
# This is an optional field.
attributes:
# Key specifies the attribute to match against.
- key: <key>
# Value specifies the exact value to match against.
# Value specifies the value to match against.
# If not specified, a match occurs if the key is present in the attributes.
value: {value}
```
Expand Down

0 comments on commit d10d5bf

Please sign in to comment.