-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Always set otel.status_code #22115
Always set otel.status_code #22115
Conversation
@@ -61,9 +61,9 @@ public async Task ActivityIsCreatedForRequest() | |||
CollectionAssert.Contains(activity.Tags, new KeyValuePair<string, string>("http.user_agent", "agent")); | |||
CollectionAssert.Contains(activity.Tags, new KeyValuePair<string, string>("requestId", clientRequestId)); | |||
CollectionAssert.Contains(activity.Tags, new KeyValuePair<string, string>("serviceRequestId", "server request id")); | |||
CollectionAssert.Contains(activity.Tags, new KeyValuePair<string, string>("otel.status_code", "UNSET")); |
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.
Do we have a test that validates it being set to "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.
else | ||
{ | ||
// Set the status to UNSET so the AppInsights doesn't try to infer it from the status code | ||
activity.AddTag("otel.status_code", "UNSET"); |
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.
is otel.status_code
supported by appInsights SDK to populate success? It looks like only EventHub listener is aware of it
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.
the listener you linked (https://github.com/microsoft/ApplicationInsights-dotnet/blob/53a4422d01dbd068baaaeecc1ee9f2fb74fc82e9/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs) is used for all azure SDK activities including HTTP.
This change makes it so the later versions of AppInsights don't have to infer the http span success based on the HTTP status code.
ResponseClassifier implementations that Azure SDKs provide have more context and better logic so flow the information through.
The actual customer experience depends on microsoft/ApplicationInsights-dotnet#2200