Status Improvements - #1579
Merged
cijothomas merged 10 commits intoNov 18, 2020
Merged
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
|
Member
Author
|
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.
|
cijothomas
reviewed
Nov 18, 2020
cijothomas
approved these changes
Nov 18, 2020
Member
|
@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: |
cijothomas
approved these changes
Nov 18, 2020
Member
|
So if the goal is to get the maximum performance, we can potentially look at the following steps:
|
Member
Author
|
Thanks @reyang I'll see what I can do to squeeze a bit more perf out of it. |
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Statusspec, it was really hard to know what was an error, so we didn't set the flag. But now we have a dedicatedErrorstatus 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
Statusspec, it was really hard to know what was an error, so we didn't set the flag. But now we have a dedicatedErrorstatus so we can turn this on:TODOs
CHANGELOG.mdupdated for non-trivial changes