Skip to content

feat(profiling): process_tags on uploader#3609

Merged
dubloom merged 25 commits intomasterfrom
dubloom/process-tags-profiling
Feb 12, 2026
Merged

feat(profiling): process_tags on uploader#3609
dubloom merged 25 commits intomasterfrom
dubloom/process-tags-profiling

Conversation

@dubloom
Copy link
Contributor

@dubloom dubloom commented Jan 30, 2026

Description

This PR implements this RFC for Profiling by adding a process tags field to the Uploader from the tracer.

Note that if process_tags are deactivated, the value passed to the profiler will be an empty string.

Here are an example in datadog:
image
(see entrypoint.basedir/entrypoint.name fields).

No tests were added at it does not seem to be possible right now (because of the interaction tracer <> profiler)

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@dubloom dubloom force-pushed the dubloom/process-tags-profiling branch from aabd543 to 427e20d Compare January 30, 2026 14:01
@pr-commenter
Copy link

pr-commenter bot commented Jan 30, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-02-12 11:28:18

Comparing candidate commit f3891e0 in PR branch dubloom/process-tags-profiling with baseline commit de9c414 in branch master.

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

scenario:walk_stack/50

  • 🟩 wall_time [-987.791ns; -978.470ns] or [-6.030%; -5.974%]

scenario:walk_stack/99

  • 🟩 wall_time [-950.264ns; -945.902ns] or [-5.801%; -5.774%]

@pr-commenter
Copy link

pr-commenter bot commented Jan 30, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-02-12 12:09:06

Comparing candidate commit f3891e0 in PR branch dubloom/process-tags-profiling with baseline commit de9c414 in branch master.

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

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟥 execution_time [+3.639µs; +4.321µs] or [+3.592%; +4.266%]

scenario:SamplingRuleMatchingBench/benchRegexMatching1

  • 🟥 execution_time [+51.036ns; +111.764ns] or [+4.342%; +9.509%]

scenario:SamplingRuleMatchingBench/benchRegexMatching2

  • 🟥 execution_time [+72.855ns; +138.145ns] or [+6.261%; +11.871%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3

  • 🟥 execution_time [+87.467ns; +136.133ns] or [+7.547%; +11.746%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4

  • 🟥 execution_time [+77.233ns; +153.367ns] or [+6.694%; +13.292%]

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 30, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1027 Tests failed

❄️ Known flaky: Endpoints are sent() from com.datadog.appsec.php.integration.Symfony62Tests (Datadog) (Fix with Cursor)
Assertion failed: 

assert endpoints.size() == 6
       |         |      |
       |         1      false
       [com.datadog.appsec.php.TelemetryHelpers$Endpoint@4b8a0d03]

Assertion failed: 

assert endpoints.size() == 6
...

    testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Fix with Cursor)

testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Datadog) (Fix with Cursor)
Risky Test
phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:60
View all

ℹ️ Info

❄️ No new flaky tests detected

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.11%. Comparing base (de9c414) to head (f3891e0).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3609   +/-   ##
=======================================
  Coverage   62.11%   62.11%           
=======================================
  Files         141      141           
  Lines       13387    13387           
  Branches     1753     1753           
=======================================
  Hits         8315     8315           
  Misses       4273     4273           
  Partials      799      799           

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 de9c414...f3891e0. 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.

@dubloom dubloom marked this pull request as ready for review January 30, 2026 17:55
@dubloom dubloom requested review from a team as code owners January 30, 2026 17:56
@morrisonlevi morrisonlevi changed the title Adds process tags to profiler uploader feat(profiling): process_tags on uploader Feb 6, 2026
@morrisonlevi morrisonlevi added the profiling Relates to the Continuous Profiler label Feb 6, 2026
Copy link
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

Approved, but I have a question!

