-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement span processor's OnEnding #5756
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5756 +/- ##
=====================================
Coverage 84.5% 84.5%
=====================================
Files 272 272
Lines 22734 22746 +12
=====================================
+ Hits 19226 19238 +12
Misses 3165 3165
Partials 343 343 |
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.
This PR looks fine in general. However, this is adding a non-stable portion of the specification into this stable package. For that reason I'm blocking this PR. We do not want to add something we do not plan to support in the long term.
Would you rather the interface be in |
SGTM |
SGTM as well. |
d0c45e5
to
b05b02f
Compare
b05b02f
to
fb6bba5
Compare
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.
Could you make the docs better? Look at #5692 for reference.
Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
@open-telemetry/go-approvers ping for review? |
@MrAlias since you requested changes, can you review/approve this PR? |
sdk/trace/span.go
Outdated
oesp.OnEnding(s) | ||
} | ||
} | ||
s.mu.Lock() |
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.
This acquires the lock twice. Can this be avoided instead?
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.
Not really, as we need to set the end time, and later on, mark the span as having ended.
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.
This is going to impact the performance of users who are not using the experimental feature. We need to look into alternatives.
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.
I've changed to only lock once if there are no onending processors.
This does not prevent the span from being modified by any other goroutine that holds a reference to the span. |
I'm open to ideas about that. There are two other implementations so far:
|
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.
Not compliant with the spec per #5756 (comment). Maybe the spec should be revisited? If I understand correctly then this proposal is also not compliant with the spec.
Have you looked into ending the original span, and passing a wrapped version of that span to the |
If the original span is ended, the wrapper couldn't propagate changes to it. |
If you are doing so from within the |
This allows span processors to implement the new, in development specification, OnEnding.
Spec PR: open-telemetry/opentelemetry-specification#4024