Skip to content
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

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Jun 23, 2021

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

@pakrym pakrym requested a review from lmolkova June 23, 2021 21:05
@ghost ghost added the Azure.Core label Jun 23, 2021
@pakrym pakrym requested a review from christothes June 23, 2021 21:07
@@ -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"));
Copy link
Member

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"?

Copy link
Contributor Author

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");
Copy link
Member

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

Copy link
Contributor Author

@pakrym pakrym Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pakrym pakrym merged commit be4174d into Azure:main Jun 23, 2021
@pakrym pakrym deleted the pakrym/Always-set-otel-status_code branch June 23, 2021 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants