-
Notifications
You must be signed in to change notification settings - Fork 851
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
Stabilize ExceptionEventData #6795
Changes from 4 commits
219ae6f
e7c0a03
015a707
b6e5816
9700e01
661fc17
b89292a
7cc7162
e5e686c
131062a
b084f01
d2e0cea
aefe947
18c2578
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
Comparing source compatibility of opentelemetry-sdk-trace-1.44.0-SNAPSHOT.jar against opentelemetry-sdk-trace-1.43.0.jar | ||
No changes. | ||
+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.trace.data.ExceptionEventData (not serializable) | ||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a. | ||
+++ NEW INTERFACE: io.opentelemetry.sdk.trace.data.EventData | ||
+++ NEW SUPERCLASS: java.lang.Object | ||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.trace.data.ExceptionEventData create(io.opentelemetry.sdk.trace.SpanLimits, long, java.lang.Throwable, io.opentelemetry.api.common.Attributes) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upon closer inspection, I find this method strange. The resulting
Seems odd to have a special accessor for If they want o split out the exception attributes from additional attributes, can do so with Do we really need the special There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm. good eye on double checking the original API for this. Maybe we're not quite ready to stabilize, if we're unsure of the final API? I agree the creational patterns for this are currently strange and not user-friendly. 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can still stabilize, but cut out the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you agree, I can either push some commits to this PR, or provide some more complete guidance to @vasantteja on how to proceed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm totally ok with your suggestion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jack-berg I understand that we should remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've got it. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jack-berg I finally wrapped my head around this and have an implementation. I cut out the attribute computation in the |
||
+++ NEW METHOD: PUBLIC(+) ABSTRACT(+) io.opentelemetry.api.common.Attributes getAdditionalAttributes() | ||
+++ NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Throwable getException() |
This file was deleted.
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.
@jkwatson its odd for the create method to accept
SpanLimits
as an argument. Normally the application of limits is handled in SDK internals. We can see this pattern play out in theEventData.create
contract:The attributes are provided with an additional
totalAttributeCount
indicating how many attributes were originally present.The reason we do it differently for
ExceptionEventData
appears to be becauseImmutableExceptionEvent#getAttributes()
doesn't compute the attributes until it is called (and then it memoizes them), preventing additional allocations on the hot path.Not sure there's a way to avoid
SpanLimits
being passed as an argument if we stick with that argument.