Skip to content

Conversation

brettlangdon
Copy link
Member

@brettlangdon brettlangdon commented Jul 7, 2025

Help remove some implementation details from SpanAggregator into a the writer module.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Help remove some implementation details from SpanAggregator into a the writer module.
@brettlangdon brettlangdon added the changelog/no-changelog A changelog entry is not required for this PR. label Jul 7, 2025
@brettlangdon
Copy link
Member Author

This is going to have conflicts with #13876

Copy link
Contributor

github-actions bot commented Jul 7, 2025

CODEOWNERS have been resolved as:

ddtrace/_trace/processor/__init__.py                                    @DataDog/apm-sdk-api-python
ddtrace/internal/ci_visibility/writer.py                                @DataDog/ci-app-libraries
ddtrace/internal/writer/__init__.py                                     @DataDog/apm-core-python
ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
tests/utils.py                                                          @DataDog/python-guild

Copy link
Contributor

github-actions bot commented Jul 7, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 277 ± 2 ms.

The average import time from base is: 278 ± 3 ms.

The import time difference between this PR and base is: -1.9 ± 0.1 ms.

Import time breakdown

The following import paths have appeared:

ddtrace.auto 4.805 ms (1.74%)
ddtrace 4.805 ms (1.74%)
ddtrace.trace 4.805 ms (1.74%)
ddtrace._trace.filters 4.805 ms (1.74%)
ddtrace._trace.processor 4.805 ms (1.74%)
ddtrace.internal.writer 4.805 ms (1.74%)
ddtrace.internal.writer.writer 4.805 ms (1.74%)
ddtrace.internal.dogstatsd 4.805 ms (1.74%)
ddtrace.vendor.dogstatsd 4.521 ms (1.63%)
ddtrace.vendor.dogstatsd.base 4.266 ms (1.54%)
queue 1.347 ms (0.49%)
heapq 0.566 ms (0.20%)
_heapq 0.285 ms (0.10%)
_queue 0.294 ms (0.11%)
ddtrace.vendor.dogstatsd.context 0.785 ms (0.28%)
ddtrace.vendor.dogstatsd.context_async 0.469 ms (0.17%)
ddtrace.vendor.dogstatsd.container 0.560 ms (0.20%)
ddtrace.vendor.dogstatsd.format 0.323 ms (0.12%)
ddtrace.vendor.dogstatsd.route 0.275 ms (0.10%)
ddtrace.vendor.dogstatsd.compat 0.247 ms (0.09%)

The following import paths have disappeared:

ddtrace.auto 4.792 ms (1.73%)
ddtrace 4.792 ms (1.73%)
ddtrace.trace 4.792 ms (1.73%)
ddtrace._trace.filters 4.792 ms (1.73%)
ddtrace._trace.processor 4.792 ms (1.73%)
ddtrace.internal.dogstatsd 4.792 ms (1.73%)
ddtrace.vendor.dogstatsd 4.494 ms (1.63%)
ddtrace.vendor.dogstatsd.base 4.240 ms (1.53%)
queue 1.236 ms (0.45%)
heapq 0.564 ms (0.20%)
_heapq 0.283 ms (0.10%)
_queue 0.295 ms (0.11%)
ddtrace.vendor.dogstatsd.context 0.783 ms (0.28%)
ddtrace.vendor.dogstatsd.context_async 0.464 ms (0.17%)
ddtrace.vendor.dogstatsd.container 0.665 ms (0.24%)
ddtrace.vendor.dogstatsd.format 0.317 ms (0.11%)
ddtrace.vendor.dogstatsd.route 0.276 ms (0.10%)
ddtrace.vendor.dogstatsd.compat 0.250 ms (0.09%)

The following import paths have grown:

ddtrace.auto 0.017 ms (0.01%)
ddtrace 0.017 ms (0.01%)
ddtrace.trace 0.017 ms (0.01%)
ddtrace._trace.filters 0.017 ms (0.01%)
ddtrace._trace.processor 0.017 ms (0.01%)
ddtrace.internal.writer 0.017 ms (0.01%)
ddtrace.internal.writer.writer 0.017 ms (0.01%)
ddtrace.internal.sma 0.017 ms (0.01%)

The following import paths have shrunk:

ddtrace.auto 2.052 ms (0.74%)
ddtrace.bootstrap.sitecustomize 1.333 ms (0.48%)
ddtrace.bootstrap.preload 1.333 ms (0.48%)
ddtrace.internal.remoteconfig.client 0.654 ms (0.24%)
ddtrace.debugging._import 0.016 ms (0.01%)
ddtrace.debugging._function.discovery 0.016 ms (0.01%)
ddtrace.debugging._function 0.016 ms (0.01%)
ddtrace 0.719 ms (0.26%)
ddtrace.trace 0.046 ms (0.02%)
ddtrace._trace.filters 0.046 ms (0.02%)
ddtrace._trace.processor 0.046 ms (0.02%)
ddtrace.internal._unpatched 0.028 ms (0.01%)
json 0.028 ms (0.01%)
json.decoder 0.028 ms (0.01%)
re 0.028 ms (0.01%)
enum 0.028 ms (0.01%)
types 0.028 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Jul 7, 2025

Benchmarks

Benchmark execution time: 2025-07-15 16:51:10

Comparing candidate commit a705cfc in PR branch LANGPLAT-134/abstract-writer-create with baseline commit 1250b2f in branch main.

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

scenario:iastaspectsospath-ospathsplitdrive_aspect

  • 🟥 execution_time [+410.324ns; +491.674ns] or [+11.179%; +13.395%]

Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann left a comment

Choose a reason for hiding this comment

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

LGTM, this will also be helpful for the DummyWriter creation with NativeWriter

@brettlangdon brettlangdon marked this pull request as ready for review July 11, 2025 18:21
@brettlangdon brettlangdon requested review from a team as code owners July 11, 2025 18:21
@brettlangdon brettlangdon enabled auto-merge (squash) July 11, 2025 19:14
@brettlangdon brettlangdon requested review from gnufede and vitor-de-araujo and removed request for nikita-tkachenko-datadog July 15, 2025 10:05
brettlangdon and others added 2 commits July 15, 2025 09:08
@brettlangdon brettlangdon merged commit 5f15b27 into main Jul 15, 2025
880 checks passed
@brettlangdon brettlangdon deleted the LANGPLAT-134/abstract-writer-create branch July 15, 2025 17:39
alyshawang pushed a commit that referenced this pull request Jul 25, 2025
Help remove some implementation details from SpanAggregator into a the
writer module.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [ ] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants