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

Replace http.error.reason with OTel standard error.type #91910

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

antonfirsov
Copy link
Member

@antonfirsov antonfirsov commented Sep 12, 2023

Fixes #91909

Align attribute name and semantics with the OpenTelemetry spec (which was finalized yesterday 2023/9/11 - see open-telemetry/semantic-conventions#205) -- http.error.reason attribute has been standardized under name error.type. We need to:

  • Rename http.error.reason to error.type.
  • Report error.type also for valid responses where the HTTP status code indicates an error (4xx or 5xx) -- in such case, the value should be the string representation of the HTTP status code.
    • Note: Currently we report http.error.reason only when the underlying handler fails to fetch a response.

See error.type in the spec for more details.

For context: We introduced the attribute http.error.reason in PR #89809 (on 2023/8/3) based on the in-progress draft of the OTel spec (open-telemetry/semantic-conventions#205).

Given that this is new 8.0 feature, we should adapt to the spec in 8.0 to avoid breaking changes with 9.0.

@ghost
Copy link

ghost commented Sep 12, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Address #91909. This PR should be only merged if we its' 8.0 servicing counterpart will be also approved, which I plan to open soon.

Author: antonfirsov
Assignees: antonfirsov
Labels:

area-System.Net.Http

Milestone: -

@antonfirsov antonfirsov changed the title Implement standard semantics for the request.duration error tag Replace http.error.reason with OTel standard error.type Sep 12, 2023
@danmoseley
Copy link
Member

Is there any similar change needed in Kestrel @JamesNK

@JamesNK
Copy link
Member

JamesNK commented Sep 12, 2023

No aspnetcore changes are required. This attribute is for HTTP clients only.

@danmoseley
Copy link
Member

Ok. Yes sounds like we should definitely get into 8.0 as suggested

@karelz karelz added this to the 9.0.0 milestone Sep 12, 2023
@karelz
Copy link
Member

karelz commented Sep 12, 2023

Let's get this into 9.0 first, then we can immediately create backport to 8.0. IMO it should not have a problem to get in.

@artl93 heads up. If you have concerns, please let us know ASAP.

@karelz
Copy link
Member

karelz commented Sep 12, 2023

@MihaZupan @noahfalk can you please code review, so that we can initiate the backport?
Thanks!

Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

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

Looks good, thank you

Copy link

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

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

:shipit:

@antonfirsov
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

Looks great 👍

@antonfirsov
Copy link
Member Author

CI failures are #90639, #91910 + many unrelated failures in runtime-extra-platforms.

@antonfirsov antonfirsov merged commit 9695621 into dotnet:main Sep 13, 2023
156 of 176 checks passed
@antonfirsov
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6172076292

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Http Metrics] Replace http.error.reason with OTel standard error.type
8 participants