-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: Kafka Integration #3004
feat: Kafka Integration #3004
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3004 +/- ##
============================================
+ Coverage 72.74% 72.92% +0.18%
- Complexity 2750 2781 +31
============================================
Files 138 139 +1
Lines 15060 15177 +117
Branches 1026 1026
============================================
+ Hits 10955 11068 +113
- Misses 3546 3550 +4
Partials 559 559
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Benchmarks [ tracer ]Benchmark execution time: 2025-01-03 13:55:28 Comparing candidate commit 891fa03 in PR branch Found 2 performance improvements and 1 performance regressions! Performance is the same for 175 metrics, 0 unstable metrics. scenario:EmptyFileBench/benchEmptyFileBaseline
scenario:SamplingRuleMatchingBench/benchRegexMatching1-opcache
scenario:TraceFlushBench/benchFlushTrace
|
KafkaIntegration::addProducerSpanMetadata($span, $conf, $hook->args); | ||
|
||
$headers = \DDTrace\generate_distributed_tracing_headers(); | ||
$hook->args = $this->injectHeadersIntoArgs($hook->args, $headers); |
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.
q: Should we make this depend on DD_TRACE_KAFKA_DISTRIBUTED_TRACING
as well? There may be scenarios where injecting headers could mess something up on the other end. You could argue they can just disable the integration, but they may be interested in keeping it for some reason. Not a strong requirement at all, just to make things a little bit more configurable. Do other distributed tracing integrations (even in other tracers) allow for that?
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.
Do other distributed tracing integrations allow for that?
Two other integrations make use of a similar env var: Laravel Queue & Symfony Messenger. In both of them, this env var is only checked on the consuming end. However, your message reminded me that we should indeed check that distributed tracing is enabled on the producing end, and made the following commit.
Do other traces allow for that?
AFAIK, no. I'm not sure that other tracers leverage span links in their instrumentations.
Co-authored-by: Bob Weinand <[email protected]>
ace3f97
to
23448e4
Compare
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.
Nicely done, thanks Alexandre :-)
Co-authored-by: Bob Weinand <[email protected]>
Description
This integration's particularity lies in an internal function call substitution from
ProducerTopic::produce
toProducerTopic::producev
.This substitution is a trick to work around the missing
$headers
parameters when usingProducerTopic::produce
. Remember that this parameter injects distributed tracing headers.Moreover, the consumer span is started a posteriori - i.e., the start time of the consuming call is saved, and either a root span or child span is created depending on the retrieved headers from the message during the post hook. This is because not all consuming operation will receive a message with headers, and therefore, not all consuming operation ought to be a distributed span of its own.
Reviewer checklist