Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add SetErrorStatusOnException option to TracerProviderSdk #1858
Add SetErrorStatusOnException option to TracerProviderSdk #1858
Changes from 16 commits
8494e39
106fb83
33d6817
bee267a
886fdcc
bb99d9a
db4141d
266ccf9
42228b6
8a8b0c8
dbd4f44
a2d332d
1252df2
e2a9cdd
b7daf81
a6e2356
b54d0ba
1332c8d
9bf74a3
4cdf023
76b8e25
ecffe5d
b41ca42
c7b115f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 guide 😄
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.
From the doc it looks like its support in all cases except in .NET Core 2.1.
Do you know if it works in windows only?
While we can generally redirect users to official docs, we can list any obvious things right here in this doc . for example, if this only works in Windows, we can mention it here (along with link to official doc)
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.
It works on Mac (x64) and Linux (x86 VM) as I've tested locally (I also created issue #1859 to cover ARM64).
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.
Is it possible to get the type, message, and/or stack from the IntPtr returned from GetExceptionPointers?
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.
Yes it is possible by traveling through the SEH object. This is CPU/OS/platform dependent and not well documented.
https://bytepointer.com/resources/pietrek_crash_course_depths_of_win32_seh.htm.
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 petty intense! Not sure if it is worth attempting.
Why I bring it up:
I was just thinking about the applications I have instrumented with OpenTelemetry .NET so far. There are really only a few spots I've had the need to create spans manually. Almost exclusively around queues/topics. In those cases, I'm doing what the example has, with one exception...
...instead of...
So, commenting from the perspective of a user of the library, since there's only a handful of spots where I have the try/catch, and the message/description is super useful, I'll probably continue doing the try/catch instead of using the processor/option. But if the processor could grab the message too, that would be something.
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'm happy to cover it in a follow up PR.
One heads up, the exceptions we captured here could be any SEH exception - e.g. C++ exception, OS exception.
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'm using #1874 to explore how deep should we go.