[pkg/telemetryquerylanguage] add replace_key_all_patterns function
@fatsheep9146 can you break this into 2 PR, one for the function add and one to the transform processor? It'd be nice to do it all in one PR but any functions added to transformprocessor should have integration tests added to a signals processor_test.go and I think the PR would be too large.
@fatsheep9146 can you break this into 2 PR, one for the function add and one to the transform processor? It'd be nice to do it all in one PR but any functions added to transformprocessor should have integration tests added to a signals processor_test.go and I think the PR would be too large.
I've removed it from transform processor, and I will submit second PR until this one is merged.
The integration test seems unrelated to this pr @TylerHelmuth
@bogdandrutu @kentquirk curious on your thoughts on this function. It will certainly meet the needs of the user to rename keys in bulk, but we'd end up with replace_match, replace_all_matches, replace_pattern, replace_all_patterns, and replace_key_all_patterns functions, all that are named similarly and do similar, but slightly different things.
For this particular use case we could instead update replace_all_patterns to take a new parameter (string or enum) that specifies whether the function applies to keys or values and update the logic accordingly. This would be a breaking change (which is ok bc the processor/tql is still in alpha), but would keep the number of functions lower.
For this particular use case we could instead update replace_all_patterns to take a new parameter (string or enum) that specifies whether the function applies to keys or values and update the logic accordingly.
@fatsheep9146 please update your implementation to match this comment instead of adding a new function.
For this particular use case we could instead update replace_all_patterns to take a new parameter (string or enum) that specifies whether the function applies to keys or values and update the logic accordingly.
@fatsheep9146 please update your implementation to match this comment instead of adding a new function.
I already add a new parameter, please help review this =D @TylerHelmuth
Please help review this again =D @TylerHelmuth
All comments are fixed. @TylerHelmuth
@bogdandrutu Could you help review this?
@fatsheep9146 please address conflicts
@fatsheep9146 please address conflicts
I think the failed task is due to transformprocessor
make[2]: Entering directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/processor/transformprocessor'
Check License finished successfully
running misspell -error
golangci-lint run --allow-parallel-runners
make[2]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/processor/tailsamplingprocessor'
Error: internal/logs/processor_test.go:90:79: td.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Attributes().InsertString undefined (type pcommon.Map has no field or method InsertString) (typecheck)
td.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Attributes().InsertString("url", "http://localhost/health")
Should I fix those in seperate prs? @TylerHelmuth
@fatsheep9146 Ya those errors don't seem correct. Attempt to fix in another PR, but I suspect if you create a new branch from main you won't see them.
@fatsheep9146 Ya those errors don't seem correct. Attempt to fix in another PR, but I suspect if you create a new branch from main you won't see them.
Sorry, it's my mistake, the reason is that in transformprocessor test, I also fix some test for this feature, I will fix this.
Needs a rebase
Rebase done, I think this is ready-to-merge. @codeboten @TylerHelmuth
@TylerHelmuth @codeboten Could you help add ready-to-merge label?
Please add a changelog entry.
@fatsheep9146 please rebase.
This is awesome, thanks so much everyone 🍾