Skip to content

Conversation

@realFlowControl
Copy link
Member

@realFlowControl realFlowControl commented Feb 4, 2026

Important

This PR is not against master, but against levi/stack_walk_metric in #3616

Description

A few improvements to the CPU time tracking for background threads:

  • Moved update_background_cpu_time() to just before exporter.build() so that profile serialization time is included in the metric for the current exported profile. Note: metadata generation, exporter building, and HTTP request time will still be attributed to the next profile period (left a comment in the code about that as well)
  • Added tracking for ddprof_time thread
  • Split the single background_threads_cpu_time_ns counter into two metrics, ddprof_time_cpu_time_ns for the ddprof_time thread and ddprof_upload_cpu_time_ns for the ddprof_upload thread

I did those changes in three separate commits (in the order above).

{
  "ddprof_upload_cpu_time_ns": 894625,
  "libdatadog_version": "1.0.0",
  "stack_walk_cpu_time_ns": 0,
  "stack_walk_count": 0,
  "ddprof_time_cpu_time_ns": 8158083
}

vs.

{
  "libdatadog_version": "1.0.0",
  "stack_walk_cpu_time_ns": 0,
  "stack_walk_count": 0,
  "background_threads_cpu_time_ns": 28375
}

.. on the first profile received.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

realFlowControl and others added 3 commits February 4, 2026 11:40
…ddprof_upload` for current profile exported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@datadog-official
Copy link

datadog-official bot commented Feb 4, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1024 Tests failed

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

    testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Fix with Cursor)

testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 698332100000000085602b6eeb041df1
tid: 6983321000000000
hexProcessTraceId: 85602b6eeb041df1
hexProcessSpanId: 73e46101f50beaa6
processTraceId: 9610729360197950961
processSpanId: 8350906270085802662
View all

ℹ️ Info

❄️ No new flaky tests detected

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

@github-actions github-actions bot added profiling Relates to the Continuous Profiler tracing labels Feb 4, 2026
@realFlowControl realFlowControl marked this pull request as ready for review February 4, 2026 11:15
@realFlowControl realFlowControl requested a review from a team as a code owner February 4, 2026 11:15
@morrisonlevi morrisonlevi merged commit 76483bb into levi/stack-walk-metric Feb 4, 2026
1914 of 1919 checks passed
@morrisonlevi morrisonlevi deleted the florian/move-cpu-time-tracking branch February 4, 2026 15:30
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 tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants