-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pkg/ottl] add event_index to available paths in span event context #37092
base: main
Are you sure you want to change the base?
[pkg/ottl] add event_index to available paths in span event context #37092
Conversation
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
…nto feat/35778/ottl-event-index
Signed-off-by: Florian Bacher <[email protected]>
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.
Looks good overall, just one note.
Co-authored-by: Evan Bradley <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
# Conflicts: # pkg/ottl/contexts/ottlspanevent/span_events.go
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
func accessSpanEventIndex() ottl.StandardGetSetter[TransformContext] { | ||
return ottl.StandardGetSetter[TransformContext]{ | ||
Getter: func(_ context.Context, tCtx TransformContext) (any, error) { | ||
return tCtx.eventIndex, nil |
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.
Maybe instead of checking for negative values in the Option the getter should check and return an error if it finds one.
Also might be good to be able to indicate if the user set the value and if they didn't, error. We dont want to return a default 0 incorrectly.
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Description
This PR adds the
event_index
to the available paths in the span event contextLink to tracking issue
Fixes #35778
Testing
Unit tests, e2e tests
Documentation
added an entry in the list of available paths in the readme of then span event context