-
Notifications
You must be signed in to change notification settings - Fork 440
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
Populate resource to OTLP proto data #758
Populate resource to OTLP proto data #758
Conversation
Codecov Report
@@ Coverage Diff @@
## main #758 +/- ##
==========================================
+ Coverage 95.94% 95.95% +0.01%
==========================================
Files 174 174
Lines 7127 7127
==========================================
+ Hits 6838 6839 +1
+ Misses 289 288 -1
|
exporters/otlp/src/otlp_exporter.cc
Outdated
|
||
rec->PopulateProtoResource(proto_resource.get()); | ||
|
||
resource_span->set_allocated_resource(proto_resource.release()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - Just wondering if line 35 - 40 can be replaced with single line:
resource_span->mutable_resource() = rec->ProtoResource();
using older implementation of ProtoResource
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose set_allocated_resource
which could avoid allocate the Resource
twice or more, but yes, it look simpler with mutable_resource
. Updated the PR to the older implementation of ProtoResource
as this optimization may not deserve the extra complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the support. Looks good, perhaps we can add unit tests for the resources too.
Added unit resource test to OTLP recordable test case. We may need more tests if we'd like to validate the OTLP exported result. |
Fixes #757
Changes
Populate resource to OTLP proto data and also update the readme for OTLP receiver with easier instructions to run and test it end-to-end with docker.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes