Skip to content
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

feat: allow setting attributes when recording exceptions #2298

Closed

Conversation

vreynolds
Copy link
Contributor

Which problem is this PR solving?

  • span.recordException needs to allow setting event attributes per spec

If RecordException is provided, the method MUST accept an optional parameter to provide any additional event attributes (this SHOULD be done in the same way as for the AddEvent method). If attributes with the same name would be generated by the method already, the additional attributes take precedence.

Short description of the changes

  • allow setting attributes when recording exception, same as the span.addEvent interface

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #2298 (5665c42) into main (7860344) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2298      +/-   ##
==========================================
+ Coverage   92.68%   92.75%   +0.06%     
==========================================
  Files         145      145              
  Lines        5184     5188       +4     
  Branches     1060     1058       -2     
==========================================
+ Hits         4805     4812       +7     
+ Misses        379      376       -3     
Impacted Files Coverage Δ
packages/opentelemetry-tracing/src/Span.ts 98.18% <100.00%> (+0.10%) ⬆️
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 96.91% <0.00%> (-0.08%) ⬇️
...emetry-instrumentation-xml-http-request/src/xhr.ts 97.58% <0.00%> (+0.99%) ⬆️
...emetry-api-metrics/src/platform/node/globalThis.ts 100.00% <0.00%> (+100.00%) ⬆️

@vreynolds
Copy link
Contributor Author

@vreynolds vreynolds closed this Jun 25, 2021
@vreynolds vreynolds deleted the update-span-record-exception branch June 25, 2021 15:08
@longility
Copy link
Contributor

@vreynolds Would we still want this without the otel api change even though we can't use it so that in the future, we can slot this in for v2 more easily?

@dyladan
Copy link
Member

dyladan commented Jan 19, 2022

I think we don't need to wait for v2. This feature could be added in a 1.x minor release.

@longility
Copy link
Contributor

Even better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants