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

[pkg/ottl] Update docs of functions impacted by grammar bug #23259

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pkg/ottl/ottlfuncs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ The `replace_all_matches` function replaces any matching string value with the r

Each string value in `target` that matches `pattern` will get replaced with `replacement`. Non-string values are ignored.

There is currently a bug with OTTL that does not allow the pattern to end with `\\"`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- `replace_all_matches(attributes, "/user/*/list/*", "/user/{userId}/list/{listId}")`
Expand All @@ -170,6 +173,10 @@ If one or more sections of `target` match `regex` they will get replaced with `r

The `replacement` string can refer to matched groups using [regexp.Expand syntax](https://pkg.go.dev/regexp#Regexp.Expand).

There is currently a bug with OTTL that does not allow the pattern to end with `\\"`.
If your pattern needs to end with backslashes, add something inconsequential to the end of the pattern such as `{1}`, `$`, or `.*`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- `replace_all_patterns(attributes, "value", "/account/\\d{4}", "/account/{accountId}")`
Expand All @@ -190,6 +197,9 @@ The `replace_match` function allows replacing entire strings if they match a glo

If `target` matches `pattern` it will get replaced with `replacement`.

There is currently a bug with OTTL that does not allow the pattern to end with `\\"`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- `replace_match(attributes["http.target"], "/user/*/list/*", "/user/{userId}/list/{listId}")`
Expand All @@ -206,6 +216,10 @@ If one or more sections of `target` match `regex` they will get replaced with `r

The `replacement` string can refer to matched groups using [regexp.Expand syntax](https://pkg.go.dev/regexp#Regexp.Expand).

There is currently a bug with OTTL that does not allow the pattern to end with `\\"`.
If your pattern needs to end with backslashes, add something inconsequential to the end of the pattern such as `{1}`, `$`, or `.*`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- `replace_pattern(resource.attributes["process.command_line"], "password\\=[^\\s]*(\\s?)", "password=***")`
Expand Down Expand Up @@ -401,6 +415,9 @@ If target is not a string, it will be converted to one:

If target is nil, false is always returned.

There is currently a bug with OTTL that does not allow the target string to end with `\\"`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- `IsMatch(attributes["http.path"], "foo")`
Expand Down Expand Up @@ -545,6 +562,9 @@ The `Split` Converter separates a string by the delimiter, and returns an array

If the `target` is not a string or does not exist, the `Split` Converter will return an error.

There is currently a bug with OTTL that does not allow the target string to end with `\\"`.
[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238).

Examples:

- ```Split("A|B|C", "|")```
Expand Down