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

Add an optional argument to converters to support hashing #27235

Merged
merged 8 commits into from
Oct 11, 2023

Conversation

rnishtala-sumo
Copy link
Contributor

@rnishtala-sumo rnishtala-sumo commented Sep 27, 2023

Description: Functions to modify matched text during replacement can now be passed as optional arguments to the following Editors:

  • replace_pattern
  • replace_all_patterns
  • replace_match
  • replace_all_matches

Documentation:
https://github.com/rnishtala-sumo/opentelemetry-collector-contrib/blob/ottl-replace-pattern/pkg/ottl/ottlfuncs/README.md#replace_pattern

Issue:
Resolves #22787

@rnishtala-sumo rnishtala-sumo changed the title Add optional parameter to the replace_pattern OTTL functions Add optional parameter to the replace_pattern OTTL function Sep 27, 2023
@rnishtala-sumo rnishtala-sumo changed the title Add optional parameter to the replace_pattern OTTL function Add optional argument to converters to support hashing Sep 27, 2023
@rnishtala-sumo rnishtala-sumo changed the title Add optional argument to converters to support hashing Add an optional argument to converters to support hashing Sep 27, 2023
pkg/ottl/functions.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_replace_all_matches_test.go Outdated Show resolved Hide resolved
@rnishtala-sumo rnishtala-sumo force-pushed the ottl-replace-pattern branch 2 times, most recently from 1b671da to dd4c1ae Compare October 2, 2023 19:17
pkg/ottl/ottlfuncs/func_replace_all_matches.go Outdated Show resolved Hide resolved
pkg/ottl/functions.go Outdated Show resolved Hide resolved
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

I think these changes are complicated enough that I'd like to see some e2e tests added via the transformprocessor's processor_test.go files.

pkg/ottl/ottlfuncs/func_replace_all_matches.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_replace_all_matches.go Outdated Show resolved Hide resolved
@rnishtala-sumo rnishtala-sumo force-pushed the ottl-replace-pattern branch 2 times, most recently from 1028063 to f1fa799 Compare October 6, 2023 21:04
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

Exciting!

.chloggen/ottl-replace-pattern.yaml Outdated Show resolved Hide resolved
.chloggen/ottl-replace-pattern.yaml Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_replace_all_matches.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_replace_all_matches.go Outdated Show resolved Hide resolved
@evan-bradley evan-bradley merged commit 14ea97d into open-telemetry:main Oct 11, 2023
83 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 11, 2023
JaredTan95 pushed a commit to openinsight-proj/opentelemetry-collector-contrib that referenced this pull request Oct 18, 2023
…etry#27235)

**Description:** Functions to modify matched text during replacement can
now be passed as optional arguments to the following Editors:
- replace_pattern
- replace_all_patterns
- replace_match
- replace_all_matches

**Documentation:**

https://github.com/rnishtala-sumo/opentelemetry-collector-contrib/blob/ottl-replace-pattern/pkg/ottl/ottlfuncs/README.md#replace_pattern

**Issue:**
Resolves
open-telemetry#22787
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this pull request Nov 12, 2023
…etry#27235)

**Description:** Functions to modify matched text during replacement can
now be passed as optional arguments to the following Editors:
- replace_pattern
- replace_all_patterns
- replace_match
- replace_all_matches

**Documentation:**

https://github.com/rnishtala-sumo/opentelemetry-collector-contrib/blob/ottl-replace-pattern/pkg/ottl/ottlfuncs/README.md#replace_pattern

**Issue:**
Resolves
open-telemetry#22787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A new ottl function/editor to replace a regex pattern match with its hash value or digest
3 participants