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

[Http Metrics] Replace http.error.reason with OTel standard error.type #91909

Closed
antonfirsov opened this issue Sep 12, 2023 · 3 comments · Fixed by #91910
Closed

[Http Metrics] Replace http.error.reason with OTel standard error.type #91909

antonfirsov opened this issue Sep 12, 2023 · 3 comments · Fixed by #91910
Assignees
Milestone

Comments

@antonfirsov
Copy link
Member

antonfirsov commented Sep 12, 2023

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 and 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.

@antonfirsov antonfirsov added this to the 8.0.0 milestone Sep 12, 2023
@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

The http.error.reason attribute implemented in #89809 has been standardized as error.type with minor changes to its' semantics in
open-telemetry/semantic-conventions#205. To avoid a breaking change or the introduction of a noisy secondary attribute in future releases, we should consider adapting the standard attribute naming and semantics in 8.0.

This means that:

  • We should rename http.error.reason to error.type
  • Currently error.type is reported only in cases when the underlying handler fails to fetch a response. With the new spec we should also report error.type when there is a valid response and the response status code indicates an error. In this case error.type should be the string representation of the status code.

See error.type in the spec for more details.

Author: antonfirsov
Assignees: -
Labels:

area-System.Net.Http

Milestone: 8.0.0

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 12, 2023
@karelz karelz added the bug label Sep 12, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 13, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 13, 2023
@karelz
Copy link
Member

karelz commented Sep 13, 2023

Reopening to track backport to 8.0

@karelz karelz reopened this Sep 13, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 14, 2023
@karelz
Copy link
Member

karelz commented Sep 15, 2023

Fixed in main (9.0) in PR #91910 and in 8.0 (RC2) in PR #91996

@karelz karelz closed this as completed Sep 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants