-
Notifications
You must be signed in to change notification settings - Fork 896
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
Should Span.RecordException() support more options or be replaced by an optional AddEvent() parameter? #814
Comments
Also related proposal to add severity to |
Since #822 is now the third (second?) PR that wants to add a parameter to RecordExcetpion, I suggest a different solution: Remove RecordException and replace it with an optional parameter Exception to AddEvent. |
I was tempted to add required-for-ga, but RecordException seems to be an API that is a tiny burden to support if we decide to (additionally) have the Exception parameter for AddEvent. |
That would be fast: removing an API in like, a month, after adding it? |
There has been no spec release since adding the API. |
Look at this PR this way. Error WG has meet several times, discussed the current variety of proposals and came up with #697 which expressed the consensus of that Working Group. Now a person outside that group makes a proposal to rollback that decision, already accepted and merged to spec, without discussing that with the working group. Error Working Group is still active, we meet every week and discuss further work. #822 is one such step further. If you are interested in this topic (as your activity indicates), please come to a meeting and participate in WG job. |
I think there could be some value in allowing it to accept additional options, depending on the use case, like setting relevant span level attributes. For example, #822 recommends adding the ability to set a span level attribute |
Sorry, I don't propose to remove the functionality! I actually think having a convenience method to record exceptions is essential. In #814 (comment) I was just thinking of adding the exception parameter as argument to AddEvent. Then you could do something like |
I think recording an event and setting, possibly overriding, a span attribute in the same method call is potentially confusing. Recording an event is simple, as you don't have to think about how subsequent calls to SetAttribute, AddEvent, RecordException, ... will interact with this call: every event is isolated and immutable. If you have "append (an event)" semantics for some parameters and "set/override (an attribute)" for others, this can lead to surprises. |
I updated the issue description. |
We have a general purpose Thus the question seems to be: what other convenience methods we should/want to add, if any? We currently have two proposals to add different boolean flags to Thus I propose not to change API right now. #822 can easily be reduced to just semantic convention. #784 can potentially be reduced to semantic convention on events and usage of general purpose |
The problem is that AddEvent does not support exceptions currently. I don't think specifying the exception attributes manually (especially stacktrace, qualified type name, ...) is something we want users to do manually. So I don't think you can call RecordException a "convenience" method. It is definitely not a primitive, but it does do some actual work beyond just providing syntax sugar.
I don't think I want to basically write out a full re-implementation of RecordException just to set exception.escaped. I'd rather not set the attribute if I were a user then. |
Required for #784, #822
From #784 (comment)
RecordException is currently rather inflexible:
The text was updated successfully, but these errors were encountered: