-
Notifications
You must be signed in to change notification settings - Fork 773
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
[Part0] Support Activity Status and status description in Console Exporter. #3061
[Part0] Support Activity Status and status description in Console Exporter. #3061
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3061 +/- ##
=======================================
Coverage 84.70% 84.70%
=======================================
Files 259 259
Lines 9119 9119
=======================================
Hits 7724 7724
Misses 1395 1395 |
…ing/opentelemetry-dotnet into yunl/ActivityStatusConsole
{ | ||
this.WriteLine($" StatusCode : {statusCode}"); | ||
this.WriteLine($"Error : {activity.StatusDescription}"); |
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.
Remove "Error". Just Status Description is good enough here.
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.
Maybe something like:
this.WriteLine($"Status Description : {activity.StatusDescription}");
?
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
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 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.
nit comment. may be addressed separate
Related to #2569.
Changes
Added support to to set status with Activity.Status, which was introduced in
System.Diagnostic.DiagnosticSource 6.0.0
to ConsoleExporter.The same idea will be applied to other exporters.
Case 1:
Setting activity status to be OK.
activity.SetStatus(ActivityStatusCode.Ok);
Output:
StatusCode : OK
Case 2:
Setting activity status to be ERROR with description.
activity.SetStatus(ActivityStatusCode.Error, "desc");
Output:
Case 3:
Setting activity tag to be OK.
activity.SetTag("otel.status_code", "OK");
Output:
Case 4:
Setting activity tag to be ERROR with description.
Output:
Case 5:
Activity status take precedence over activity tag when both were set.
Output:
Case 6:
Activity status take precedence over activity tag when both were set.
Output:
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes