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
|
|
|
||
| rec->PopulateProtoResource(proto_resource.get()); | ||
|
|
||
| resource_span->set_allocated_resource(proto_resource.release()); |
There was a problem hiding this comment.
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.
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.
lalitb
left a comment
There was a problem hiding this comment.
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.mdupdated for non-trivial changes