Skip to content

[PROTO] Trace exporter prototype (vibed)#5422

Draft
lloeki wants to merge 2 commits intomasterfrom
lloeki/trace-exporter
Draft

[PROTO] Trace exporter prototype (vibed)#5422
lloeki wants to merge 2 commits intomasterfrom
lloeki/trace-exporter

Conversation

@lloeki
Copy link
Copy Markdown
Member

@lloeki lloeki commented Mar 5, 2026

What does this PR do?

Add:

  • a trace exporter C API
  • a transport based on this trace exporter
  • some wonky test suite

Motivation:

Getting the ball rolling on discussion with actual code

Change log entry

None

Additional Notes:

DO NOT MERGE

How to test the change?

Locally:

  • clone both repos side by side
  • libdatadog/ruby: run rake compile
  • dd-trace-rb: append gem 'libdatadog', path: '../libdatadog/ruby' to ruby-X.Y.gemfile
  • dd-trace-rb: run bash compile_and_test.sh

See DataDog/libdatadog#1661

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Mar 5, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 7 Tests failed

gem release process datadog.gemspec files includes all important files from rspec   View in Datadog   (Fix with Cursor)
Failure/Error:
  expect(gemspec.files)
    .to match_array(
      \`git ls-files -z\`
        .split("\x0")
        .reject { |f| f.match(directories_excluded) }
        .reject { |f| f.match(single_files_excluded) }
    )

  the missing elements were:      ["compile_and_test.sh"]
...
Kafka Data Streams instrumentation checkpointing automatically processes pathway context when consuming messages from rspec   View in Datadog   (Fix with Cursor)
Libdatadog does not seem to be available: cannot load such file -- libdatadog_api.4.0_x86_64-linux. Try running \`bundle exec rake 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 compile\` before running this test."

RuntimeError:
  Libdatadog does not seem to be available: cannot load such file -- libdatadog_api.4.0_x86_64-linux. Try running \`bundle exec rake compile\` before running this test.
./spec/support/core_helpers.rb:83:in 'CoreHelpers#skip_if_libdatadog_not_supported'
./spec/datadog/tracing/contrib/kafka/data_streams_spec.rb:78:in 'block (3 levels) in <top (required)>'
...
Kafka Data Streams instrumentation pathway context automatically injects pathway context when producing messages from rspec   View in Datadog   (Fix with Cursor)
Libdatadog does not seem to be available: cannot load such file -- libdatadog_api.4.0_x86_64-linux. Try running \`bundle exec rake 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 compile\` before running this test."

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

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dac05cf | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Comment thread ext/libdatadog_api/trace_exporter.c
Comment thread ext/libdatadog_api/trace_exporter.c Outdated
Comment thread ext/libdatadog_api/trace_exporter.c Outdated
Comment thread ext/libdatadog_api/trace_exporter.c
end

# Minimal stats tracker matching the interface used by Writer#stats.
class Stats
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are stats getting incremented anywhere?

Comment thread ext/libdatadog_api/trace_exporter.c Outdated
Comment thread ext/libdatadog_api/trace_exporter.c Outdated
Comment thread compile_and_test.sh
@@ -0,0 +1,317 @@
#!/usr/bin/env bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this get automatically run with the test suite on this PR? Would this eventually become a Rakefile? Or is your intention to keep it a bash script?

Copy link
Copy Markdown
Member Author

@lloeki lloeki Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a helper script for quick iteration.

I certainly don't aim it to be merged (at least not as is).

If it needs to be kept it should be turned into rake tasks.

Ideally I'd like the workflow to be able to evolve and dd-trace-rb's rake compile to properly rebuild without shenanigans (the current rake compile has trouble with stale files and such)

Or even better: the ext folder could move to libdatadog-rb and dd-trace-rb be free of C extensions? That would allow libdatadog-rb to compile and build end-to-end, possibly maximising LTO savings.

Probably not for this task though.

Comment thread ext/libdatadog_api/trace_exporter.c Outdated
@lloeki lloeki force-pushed the lloeki/trace-exporter branch from cc14971 to dac05cf Compare March 25, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants