Reinstate the TracerContext constructor for single processor#814
Reinstate the TracerContext constructor for single processor#814maxgolov wants to merge 1 commit into
Conversation
Add TracerContext constructor for single processor
Codecov Report
@@ Coverage Diff @@
## main #814 +/- ##
==========================================
- Coverage 96.19% 95.15% -1.03%
==========================================
Files 153 173 +20
Lines 6444 8449 +2005
==========================================
+ Hits 6198 8039 +1841
- Misses 246 410 +164
|
We can recommend customers to use the |
lalitb
left a comment
There was a problem hiding this comment.
This will fail TracerContext::AddProcessor as mentioned in comments.
@lalitb - can you elaborate on a meaning of |
auto processor1 = std::unique_ptr<SpanProcessor>(new SimpleSpanProcessor(std::move(exporter1)));
auto context = std::make_shared<TracerContext>(std::move(processor1));
auto processor2 = std::unique_ptr<SpanProcessor>(new SimpleSpanProcessor(std::move(exporter2)));
context->AddProcessor(std::move(processor2)); |
|
I don't think it fails if you invoke the constructor intended to be used for multi-processor scenario. Also assuming that if customer used the first constructor (single-processor), they are not going to attempt to call |
I don't see |
|
incorrectly closed by bot. |
|
Closing. The changes are not correct as discussed in the review comments. |
Changes
Recent refactor removed the constructor for single processor, assuming that there is always a vector of processors #692 . However, the most common trivial scenario is when a customer provides a single processor rather than a vector of them. The intent of this change is to reinstate the previous constructor that got (inadvertently?) removed, keeping the simpler constructor in place where it was before.
No significant changes. Just reinstating what was accidentally removed.
Since the constructor is rather trivial (empty), implementation is included inline in the header, not added to separate .cc file. I do not have objection if there is an ask to move the empty body into separate compilation unit. But it seems okay to me as-is.