Skip to content

feat: add C language binding#286

Open
adeshkumar1 wants to merge 2 commits intomainfrom
adeshkumar1/c-binding-on-main
Open

feat: add C language binding#286
adeshkumar1 wants to merge 2 commits intomainfrom
adeshkumar1/c-binding-on-main

Conversation

@adeshkumar1
Copy link

@adeshkumar1 adeshkumar1 commented Mar 3, 2026

Description

Add C language binding (ddog_trace_*) wrapping the C++ tracing library for integration from C-based projects.
Follows Datadog's ddog_ naming convention from libdatadog. Gated behind BUILD_C_BINDING=OFF.

Motivation

Enable C-based projects to use dd-trace-cpp without a C++ dependency at the call site.

Building and Testing

cmake -B build -DBUILD_C_BINDING=ON -DDD_TRACE_BUILD_TESTING=ON
cmake --build build -j
./build/binding/c/test_c_binding

@pr-commenter
Copy link

pr-commenter bot commented Mar 3, 2026

Benchmarks

Benchmark execution time: 2026-03-04 22:27:52

Comparing candidate commit 527d3e2 in PR branch adeshkumar1/c-binding-on-main with baseline commit f8c3913 in branch main.

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.76%. Comparing base (f8c3913) to head (527d3e2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #286   +/-   ##
=======================================
  Coverage   87.76%   87.76%           
=======================================
  Files          84       84           
  Lines        5658     5658           
=======================================
  Hits         4966     4966           
  Misses        692      692           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-official
Copy link

datadog-official bot commented Mar 3, 2026

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

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

@adeshkumar1 adeshkumar1 requested a review from dmehala March 3, 2026 17:42
@xlamorlette-datadog
Copy link
Collaborator

The instructions, given in the PR description, to build and test work but they create files everywhere.
Rather use the build directory, as in https://github.com/DataDog/dd-trace-cpp/blob/main/README.md#building.
So, that would be:

cmake -B build -DBUILD_C_BINDING=ON -DDD_TRACE_BUILD_TESTING=ON .
cmake --build build -j
./build/binding/c/test_c_binding

Please add these instructions in a new readme file in the C binding directory.

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.

4 participants