realFlowControl and others added 17 commits February 12, 2026 11:55
…heck on appsec extension (#3604)

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* refactor(profiling): use module globals for ZMM state

* style: fix clippy warnings

* Apply suggestions from code review

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>

* docs: note ZTS vs NTS differences

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
* refactor(profiling): extract Backtrace type

In a future change, this may hold a refcount for another object, so
we need to encapsulate it.

* fix `test_collect_stack_sample` not running

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
* feat(profiling): internal metrics for overhead

* feat(profiling): move CPU time capture to include serialization for `ddprof_upload` for current profile exported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(profiling): add CPU time tracking for `ddprof_time` thread

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(profiling): separate CPU time tracking per background thread

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ame_crash.phpt on all version (#3632)

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
* test(CI): add aggressive git cleanup on windows runner

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

* test(CI): add manual cleanup in before_script step

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

---------

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Leiyks and others added 5 commits February 12, 2026 11:56
* feat(CI): add healthcheck to SQLSRV server setup

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

* chore: add troubleshooting script for SQLSRV

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

* feat: add explicit memory limit and paths

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

* chore: replace sqlsrv docker image

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

---------

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* fix(logging): fsync crash logs before _Exit() to prevent data loss

When a SIGSEGV occurs, the signal handler logs "Segmentation fault encountered"
and then calls _Exit() which terminates the process immediately. Without fsync(),
kernel write buffers may not be flushed to disk before termination, causing
a race condition where the error log file is sometimes not created.

This fix adds fsync() on Unix/Linux and _commit() on Windows after write() in
ddtrace_log_with_time() to ensure crash logs persist to disk before process
termination.

The issue affects production (rare but possible during power loss, kernel panic,
or I/O errors) and causes consistent test failures where tests check for log
files immediately after crashes (before kernel writeback completes).

Fixes flaky test_metrics SigSegVTest::testGet failures on Kubernetes where
dd_php_error.log was not being created consistently.

* fix(signals): move flush in sigsegv handler

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

---------

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
* init process tags for APM

Co-Authored-By: PROFeNoM <alexandre.choura@datadoghq.com>

* feat(process_tags): add process_tags to tracing payloads

* small auto review and fix test

* bwoebi review

* fix test

* Adds process_tags to live debugger payloads

* temporary libdatadog bump

* auto review

* bump libdatadog

* fix build

* update makefile && make cbindgen

* fixing test

* fixing test

* fix appsec tests

---------

Co-authored-by: PROFeNoM <alexandre.choura@datadoghq.com>
* chore(profiling): update libdatadog 26 to 27
@dubloom dubloom force-pushed the dubloom/process-tags-profiling branch from 6011cf0 to 88fad58 Compare February 12, 2026 11:06
@dubloom dubloom requested review from a team as code owners February 12, 2026 11:06
@dubloom dubloom closed this Feb 12, 2026
@dubloom dubloom reopened this Feb 12, 2026
@dubloom dubloom merged commit 427402b into master Feb 12, 2026
2061 of 2070 checks passed
@dubloom dubloom deleted the dubloom/process-tags-profiling branch February 12, 2026 13:26
@github-actions github-actions bot added this to the 1.17.0 milestone Feb 12, 2026
BridgeAR pushed a commit that referenced this pull request Feb 19, 2026
* Adds process tags to profiler uploader

* remove useless utils function

* remove empty lines and fix spelling

* add function to ddtrace.sym

* feat(CI: installer tests): fix installer tests by changing enabling check on appsec extension (#3604)

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

* refactor(profiling): use module globals for ZMM state (#3608)

* refactor(profiling): use module globals for ZMM state

* style: fix clippy warnings

* Apply suggestions from code review

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>

* docs: note ZTS vs NTS differences

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>

* refactor(profiling): extract Backtrace type (#3612)

* refactor(profiling): extract Backtrace type

In a future change, this may hold a refcount for another object, so
we need to encapsulate it.

* fix `test_collect_stack_sample` not running

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>

* Propagate RELIABILITY_ENV_BRANCH to downstream pipeline (#3605)

* Add simple_onboarding_appsec to SSI system tests (#3617)

* Stores remote config requests in request-replayer (#3585)

* feat(profiling): internal metrics for overhead (#3616)

* feat(profiling): internal metrics for overhead

* feat(profiling): move CPU time capture to include serialization for `ddprof_upload` for current profile exported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(profiling): add CPU time tracking for `ddprof_time` thread

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(profiling): separate CPU time tracking per background thread

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix(tracing): hook is_internal was backwards (#3625)

* Fix phpt asm standalone tests (#3628)

* fix readme file links (#3610)

* test(language-tests): properly skip online tests and disabled soap_qname_crash.phpt on all version (#3632)

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

* Collect framework endpoints (#3548)

* Only run publishing jobs when all dependent pipelines succeed (#3635)

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

* chore(profiling): update libdatadog to 26 (#3633)

* test(CI): manually handle git operation for windows jobs (#3634)

* test(CI): add aggressive git cleanup on windows runner

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

* test(CI): add manual cleanup in before_script step

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

---------

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

* feat(CI): add healthcheck to SQLSRV server setup (#3619)

* feat(CI): add healthcheck to SQLSRV server setup

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

* chore: add troubleshooting script for SQLSRV

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

* feat: add explicit memory limit and paths

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

* chore: replace sqlsrv docker image

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

---------

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

* fix(CI: test_metrics): add explicit flush in logging (#3637)

* fix(logging): fsync crash logs before _Exit() to prevent data loss

When a SIGSEGV occurs, the signal handler logs "Segmentation fault encountered"
and then calls _Exit() which terminates the process immediately. Without fsync(),
kernel write buffers may not be flushed to disk before termination, causing
a race condition where the error log file is sometimes not created.

This fix adds fsync() on Unix/Linux and _commit() on Windows after write() in
ddtrace_log_with_time() to ensure crash logs persist to disk before process
termination.

The issue affects production (rare but possible during power loss, kernel panic,
or I/O errors) and causes consistent test failures where tests check for log
files immediately after crashes (before kernel writeback completes).

Fixes flaky test_metrics SigSegVTest::testGet failures on Kubernetes where
dd_php_error.log was not being created consistently.

* fix(signals): move flush in sigsegv handler

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

---------

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

* Adds process_tags to live debugger payloads (#3580)

* init process tags for APM

Co-Authored-By: PROFeNoM <alexandre.choura@datadoghq.com>

* feat(process_tags): add process_tags to tracing payloads

* small auto review and fix test

* bwoebi review

* fix test

* Adds process_tags to live debugger payloads

* temporary libdatadog bump

* auto review

* bump libdatadog

* fix build

* update makefile && make cbindgen

* fixing test

* fixing test

* fix appsec tests

---------

Co-authored-by: PROFeNoM <alexandre.choura@datadoghq.com>

* chore(profiling): update libdatadog 26 to 27 (#3640)

* chore(profiling): update libdatadog 26 to 27

* process tags were removed while rebasing to sign commit

---------

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Co-authored-by: Florian Engelhardt <florian.engelhardt@datadoghq.com>
Co-authored-by: Alexandre Rulleau <55387832+Leiyks@users.noreply.github.com>
Co-authored-by: Levi Morrison <levi.morrison@datadoghq.com>
Co-authored-by: Laplie Anderson <randomanderson@users.noreply.github.com>
Co-authored-by: Alejandro Estringana Ruiz <alejandro.estringanaruiz@datadoghq.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com>
Co-authored-by: PROFeNoM <alexandre.choura@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants