Skip to content

Comments

[IGNORE] Community PR 5120#5193

Closed
vpellan wants to merge 7 commits intomasterfrom
community/pr-5120
Closed

[IGNORE] Community PR 5120#5193
vpellan wants to merge 7 commits intomasterfrom
community/pr-5120

Conversation

@vpellan
Copy link
Contributor

@vpellan vpellan commented Jan 5, 2026

⚠️ DO NOT MERGE ⚠️

Drowze and others added 3 commits December 8, 2025 14:44
By the time that `Karafka::App#initialized!` is called,
`Karafka.producer` was already initialized.

On top of that, there's really nowhere we can hook in the Karafka
initialization where we can be sure that `Karafka.producer` wasn't yet
initiaized - that's because the Karafka initialization is NOT
necessarily tied to the WaterDrop initialization. For instance, the
following is a possible scenario:

```
$producer = WaterDrop::Producer.new { ... }

Datadog.configure do |c|
  c.tracing.instrument :karafka
end

 # note that the producer was initialized before the Karafka app (and in
 # this case, even before datadog was configured)
Karafka::App.setup do |c|
  c.producer = $producer
end
```

So instead of trying to hook somewhere before `Karafka.producer` is
initialized, let's simply listen to a Karafka after-initialization event
and append our middleware to the producer when that event is triggered.
@vpellan vpellan requested review from a team as code owners January 5, 2026 10:38
@vpellan vpellan requested a review from mabdinur January 5, 2026 10:38
@vpellan vpellan marked this pull request as draft January 5, 2026 10:38
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Jan 5, 2026
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-01-05 10:38:29 UTC

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 5, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 95.20% (+0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ba4f861 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Jan 5, 2026

Benchmarks

Benchmark execution time: 2026-01-07 10:17:54

Comparing candidate commit ba4f861 in PR branch community/pr-5120 with baseline commit ae7f953 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 1 partially typed method. It decreases the percentage of typed methods from 56.93% to 56.9% (-0.03%).

Partially typed methods (+1-0)Introduced:
sig/datadog/tracing/contrib/waterdrop/patcher.rbs:14
└── def add_middleware: (untyped producer) -> void

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept to the end of the line to remove it from the stats.

@vpellan vpellan closed this Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants