opentelemetry-go-contrib
opentelemetry-go-contrib copied to clipboard
otelsarama: Add WithAllowRootSpanStart option
This will allow the parent app to control whether a span will be created based on whether the message contains injected context.
The default is 'true' which will preserve the original behavior.
@kweitb Generally the code looks OK but I am not sure it would not be better to use Sampler which filter's out span's without a parent. Have you checked Sampler interface and existing samplers?
Codecov Report
Merging #770 (0c1c8de) into main (13d72c9) will increase coverage by
0.0%. The diff coverage is95.0%.
@@ Coverage Diff @@
## main #770 +/- ##
=====================================
Coverage 78.4% 78.4%
=====================================
Files 62 62
Lines 2737 2747 +10
=====================================
+ Hits 2146 2156 +10
Misses 456 456
Partials 135 135
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...n/github.com/Shopify/sarama/otelsarama/producer.go | 95.2% <93.3%> (+0.3%) |
:arrow_up: |
| ...ion/github.com/Shopify/sarama/otelsarama/option.go | 100.0% <100.0%> (ø) |
@kweitb Generally the code looks OK but I am not sure it would not be better to use
Samplerwhich filter's out span's without a parent. Have you checkedSamplerinterface and existing samplers?
That sounds promising but it's not clear to me how to do this.
@keitwb Do you still want/need this? Are you planning to update the PR? Should the PR be closed?
otelsarama is deprecated. I am closing this PR. More info: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4091