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

[opentelemetry-otlp][tonic] Add more information to error message for Unknown status code #1931

Merged

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Jul 12, 2024

Related to #1923

Changes

Currently, when the OTLP Exporter receives an Unknown code from tonic, the error message isn't helpful. I ran into this issue when I ran the basic-otlp example with the collector container not running on the host machine network. Here is the error message:

OpenTelemetry trace error occurred. Exporter otlp encountered the following error(s): the grpc server returns error (Unknown error): , detailed error message: transport error
Error: Other("[ExportErr(Status { code: Unknown, message: \", detailed error message: transport error\" })]")

I have updated the conversion logic for tonic::Status to Error to add information about the source of the error when we receive an Unkown error. The error message now captures the connection reset issue:

OpenTelemetry trace error occurred. Exporter otlp encountered the following error(s): the grpc server returns error (Unknown error): , detailed error message: transport error tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }))
Error: Other("[ExportErr(Status { code: Unknown, message: \", detailed error message: transport error tonic::transport::Error(Transport, hyper::Error(Io, Kind(ConnectionReset)))\" })]")

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@utpilla utpilla requested a review from a team July 12, 2024 18:18
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 74.9%. Comparing base (597327f) to head (801edfa).

Files Patch % Lines
opentelemetry-otlp/src/lib.rs 0.0% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1931     +/-   ##
=======================================
- Coverage   75.0%   74.9%   -0.1%     
=======================================
  Files        122     122             
  Lines      20290   20298      +8     
=======================================
- Hits       15222   15221      -1     
- Misses      5068    5077      +9     

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

@lalitb lalitb merged commit a2e435f into open-telemetry:main Jul 12, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants