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

[receiver/otlp] Refactor http error handling #9893

Conversation

TylerHelmuth
Copy link
Member

@TylerHelmuth TylerHelmuth commented Apr 4, 2024

Description:
This PR slightly refactors the otlp receiver's HTTP error handling. The result is a few less calls to status.FromError, increased accuracy in the grpc code included in the body of the response, and centralizing http<->grpc mapping in the internal/errors package.

This PR intentionally changes how we map from HTTP status code to grpc Status.code. I don't consider this to be a breaking change, or even worthy of a changelog, since the specification states that "The clients are not expected to alter their behavior based on Status.code field but MAY record it for troubleshooting purposes." Honestly, I'd be ok if we chose to stop including the Status.code entirely as it leads to more confusion in the code and payload in my opinion.

Link to tracking Issue:
Closes #9864

Testing:
Added new tests

@TylerHelmuth TylerHelmuth requested review from a team and bogdandrutu April 4, 2024 19:19
@TylerHelmuth TylerHelmuth added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 4, 2024
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.34%. Comparing base (2ff9795) to head (ff62207).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9893      +/-   ##
==========================================
+ Coverage   91.32%   91.34%   +0.01%     
==========================================
  Files         357      357              
  Lines       19179    19196      +17     
==========================================
+ Hits        17516    17534      +18     
+ Misses       1335     1334       -1     
  Partials      328      328              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bogdandrutu bogdandrutu merged commit b8690b6 into open-telemetry:main Apr 4, 2024
50 of 66 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 4, 2024
@TylerHelmuth TylerHelmuth deleted the otlpreceiver-refactor-http-errors branch April 4, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/otlp] refactor receiver's error handling
2 participants