-
Notifications
You must be signed in to change notification settings - Fork 759
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
[api] Mark SetStatus & GetStatus ActivityExtensions obsolete #5781
[api] Mark SetStatus & GetStatus ActivityExtensions obsolete #5781
Conversation
this.Activity?.SetStatus(value); | ||
#pragma warning disable | ||
this.Activity?.SetStatus((ActivityStatusCode)value.StatusCode); |
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.
not sure why we do this both ways?
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 is needed for backward compatibility. if we simply remove the older way, we might break code/libraries still relying on that.
@@ -62,8 +62,10 @@ public override void OnEnd(Activity activity) | |||
|
|||
if (snapshot != pointers) | |||
{ | |||
#pragma warning disable | |||
// TODO: Remove this when SetStatus is deprecated | |||
activity.SetStatus(Status.Error); |
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.
could this be moved to the new SetStatus API?
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 already has a new SetStatus. As @vishweshbankwar mentioned, we need both ways.
@ysolomchenko - Please take a look at test failures. |
#pragma warning disable | ||
// TODO: Remove this when SetStatus is deprecated | ||
childActivity.SetStatus(Status.Error); | ||
#pragma warning disable | ||
childActivity.SetStatus(ActivityStatusCode.Error); |
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 don't see where the status code is asserted in this test.
I see status description on line 397.
Just curious, if you call SetStatus
and provide two different codes, which would win first or last?
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.
There is a separate test for this:
Line 541 in 940d5b5
public void ToOtlpSpanActivityStatusTakesPrecedenceOverStatusTagsWhenActivityStatusCodeIsError() |
test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs
Outdated
Show resolved
Hide resolved
…github.com/ysolomchenko/opentelemetry-dotnet into mark-activityextensions.setstatus-obsolete
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5781 +/- ##
==========================================
+ Coverage 83.38% 86.35% +2.96%
==========================================
Files 297 256 -41
Lines 12531 11146 -1385
==========================================
- Hits 10449 9625 -824
+ Misses 2082 1521 -561
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
LGTM
Fixes #4755
Design discussion issue #4703
Changes
Mark SetStatus activity extensions method obsolete
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes