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

Set Activity.Status when adding SetErrorStatusOnException #4336

Merged
merged 9 commits into from
Mar 31, 2023

Conversation

vishweshbankwar
Copy link
Member

Fixes #4333
Design discussion issue #

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@vishweshbankwar vishweshbankwar marked this pull request as ready for review March 27, 2023 19:12
@vishweshbankwar vishweshbankwar requested a review from a team March 27, 2023 19:12
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear how the linked issue is addressed with this PR. The linked issue can be fixed by setting status on Activity (w/o using tags)

@vishweshbankwar vishweshbankwar changed the title Set Activity.Status and Activity.StatusDescription on calling SetStatus from API Set Activity.Status when adding SetErrorStatusOnException Mar 27, 2023
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add changelog

@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #4336 (3484019) into main (a274f06) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4336   +/-   ##
=======================================
  Coverage   84.72%   84.72%           
=======================================
  Files         298      298           
  Lines       11983    11984    +1     
=======================================
+ Hits        10152    10153    +1     
  Misses       1831     1831           
Impacted Files Coverage Δ
src/OpenTelemetry/Trace/ExceptionProcessor.cs 91.66% <100.00%> (+0.36%) ⬆️

... and 2 files with indirect coverage changes

@cijothomas cijothomas merged commit 6918866 into open-telemetry:main Mar 31, 2023
@@ -75,7 +75,11 @@ public override void OnEnd(Activity activity)

if (snapshot != pointers)
{
// TODO: Remove this when SetStatus is deprecated
activity.SetStatus(Status.Error);
Copy link
Member

@alanwest alanwest Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there's never a time we'd call this version of SetStatus and not also want to call the "real" version, right?

Here's another spot

We could kill two stones with one bird if we moved the call to activity.SetStatus(ActivityStatusCode) to our extension method. Though, from what I can tell I think that OpenTracing shim is the only other place... so maybe easier to just duplicate the call there as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanwest I was not aware of this one, will get it updated. what do you think about marking our extension method obsolete?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would support marking it obsolete.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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.

SetErrorStatusOnException doesn't set Activity.Status
4 participants