-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 truncate editor #23880
Add ottl truncate editor #23880
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an Enhancement
changelog entry for pkg/ottl
.
Hmm, I know I'm swooping in late to this, but string editing is a bit more general than just |
Sounds like competing concerns between consistency with existing |
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Bumping this. Wondering if any other @open-telemetry/collector-contrib-maintainer can review this and / or have opinions about a truncate vs. a more generic slice. |
I think @kentquirk brings up a good point that The easiest solution is to name it @kentquirk @evan-bradley what do you think? |
I understood Kent's point a little differently: that Looking at the original issue, I think having a As another way of solving the issue, should |
Just to confirm, that's not a solution for the problem today without a
If
👍 If folks agree on adding |
Yes, that's a good point. The full correct statement would be
Could you elaborate on this? If |
I agree that With Converters, OTTL prefers explicit errors, so I'm leaning towards I felt ok about @evan-bradley @kentquirk @jack-berg if you all agree lets handle this issue via a |
Closing in favor of #24420. |
**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](#23880 (comment)) on #23880. --------- Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Description:
Add ottl
truncate
editor for truncating strings. E.g.:Link to tracking Issue: Resolves #23847.
Testing: Unit tests, local verification with running collector.
Documentation: Added documentation to
pkg/ottl/ottlfuncs/README.md
.