Skip to content

Use native rust spans instead of manually serializing to msgpack #3194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 29, 2025

Conversation

Leiyks
Copy link
Contributor

@Leiyks Leiyks commented Apr 8, 2025

Description

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch from f4bc20f to c62e164 Compare April 8, 2025 16:17
@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.92%. Comparing base (91222ad) to head (52b50d3).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3194   +/-   ##
=======================================
  Coverage   61.92%   61.92%           
=======================================
  Files         140      140           
  Lines       12356    12356           
  Branches     1616     1616           
=======================================
  Hits         7651     7651           
  Misses       3995     3995           
  Partials      710      710           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91222ad...52b50d3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link

pr-commenter bot commented Apr 9, 2025

Benchmarks [ tracer ]

Benchmark execution time: 2025-07-28 21:40:06

Comparing candidate commit 52b50d3 in PR branch leiyks-use-rust-span-in-tracer with baseline commit 91222ad in branch master.

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

scenario:PDOBench/benchPDOBaseline

  • 🟩 execution_time [-3.793µs; -1.479µs] or [-5.947%; -2.319%]

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+1.661µs; +3.977µs] or [+2.723%; +6.519%]

scenario:PDOBench/benchPDOOverhead

  • 🟥 execution_time [+142.987µs; +152.043µs] or [+28.760%; +30.581%]

scenario:PDOBench/benchPDOOverhead-opcache

  • 🟥 execution_time [+154.131µs; +159.662µs] or [+31.389%; +32.515%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟥 execution_time [+145.615µs; +151.795µs] or [+29.256%; +30.498%]

scenario:PDOBench/benchPDOOverheadWithDBM-opcache

  • 🟥 execution_time [+148.482µs; +155.418µs] or [+30.068%; +31.473%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+663.305µs; +709.164µs] or [+30.404%; +32.506%]

scenario:PHPRedisBench/benchRedisOverhead-opcache

  • 🟥 execution_time [+702.262µs; +745.826µs] or [+31.738%; +33.707%]

scenario:SpanBench/benchDatadogAPI

  • 🟥 execution_time [+172.476µs; +176.901µs] or [+132.106%; +135.496%]

scenario:SpanBench/benchDatadogAPI-opcache

  • 🟥 execution_time [+174.742µs; +176.244µs] or [+134.969%; +136.129%]

scenario:SpanBench/benchOpenTelemetryAPI

  • 🟥 execution_time [+873.667µs; +892.506µs] or [+80.637%; +82.376%]

scenario:SpanBench/benchOpenTelemetryAPI-opcache

  • 🟥 execution_time [+861.233µs; +874.786µs] or [+83.928%; +85.249%]

scenario:SpanBench/benchOpenTelemetryInteroperability

  • 🟥 execution_time [+179.454µs; +182.405µs] or [+68.047%; +69.166%]

scenario:SpanBench/benchOpenTelemetryInteroperability-opcache

  • 🟥 execution_time [+182.098µs; +186.368µs] or [+74.433%; +76.179%]

scenario:TraceFlushBench/benchFlushTrace

  • 🟥 execution_time [+1.070ms; +1.120ms] or [+14.615%; +15.307%]
  • 🟩 mem_peak [-191.984KB; -191.984KB] or [-4.621%; -4.621%]

scenario:TraceFlushBench/benchFlushTrace-opcache

  • 🟥 execution_time [+1.196ms; +1.246ms] or [+16.416%; +17.109%]

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟥 execution_time [+1.075ms; +1.094ms] or [+425.257%; +432.654%]
  • 🟩 mem_peak [-92.128KB; -92.128KB] or [-2.220%; -2.220%]

@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch from 2c37585 to 22111fc Compare April 14, 2025 15:50
@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch 3 times, most recently from 0b2c6a2 to 674b060 Compare April 18, 2025 16:09
@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch from a143161 to 4f3f47a Compare April 22, 2025 16:44
@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch 2 times, most recently from 7fedf9e to 587ec86 Compare April 22, 2025 17:43
Leiyks and others added 10 commits June 18, 2025 17:53
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
…Slice

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@Leiyks Leiyks force-pushed the leiyks-use-rust-span-in-tracer branch from 4f62615 to 2b76f8f Compare June 18, 2025 16:25
@bwoebi bwoebi force-pushed the leiyks-use-rust-span-in-tracer branch 3 times, most recently from a41a132 to 87b4804 Compare July 25, 2025 14:54
bwoebi added 2 commits July 25, 2025 19:55
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the leiyks-use-rust-span-in-tracer branch from 87b4804 to c3c9b98 Compare July 25, 2025 18:02
@bwoebi bwoebi changed the title feat(component-rs): add data-pipeline header Use native rust spans instead of manually serializing to msgpack Jul 28, 2025
@bwoebi bwoebi marked this pull request as ready for review July 28, 2025 20:23
@bwoebi bwoebi requested review from a team as code owners July 28, 2025 20:23
@bwoebi bwoebi force-pushed the leiyks-use-rust-span-in-tracer branch from d329dcf to 52b50d3 Compare July 28, 2025 21:07
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Finally this gets merged :-)

@bwoebi bwoebi merged commit ed128c8 into master Jul 29, 2025
1839 of 1879 checks passed
@bwoebi bwoebi deleted the leiyks-use-rust-span-in-tracer branch July 29, 2025 00:20
@github-actions github-actions bot added this to the 1.11.0 milestone Jul 29, 2025
sydney-tung pushed a commit that referenced this pull request Jul 30, 2025
* feat(component-rs): add data-pipeline header

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* Fix missing use

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

* Update libdatadog

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

* feat(tracer): use rust span API

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: bump libdatadog

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat(tracer: serializer): complete replacement of rust span API in serialization method

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat(ext: tracer): add local API to use zendString instead of CharSlice

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat(ext: tracer): apply PR feedbacks

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat(tracer): modify communication code between the tracer and sidecar

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat(tracer): add function to convert a rust span to a zval

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: fix tests

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: fix tests

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* Switch to new way to pass zend_strings

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

* chore: fix tests

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: remove useless free statements

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: fix remaining failing tests

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* test: fix windows compiling tests

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat: move rust span code to sidecar-ffi

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* feat: improve serializer performance by using literal instead of CharSlice

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

* chore: rebase with master

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>

---------

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com>
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.

3 participants