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 ottl len converter #24420

Merged
merged 6 commits into from
Jul 27, 2023
Merged

Conversation

jack-berg
Copy link
Member

Description:

Add ottl Len converter to make Substring useful for truncating. E.g.:

    log_statements:
      - context: log
        statements:
        - set(body, Substring(body, 0, 10)) where Len(body) >= 10

Link to tracking Issue: Resolves #23847.

Testing: Unit tests, local verification with running collector.

Documentation: Added documentation to pkg/ottl/ottlfuncs/README.md.

This PR is the result of conversation on #23880.

.chloggen/add-ottl-len-converter.yaml Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_len.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.

Thanks!

pkg/ottl/ottlfuncs/func_len.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_len.go Outdated Show resolved Hide resolved
.chloggen/add-ottl-len-converter.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
@TylerHelmuth
Copy link
Member

@jack-berg I got the spacing wrong :(

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for implementing this.

pkg/ottl/ottlfuncs/func_len_test.go Outdated Show resolved Hide resolved
@TylerHelmuth TylerHelmuth merged commit 3e1037a into open-telemetry:main Jul 27, 2023
89 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 27, 2023
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.

[processor/transform] not enough preconditions to guard against warnings
4 participants