Add capability to evaluate field-level type checks#2794
Open
albertlockett wants to merge 6 commits intoopen-telemetry:mainfrom
Open
Add capability to evaluate field-level type checks#2794albertlockett wants to merge 6 commits intoopen-telemetry:mainfrom
albertlockett wants to merge 6 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2794 +/- ##
==========================================
+ Coverage 86.09% 86.10% +0.01%
==========================================
Files 694 695 +1
Lines 263421 263941 +520
==========================================
+ Hits 226789 227273 +484
- Misses 36108 36144 +36
Partials 524 524
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Part 2 of what was started in #2754 ...
Adds the capability to OPL and the OTAP query-engine to evaluate logical expressions that check the type of some field. For example:
This i useful for cases where users may wish to do something with a field of unknown type (an
AnyValue) and the operation would fail if the value was not the correct type. For example, maybe I wish to redact log body only if it is text, when I know that sometimes the body will actually be an int:In this case we use the
GetTypeexpression which is only supposed to return a value from theValueTypeenum (see discussion here: #2754 (comment)), so currently only these values are supported. Although there are in fact many other types supported by OTel (e.g. specific int types like uint32, some etc.) the set of types inValueTypeseem to be enough for most useful expressions, at least in the context of what the engine currently supports.What issue does this PR close?
How are these changes tested?
Unit tests
Are there any user-facing changes?
Yes - this type of expressions is now available in transform processor.