Skip to content

Commit 0f8e128

Browse files
authored
[pkg/ottl] Update docs of functions impacted by grammar bug (open-telemetry#23259)
Update readme
1 parent 6d35fd7 commit 0f8e128

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pkg/ottl/ottlfuncs/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ The `replace_all_matches` function replaces any matching string value with the r
152152

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

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

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

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

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

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

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

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

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

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

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

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

402416
If target is nil, false is always returned.
403417

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

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

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

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

550570
- ```Split("A|B|C", "|")```

0 commit comments

Comments
 (0)