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

Add status code to OTLP grpc trace log #1792

Merged
merged 14 commits into from
Nov 25, 2022

Conversation

ThomsonTan
Copy link
Contributor

@ThomsonTan ThomsonTan commented Nov 22, 2022

The current OTLP grpc exporter logs status_message() on failure which is insufficient for some cases like if the grpc service is not implemented in the server endpoint, status_message() outputs an empty string. Adds status_code in string format to give more information to the log. Following table shows the comparison.

grpc failure message
Old message [OTLP TRACE GRPC Exporter] Export() failed with code:
New message [OTLP TRACE GRPC Exporter] Export() failed with code: "UNIMPLEMENTED" error_message: ""

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team November 22, 2022 20:10
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM

@marcalff
Copy link
Member

Rebased on main, to resolve CI build failures.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #1792 (7a0b947) into main (3f0eee6) will increase coverage by 0.08%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1792      +/-   ##
==========================================
+ Coverage   85.71%   85.79%   +0.08%     
==========================================
  Files         171      171              
  Lines        5240     5240              
==========================================
+ Hits         4491     4495       +4     
+ Misses        749      745       -4     
Impacted Files Coverage Δ
sdk/src/trace/batch_span_processor.cc 91.41% <0.00%> (+0.79%) ⬆️
ext/src/http/client/curl/http_client_curl.cc 81.44% <0.00%> (+1.14%) ⬆️

@ThomsonTan ThomsonTan merged commit b13e3e2 into open-telemetry:main Nov 25, 2022
@ThomsonTan ThomsonTan deleted the LogGrpcStatusCode branch November 25, 2022 07:08
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
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