Skip to content

Improve native trace exporter#5817

Open
lloeki wants to merge 3 commits into
lloeki/native-trace-exporterfrom
lloeki/native-trace-exporter-improved
Open

Improve native trace exporter#5817
lloeki wants to merge 3 commits into
lloeki/native-trace-exporterfrom
lloeki/native-trace-exporter-improved

Conversation

@lloeki
Copy link
Copy Markdown
Member

@lloeki lloeki commented May 27, 2026

What does this PR do?

Motivation:

Change log entry

Additional Notes:

How to test the change?

@lloeki lloeki changed the base branch from master to lloeki/native-trace-exporter May 27, 2026 13:55
@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented May 27, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 16 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-rb | install-dependencies: [2.6, amd64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Compilation error in trace_exporter.c:15:1: unknown type name 'ddog_TracerSpan'.

DataDog/apm-reliability/dd-trace-rb | install-dependencies: [2.6, arm64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Compilation error in trace_exporter.c:15:1: unknown type name ‘ddog_TracerSpan’

DataDog/apm-reliability/dd-trace-rb | install-dependencies: [2.7, amd64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Compilation error in trace_exporter.c:15:1: unknown type name ‘ddog_TracerSpan’

View all 16 failed jobs.

Useful? React with 👍 / 👎

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

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 27, 2026

👋 Hey @lloeki, 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-05-27 13:55:53 UTC

lloeki added 2 commits May 28, 2026 13:36
Switch from `ddog_TraceExporterError *` to `ddog_MaybeError` for all
tracer construction functions (`span_new`, `set_meta`, `set_metric`,
`trace_chunks_new`, `begin_chunk`, `push_span`). Use the existing
`read_ddogerr_string_and_drop` helper via a new `check_maybe_error`
inline function.

`send_trace_chunks` retains `ddog_TraceExporterError` because callers
need the error code for HTTP response classification.
Replace the separate `*const uint8_t` return + `out_len` out-parameter
with a single `ddog_ByteSlice` struct, matching the updated
libdatadog FFI signature.
@lloeki lloeki force-pushed the lloeki/native-trace-exporter branch from d5fa393 to bd141e3 Compare May 28, 2026 11:51
@lloeki lloeki force-pushed the lloeki/native-trace-exporter-improved branch from b49856e to 2b00aa3 Compare May 28, 2026 11:51
The tracer construction functions return `ddog_TraceExporterError *`
again, matching the libdatadog FFI. Restore `check_exporter_error`
usage at the call sites and drop the `ddog_MaybeError`-based handling.

This reverts the consumer-side `ddog_MaybeError` adaptation: the
structured `ExporterError` type with error codes is retained upstream
instead.
@lloeki lloeki marked this pull request as ready for review May 29, 2026 12:16
@lloeki lloeki requested review from a team as code owners May 29, 2026 12:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf8ee694ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +629 to +630
ddog_ByteSlice body =
ddog_trace_exporter_response_get_body(args.response);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep get_body call compatible with libdatadog 33

With the current datadog.gemspec dependency on libdatadog ~> 33.0.0.1.0, the vendored data-pipeline.h still declares ddog_trace_exporter_response_get_body(const ddog_TraceExporterResponse *, uintptr_t *out_len) returning const uint8_t *; it does not return ddog_ByteSlice or accept a single argument. Any install that builds ext/libdatadog_api against the declared dependency will fail to compile here, so this needs either the old two-argument call or a matching libdatadog dependency/header update.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant