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
When batching, same object is mutated destroying exception information #1187
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Good catch, please fix the build errors and then we can merge this. |
cb75eb7
to
211fa74
Compare
Thanks @lzchen. Updated the way the object is copied, so hopefully works now. Had some unrelated tests fail locally (prometheus extension), but I believe something is not properly setup in my environment. |
@calleo |
684ab6a
to
c710688
Compare
…e the same object is mutated
…utated further down
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.
@calleo
Would you kindly add a CHANGELOG entry?
Thanks' for reviewing. I've added this fix to the changelog now. |
While testing Azure Exporter to see if exceptions (and traces) where propagated correctly to Application Insights I noticed that stack traces ended upp in a custom field called "stacktrace" but they where not tagged as exceptions in Application Insights.
Each time an exception occurs within a span, the function
span_data_to_envelope
will yield twice. The problem is that the same envelope object is re-used and modified. The current tests won't fail because eachyield
is tested in isolation, given the nature ofnext
.In my setup,
emit
is always called with a batch of span's, meaning all of them are processed before sent to Application Insights. As a result I end up with two envelopes of typeMicrosoft.ApplicationInsights.Request
. I would expect one of typeMicrosoft.ApplicationInsights.Exception
and one ofMicrosoft.ApplicationInsights.Request
.