Skip to content

[IGNORE] PR 5962#5977

Draft
vpellan wants to merge 8 commits into
masterfrom
community/pr-5962
Draft

[IGNORE] PR 5962#5977
vpellan wants to merge 8 commits into
masterfrom
community/pr-5962

Conversation

@vpellan

@vpellan vpellan commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ DO NOT MERGE ⚠️

dasch added 4 commits June 29, 2026 16:24
Instrument Racecar consumers and producers for Data Streams Monitoring.

Consume checkpoints are set from the existing ActiveSupport notification
events: single-message consume extracts the upstream pathway context from
the message headers carried in the event payload, while batch consume sets
a topic-level checkpoint (the batch payload carries no per-message headers).
Both also track the consumed offset for consumer lag.

Produce checkpoints are injected by prepending instrumentation onto
Racecar::Consumer#produce and the standalone Racecar::Producer, mirroring
the ruby-kafka integration.
Move consume-side DSM from the ActiveSupport event handlers to a prepend
on Racecar::Runner#process and #process_batch, where the individual rdkafka
messages and their headers are available.

This lets batch consumption set a checkpoint per message rather than a
single topic-level checkpoint, so each message keeps its own upstream
pathway context. Pipelines that merge multiple input sources into one
processing step (N:M topology) are now represented as distinct fan-in
edges in Data Streams Monitoring.
Match stringified header keys instead of converting the lookup key to a
symbol, so the lookup does not depend on symbol garbage collection.
Racecar 1.x consumes through Kafka::Consumer#each_message/#each_batch
(ruby-kafka) rather than Runner#process, so the Runner prepend records
nothing there. Gate the Runner prepend on the rdkafka-based runner and
fall back to the kafka integration's consumer instrumentation on older,
ruby-kafka-based versions.
@dd-octo-sts

dd-octo-sts Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

👋 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-07-01 14:08:14 UTC

@dd-octo-sts dd-octo-sts Bot added integrations Involves tracing integrations tracing labels Jul 1, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 3 partially typed methods. It increases the percentage of typed methods from 65.59% to 65.68% (+0.09%).

Partially typed methods (+3-0)Introduced:
sig/datadog/tracing/contrib/racecar/instrumentation/producer.rbs:15
└── def produce: (untyped payload, topic: ::String, ?headers: Producer::headers?, **untyped kwargs) -> untyped
sig/datadog/tracing/contrib/racecar/instrumentation/producer.rbs:23
└── def produce_async: (value: untyped, topic: ::String, **untyped options) -> untyped
sig/datadog/tracing/contrib/racecar/instrumentation/producer.rbs:25
└── def produce_sync: (value: untyped, topic: ::String, **untyped options) -> untyped

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

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 1, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Check Pull Request CI Status | all-jobs-are-green   View in Datadog   GitHub Actions

❄️ 15 New flaky tests detected

Racecar Data Streams instrumentation consuming a batch extracts each message's own upstream pathway context from rspec   View in Datadog
Libdatadog does not seem to be available: LoadError: cannot load such file -- libdatadog_api.3.4_x86_64-linux. Try running \`bundle exec rake clean compile\` before running this test.

Failure/Error:
  raise "Libdatadog does not seem to be available: #{Datadog::Core::LIBDATADOG_API_FAILURE}. "     "Try running \`bundle exec rake clean compile\` before running this test."

RuntimeError:
  Libdatadog does not seem to be available: LoadError: cannot load such file -- libdatadog_api.3.4_x86_64-linux. Try running \`bundle exec rake clean compile\` before running this test.
./spec/support/core_helpers.rb:83:in 'CoreHelpers#skip_if_libdatadog_not_supported'
./spec/datadog/tracing/contrib/racecar/data_streams_spec.rb:172:in 'block (3 levels) in <top (required)>'
./spec/datadog/tracing/contrib/racecar/data_streams_spec.rb:46:in 'block (2 levels) in <top (required)>'
...

New test introduced in this PR is flaky.

Racecar Data Streams instrumentation consuming a batch sets a consume checkpoint per message, preserving each source from rspec   View in Datadog
Libdatadog does not seem to be available: LoadError: cannot load such file -- libdatadog_api.3.4_x86_64-linux. Try running \`bundle exec rake clean compile\` before running this test.

Failure/Error:
  raise "Libdatadog does not seem to be available: #{Datadog::Core::LIBDATADOG_API_FAILURE}. "     "Try running \`bundle exec rake clean compile\` before running this test."

RuntimeError:
  Libdatadog does not seem to be available: LoadError: cannot load such file -- libdatadog_api.3.4_x86_64-linux. Try running \`bundle exec rake clean compile\` before running this test.
./spec/support/core_helpers.rb:83:in 'CoreHelpers#skip_if_libdatadog_not_supported'
./spec/datadog/tracing/contrib/racecar/data_streams_spec.rb:172:in 'block (3 levels) in <top (required)>'
./spec/datadog/tracing/contrib/racecar/data_streams_spec.rb:46:in 'block (2 levels) in <top (required)>'
...

New test introduced in this PR is flaky.

View in Flaky Test Management

ℹ️ Info

No other issues found (see more)

🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 98.96%
Overall Coverage: 90.10% (+0.08%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 440d305 | Docs | Datadog PR Page | Give us feedback!

vpellan and others added 4 commits July 1, 2026 16:44
Replace untyped signatures for the racecar instrumentation with concrete
types, and split the DSM specs into consumer_spec.rb and producer_spec.rb
to mirror the lib layout.
The method returns its headers argument unchanged when DSM is disabled,
so the declared return type must be nilable.
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