Skip to content

fix(profiling): align frame limit with backend location cap - #19076

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
taegyunkim/prof-14213-backend-max-frames
Jul 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
taegyunkim/prof-14213-backend-max-frames

Conversation

@taegyunkim

@taegyunkim taegyunkim commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Aligns profiling frame-limit configuration with the backend's 600-location limit.

  • raises the native exporter cap from 512 to 599 captured frames
  • reserves the 600th backend location for the synthetic <N frames omitted> indicator on truncated stacks
  • clamps DD_PROFILING_MAX_FRAMES to 599 in ddtrace.internal.settings.profiling
  • preserves configured values from 513 through 599 instead of reducing them to 512 in the native exporter
  • ensures collectors receive the same effective configured limit

JIRA: PROF-14213

Testing

  • Added configuration tests covering the default, values below the maximum captured-frame limit, the exact 599-frame limit, and values at or above the 600-location backend limit.
  • Ran TestMaxFramesConfig on Python 3.9, all 6 tests passed. The editable install also rebuilt the native extension successfully.
  • Completed a clean Python 3.14 native build for the initial change.
  • Ran scripts/lint checks, targeted formatting, spelling, and git diff --check. Broad lint checks reported only existing repository warnings.

Risks

Configurations between 513 and 599 can now retain more frames than before. This matches the backend contract but can slightly increase per-sample work for users who explicitly configure values in that range.

Values of 600 and above are now clamped to 599 at configuration load instead of reaching individual collectors unchanged. This leaves one location for the omitted-frame indicator so truncated samples remain within the backend's 600-location cap.

Additional Notes

This PR is the base of stacked #19073 and #19085, which propagate the limit into Echion and bound task-aware stack collection.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 61 circular imports that already exist on the base branch and have not been changed by this PR.

Show existing cycles (showing 5 of 61 shortest)
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kafka -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.google_cloud_pubsub -> ddtrace.internal.datastreams
ddtrace.internal.core -> ddtrace._trace.span -> ddtrace.internal.core
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.aiokafka -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kombu -> ddtrace.internal.datastreams

To see all cycles, download the cycles-base.json and cycles-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/cycles.py compare cycles-base.json cycles-pr.json

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/datadog/profiling/dd_wrapper/include/constants.hpp     @DataDog/profiling-python
ddtrace/internal/settings/profiling.py                                  @DataDog/profiling-python
releasenotes/notes/profiling-backend-max-frames-347fd7903802fd4c.yaml   @DataDog/apm-python
tests/profiling/test_profiling_config.py                                @DataDog/profiling-python

@datadog-official

datadog-official Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

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

@taegyunkim
taegyunkim marked this pull request as ready for review July 16, 2026 14:06
@taegyunkim
taegyunkim requested review from a team as code owners July 16, 2026 14:06

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

Copy link
Copy Markdown

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: 3a139908de

ℹ️ 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".

@KowalskiThomas KowalskiThomas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

Comment thread ddtrace/internal/settings/profiling.py Resolved
taegyunkim and others added 2 commits July 16, 2026 10:14
@taegyunkim taegyunkim changed the title fix(profiling): align maximum frames with backend fix(profiling): align frame limit with backend location cap Jul 16, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit cffe63f into main Jul 16, 2026
469 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the taegyunkim/prof-14213-backend-max-frames branch July 16, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Profiling Continous Profling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants