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

[pkg/ottl] add event_index to available paths in span event context #37092

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

bacherfl
Copy link
Contributor

@bacherfl bacherfl commented Jan 8, 2025

Description

This PR adds the event_index to the available paths in the span event context

Link 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

@bacherfl bacherfl marked this pull request as ready for review January 9, 2025 13:00
@bacherfl bacherfl requested a review from a team as a code owner January 9, 2025 13:00
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 overall, just one note.

pkg/ottl/contexts/ottlspanevent/span_events.go Outdated Show resolved Hide resolved
@github-actions github-actions bot requested a review from edmocosta January 10, 2025 05:59
Signed-off-by: Florian Bacher <[email protected]>
@bacherfl bacherfl requested a review from jpkrohling as a code owner January 17, 2025 09:17
@github-actions github-actions bot added processor/tailsampling Tail sampling processor processor/transform Transform processor labels Jan 17, 2025
Signed-off-by: Florian Bacher <[email protected]>
@github-actions github-actions bot requested a review from portertech January 20, 2025 06:07
func accessSpanEventIndex() ottl.StandardGetSetter[TransformContext] {
return ottl.StandardGetSetter[TransformContext]{
Getter: func(_ context.Context, tCtx TransformContext) (any, error) {
return tCtx.eventIndex, nil
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/ottl processor/tailsampling Tail sampling processor processor/transform Transform processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pkg/ottl] event_index in ottlspanevent TransformContext
5 participants