Repository navigation
Conversation
Telemetry moves to ddtrace-internal, which can't import dd-trace-py's AppSec settings. AppSec now declares a provider in the ddtrace_internal.telemetry_providers entry point group, and telemetry resolves it lazily on first use and reads its hooks on each use: the configurations to report at import, whether to collect full dependency metadata, and API endpoint collection. Nothing registers at import time, the configuration report order is unchanged, and without a provider the defaults match the AppSec ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codeowners resolved asResolved from the full PR diff against |
Dependency direction analysis
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: b8432b7 | Docs | View more details | Give us feedback! |
BenchmarksBenchmark execution time: 2026-11-26 19:31:57 Comparing candidate commit b8432b7 in PR branch Found 0 performance improvements and 3 performance regressions! Performance is the same for 625 metrics, 10 unstable metrics, 1 flaky benchmarks without significant changes.
|
…plit-telemetry-appsec
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8432b7eb8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # first. | ||
| if _providers is None: | ||
| providers = [] | ||
| for entry_point, _ in sorted(entry_points_with_distributions(PROVIDERS_GROUP), key=lambda ep: ep[0].name): |
There was a problem hiding this comment.
Provide startup benchmarks for provider discovery
Provider discovery adds another installed-distribution entry-point enumeration to cold imports: telemetry.__init__ unconditionally calls _report_initial_configurations(), which reaches this loop even when telemetry is disabled. The supplied change documents functional tests but provides no startup benchmark evidence. Run the run-benchmarks startup comparison, including telemetry enabled and disabled, to validate the added cost; repository instructions explicitly require benchmarks for startup changes and reporting missing coverage.
AGENTS.md reference: AGENTS.md:L16-L18
Useful? React with 👍 / 👎.
| def _report_initial_configurations() -> None: | ||
| # The configurations the telemetry providers ask for come before telemetry's own. |
There was a problem hiding this comment.
Preserve or update the existing telemetry TODO
This replacement deletes the existing TODO: Remove this once the telemetry feature is refactored to a better design. Although removal appears intentional as part of the refactor, repository instructions explicitly prohibit deleting TODO/NOTE comments without human authorization and require updating them when related code changes. No supplied instruction authorizes removal, so preserve or update the comment to reflect the provider-based reporting.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
More details
The provider hooks preserve runtime AppSec settings reads, configuration reporting order, and defaults when no provider is available. The completed static review found no actionable defect.
🤖 Bits Code Review · Commit b8432b7
Part of replacing #22018 with smaller PRs on
main.Stacked on the telemetry PR (
gnufede/package-split-telemetry,itself stacked on #22130). Review after both; it uses
ddtrace/internal/telemetry/inputs.pyand the sharedentry-point helper from them.
Telemetry read the AppSec settings (SCA, endpoint collection) by importing
ddtrace.internal.settings.appsec_telemetry,and reported that configuration at import. Telemetry moves to
ddtrace-internal, which never importsddtrace. ThisPR addresses the AppSec part of #22018 (comment) by pulling,
not pushing:
pyproject.tomldeclaresappsec = "ddtrace.internal.settings.appsec_telemetry:provider"in theddtrace_internal.telemetry_providersentry-point group.appsec_telemetry.pygainsAppSecTelemetryProviderwith optional hooks:configurations(),dependency_metadata_enabled(),endpoint_collection_enabled(),endpoint_collection_limit(). They read thesettings on each call, so runtime changes still apply.
telemetry/inputs.pyresolves the providers on first use (entry point name order, a provider that fails to load isskipped) and caches them.
writer.py,dependency_tracker.pyandtelemetry/__init__.pyread the hooks instead ofthe AppSec config. Nothing is registered at import.
provider the defaults apply: no dependency metadata, endpoint collection on, 300 endpoints per message.
Tests:
tests/telemetry/test_inputs.py(provider declared and resolved lazily, cached, failing provider skipped,defaults without a provider, settings read on each use, partial providers, report order, nothing loaded before
telemetry is imported), plus the shutdown-failure tests in
tests/telemetry/test_dependency.pyandtests/appsec/sca/test_telemetry.py, which now break the AppSec config behind the provider.🤖 Generated with Claude Code