-
Notifications
You must be signed in to change notification settings - Fork 765
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
Status Improvements #1579
Status Improvements #1579
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1579 +/- ##
==========================================
+ Coverage 80.68% 80.74% +0.05%
==========================================
Files 241 242 +1
Lines 6525 6544 +19
==========================================
+ Hits 5265 5284 +19
Misses 1260 1260
|
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.
For anyone curious, I did benchmark switch statement vs dictionary lookup for the conversions to/from StatusCode/string. The lower you are in the switch, the slower the perf. But with the 3/4 cases, it's always faster than the dictionary.
|
@CodeBlanch I guess the string comparison call might be the biggest contributor to the switch perf. [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int? GetStatusCodeForStringName(string statusCodeName)
{
return statusCodeName switch
{
"Unset" => 0,
"Error" => 2,
"Ok" => 1,
_ => null,
};
} would translate to:
|
So if the goal is to get the maximum performance, we can potentially look at the following steps:
|
Thanks @reyang I'll see what I can do to squeeze a bit more perf out of it. |
Fixes #1571.
Change: Fix StatusCode being sent as integer
I noticed this helping someone out on Gitter:
The Status spec defines the string names and doesn't mention the numeric values.
New version looks like this:
Note: We will continue to send a Description (otel.status_description) for http spans if an exception is thrown.
Change: JaegerExporter will now set error flag
Jaeger spec actually has a way to indicate that a span errored out. With the previous
Status
spec, it was really hard to know what was an error, so we didn't set the flag. But now we have a dedicatedError
status so we can turn this on:Change: ZipkinExporter will now set error flag
Zipkin spec actually has a way to indicate that a span errored out. With the previous
Status
spec, it was really hard to know what was an error, so we didn't set the flag. But now we have a dedicatedError
status so we can turn this on:TODOs
CHANGELOG.md
updated for non-trivial changes