Skip to content

chore(aap): telemetry wrapper for ato sdk v1 #13727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

christophe-papazian
Copy link
Contributor

@christophe-papazian christophe-papazian commented Jun 19, 2025

Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests DataDog/system-tests#4806

APPSEC-58051

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

@christophe-papazian christophe-papazian added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Jun 19, 2025
Copy link
Contributor

github-actions bot commented Jun 19, 2025

CODEOWNERS have been resolved as:

ddtrace/appsec/trace_utils/__init__.py                                  @DataDog/asm-python
tests/appsec/appsec/test_appsec_trace_utils.py                          @DataDog/asm-python

Copy link
Contributor

github-actions bot commented Jun 19, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 278 ± 5 ms.

The average import time from base is: 300 ± 10 ms.

The import time difference between this PR and base is: -19.8 ± 0.4 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 16.651 ms (5.99%)
ddtrace 9.345 ms (3.36%)
ddtrace._logger 5.291 ms (1.90%)
ddtrace.internal.telemetry 4.948 ms (1.78%)
ddtrace.internal.telemetry.writer 2.304 ms (0.83%)
http.client 1.213 ms (0.44%)
email.parser 0.629 ms (0.23%)
email.feedparser 0.608 ms (0.22%)
email._policybase 0.608 ms (0.22%)
email.header 0.348 ms (0.13%)
email.charset 0.294 ms (0.11%)
email.utils 0.226 ms (0.08%)
random 0.075 ms (0.03%)
bisect 0.032 ms (0.01%)
_bisect 0.032 ms (0.01%)
email._parseaddr 0.068 ms (0.02%)
calendar 0.068 ms (0.02%)
datetime 0.030 ms (0.01%)
_datetime 0.030 ms (0.01%)
ssl 0.375 ms (0.13%)
_ssl 0.160 ms (0.06%)
email.message 0.053 ms (0.02%)
http 0.044 ms (0.02%)
ddtrace.internal.telemetry.data 0.354 ms (0.13%)
ddtrace.internal.packages 0.207 ms (0.07%)
_sysconfigdata__linux_x86_64-linux-gnu 0.090 ms (0.03%)
ddtrace.settings.third_party 0.027 ms (0.01%)
sysconfig 0.059 ms (0.02%)
ddtrace.internal.runtime.container 0.057 ms (0.02%)
ddtrace.internal.runtime 0.130 ms (0.05%)
uuid 0.130 ms (0.05%)
platform 0.073 ms (0.03%)
ddtrace.settings._telemetry 0.123 ms (0.04%)
ddtrace.settings._inferred_base_service 0.052 ms (0.02%)
ddtrace.internal.periodic 0.101 ms (0.04%)
ddtrace.internal._threads 0.069 ms (0.02%)
ddtrace.internal.service 0.032 ms (0.01%)
ddtrace.internal.encoding 0.101 ms (0.04%)
ddtrace.internal._encoding 0.080 ms (0.03%)
ddtrace.internal.telemetry.metrics_namespaces 0.090 ms (0.03%)
ddtrace.internal.utils.version 0.082 ms (0.03%)
ddtrace.vendor.packaging.version 0.082 ms (0.03%)
ddtrace.internal.utils.time 0.027 ms (0.01%)
ddtrace.settings._agent 2.209 ms (0.79%)
ddtrace.settings 1.698 ms (0.61%)
ddtrace.settings.http 0.925 ms (0.33%)
ddtrace.internal.utils.cache 0.659 ms (0.24%)
inspect 0.635 ms (0.23%)
dis 0.109 ms (0.04%)
opcode 0.051 ms (0.02%)
_opcode 0.027 ms (0.01%)
ast 0.088 ms (0.03%)
ddtrace.internal.utils.http 0.265 ms (0.10%)
email.encoders 0.081 ms (0.03%)
base64 0.081 ms (0.03%)
struct 0.033 ms (0.01%)
_struct 0.033 ms (0.01%)
binascii 0.021 ms (0.01%)
dataclasses 0.062 ms (0.02%)
ddtrace.settings.integration 0.773 ms (0.28%)
ddtrace.vendor.debtcollector 0.750 ms (0.27%)
ddtrace.vendor 0.571 ms (0.21%)
ddtrace.internal.module 0.553 ms (0.20%)
ddtrace.internal.wrapping.context 0.491 ms (0.18%)
ddtrace.internal.wrapping 0.315 ms (0.11%)
bytecode 0.279 ms (0.10%)
bytecode.bytecode 0.148 ms (0.05%)
bytecode.flags 0.148 ms (0.05%)
bytecode.instr 0.148 ms (0.05%)
bytecode.cfg 0.113 ms (0.04%)
bytecode.concrete 0.048 ms (0.02%)
ddtrace.internal.utils.inspection 0.087 ms (0.03%)
ddtrace.internal.safety 0.048 ms (0.02%)
wrapt 0.048 ms (0.02%)
wrapt.__wrapt__ 0.030 ms (0.01%)
wrapt._wrappers 0.030 ms (0.01%)
contextvars 0.026 ms (0.01%)
_contextvars 0.026 ms (0.01%)
ddtrace.vendor.debtcollector.moves 0.084 ms (0.03%)
ddtrace.vendor.debtcollector.removals 0.046 ms (0.02%)
socket 0.274 ms (0.10%)
_socket 0.097 ms (0.03%)
array 0.051 ms (0.02%)
ddtrace.settings._core 0.198 ms (0.07%)
envier 0.092 ms (0.03%)
envier.env 0.092 ms (0.03%)
ddtrace.internal.native 0.057 ms (0.02%)
ddtrace.internal.native._native 0.057 ms (0.02%)
ddtrace.internal.utils.formats 0.272 ms (0.10%)
ddtrace.internal.compat 0.199 ms (0.07%)
pathlib 0.152 ms (0.05%)
urllib.parse 0.078 ms (0.03%)
ntpath 0.011 ms (0.00%)
ipaddress 0.047 ms (0.02%)
ddtrace.internal.constants 0.048 ms (0.02%)
ddtrace.constants 0.033 ms (0.01%)
ddtrace.internal.telemetry.constants 0.042 ms (0.02%)
ddtrace.settings._otel_remapper 0.037 ms (0.01%)
logging 0.204 ms (0.07%)
traceback 0.088 ms (0.03%)
linecache 0.051 ms (0.02%)
tokenize 0.051 ms (0.02%)
string 0.025 ms (0.01%)
typing 0.139 ms (0.05%)
ddtrace.trace 1.284 ms (0.46%)
ddtrace._trace.filters 0.777 ms (0.28%)
ddtrace._trace.processor 0.777 ms (0.28%)
ddtrace._trace.sampler 0.383 ms (0.14%)
ddtrace._trace.span 0.358 ms (0.13%)
ddtrace.internal.sampling 0.123 ms (0.04%)
ddtrace.internal.rate_limiter 0.058 ms (0.02%)
ddtrace._trace.sampling_rule 0.031 ms (0.01%)
pprint 0.055 ms (0.02%)
ddtrace.internal._rand 0.053 ms (0.02%)
ddtrace._trace._span_pointer 0.043 ms (0.02%)
ddtrace.internal.dogstatsd 0.168 ms (0.06%)
ddtrace.vendor.dogstatsd 0.168 ms (0.06%)
ddtrace.vendor.dogstatsd.base 0.168 ms (0.06%)
ddtrace.vendor.dogstatsd.container 0.055 ms (0.02%)
queue 0.029 ms (0.01%)
heapq 0.029 ms (0.01%)
_heapq 0.029 ms (0.01%)
ddtrace.internal.writer 0.152 ms (0.05%)
ddtrace.internal.writer.writer 0.152 ms (0.05%)
gzip 0.044 ms (0.02%)
ddtrace._trace.tracer 0.203 ms (0.07%)
ddtrace.internal.processor.endpoint_call_counter 0.063 ms (0.02%)
ddtrace.settings.peer_service 0.033 ms (0.01%)
ddtrace.internal.debug 0.033 ms (0.01%)
ddtrace._trace.context 0.121 ms (0.04%)
ddtrace._trace._span_link 0.072 ms (0.03%)
ddtrace._trace.pin 0.024 ms (0.01%)
ddtrace.settings._config 0.932 ms (0.33%)
ddtrace.internal.gitmetadata 0.579 ms (0.21%)
ddtrace.ext.ci 0.579 ms (0.21%)
ddtrace.ext.git 0.532 ms (0.19%)
tempfile 0.337 ms (0.12%)
shutil 0.124 ms (0.04%)
zlib 0.037 ms (0.01%)
ddtrace.internal._file_queue 0.083 ms (0.03%)
secrets 0.083 ms (0.03%)
hmac 0.083 ms (0.03%)
_hashlib 0.083 ms (0.03%)
ddtrace.internal.schema 0.075 ms (0.03%)
ddtrace.internal.schema.span_attribute_schema 0.039 ms (0.01%)
ddtrace.internal._unpatched 0.692 ms (0.25%)
subprocess 0.444 ms (0.16%)
contextlib 0.287 ms (0.10%)
locale 0.042 ms (0.02%)
selectors 0.031 ms (0.01%)
fcntl 0.027 ms (0.01%)
json 0.189 ms (0.07%)
json.decoder 0.189 ms (0.07%)
re 0.160 ms (0.06%)
enum 0.129 ms (0.05%)
types 0.052 ms (0.02%)
re._compiler 0.031 ms (0.01%)
json.scanner 0.030 ms (0.01%)
_json 0.030 ms (0.01%)
threading 0.058 ms (0.02%)
ddtrace._monkey 0.456 ms (0.16%)
ddtrace.appsec._listeners 0.161 ms (0.06%)
ddtrace.internal.core 0.161 ms (0.06%)
ddtrace.internal.core.event_hub 0.114 ms (0.04%)
ddtrace.vendor.packaging.specifiers 0.141 ms (0.05%)
ddtrace.settings.asm 0.073 ms (0.03%)
ddtrace.bootstrap.sitecustomize 7.306 ms (2.63%)
ddtrace.bootstrap.preload 6.075 ms (2.18%)
ddtrace.internal.remoteconfig.client 0.985 ms (0.35%)
ddtrace.settings.profiling 0.882 ms (0.32%)
ddtrace.vendor.psutil 0.579 ms (0.21%)
ddtrace.vendor.psutil._pslinux 0.267 ms (0.10%)
ddtrace.vendor.psutil._psutil_linux 0.046 ms (0.02%)
glob 0.042 ms (0.01%)
ddtrace.vendor.psutil._common 0.120 ms (0.04%)
ddtrace.vendor.psutil._compat 0.038 ms (0.01%)
ddtrace.internal.datadog.profiling.ddup 0.148 ms (0.05%)
ddtrace.internal.datadog.profiling.ddup._ddup 0.122 ms (0.04%)
ddtrace.internal.datadog.profiling.code_provenance 0.030 ms (0.01%)
ddtrace.internal.datadog.profiling.stack_v2 0.038 ms (0.01%)
ddtrace.internal.datadog.profiling.stack_v2._stack_v2 0.038 ms (0.01%)
ddtrace.internal.products 0.767 ms (0.28%)
importlib.metadata 0.733 ms (0.26%)
zipfile 0.422 ms (0.15%)
zipfile._path 0.339 ms (0.12%)
csv 0.091 ms (0.03%)
_csv 0.057 ms (0.02%)
importlib.metadata._meta 0.037 ms (0.01%)
importlib.metadata._adapters 0.027 ms (0.01%)
importlib.abc 0.027 ms (0.01%)
multiprocessing.sharedctypes 0.459 ms (0.17%)
multiprocessing.heap 0.417 ms (0.15%)
mmap 0.374 ms (0.13%)
multiprocessing.util 0.042 ms (0.02%)
ddtrace.internal.symbol_db.remoteconfig 0.295 ms (0.11%)
ddtrace.internal.symbol_db.symbols 0.211 ms (0.08%)
ddtrace.settings.symbol_db 0.037 ms (0.01%)
ddtrace.internal.flare.flare 0.169 ms (0.06%)
logging.handlers 0.073 ms (0.03%)
multiprocessing 0.159 ms (0.06%)
multiprocessing.context 0.159 ms (0.06%)
multiprocessing.reduction 0.159 ms (0.06%)
pickle 0.159 ms (0.06%)
_pickle 0.040 ms (0.01%)
_compat_pickle 0.030 ms (0.01%)
ddtrace.appsec._remoteconfiguration 0.137 ms (0.05%)
ddtrace.appsec._capabilities 0.056 ms (0.02%)
ddtrace.settings.crashtracker 0.135 ms (0.05%)
ddtrace.internal.datadog.profiling.crashtracker 0.099 ms (0.04%)
ddtrace.internal.datadog.profiling.crashtracker._crashtracker 0.099 ms (0.04%)
ddtrace.internal.remoteconfig._connectors 0.091 ms (0.03%)
ctypes 0.091 ms (0.03%)
_ctypes 0.091 ms (0.03%)
ddtrace.debugging._import 0.080 ms (0.03%)
ddtrace.debugging._function.discovery 0.080 ms (0.03%)
ddtrace.internal.remoteconfig.worker 0.071 ms (0.03%)
ddtrace.settings.dynamic_instrumentation 0.054 ms (0.02%)
ddtrace.internal.runtime.runtime_metrics 0.042 ms (0.01%)
ddtrace.settings.code_origin 0.026 ms (0.01%)
ddtrace.appsec._common_module_patches 0.440 ms (0.16%)
ddtrace.appsec._asm_request_context 0.399 ms (0.14%)
ddtrace.appsec._utils 0.336 ms (0.12%)
ddtrace._trace.trace_handlers 0.393 ms (0.14%)
ddtrace._trace._inferred_proxy 0.163 ms (0.06%)
ddtrace.propagation.http 0.163 ms (0.06%)
ddtrace.internal._tagset 0.051 ms (0.02%)
ddtrace.contrib.trace_utils 0.111 ms (0.04%)
ddtrace.contrib.internal.trace_utils 0.087 ms (0.03%)
ddtrace.contrib.internal.trace_utils_base 0.043 ms (0.02%)
shlex 0.042 ms (0.02%)

@pr-commenter
Copy link

pr-commenter bot commented Jun 19, 2025

Benchmarks

Benchmark execution time: 2025-06-19 15:33:51

Comparing candidate commit d0d433d in PR branch christophe-papazian/telemetry_for_ato_sdk_v1 with baseline commit 04cdf7f in branch main.

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

@christophe-papazian christophe-papazian marked this pull request as ready for review June 19, 2025 13:39
@christophe-papazian christophe-papazian requested a review from a team as a code owner June 19, 2025 13:39
@avara1986 avara1986 merged commit 0e561cd into main Jun 20, 2025
452 checks passed
@avara1986 avara1986 deleted the christophe-papazian/telemetry_for_ato_sdk_v1 branch June 20, 2025 06:45
juanjux pushed a commit that referenced this pull request Jun 20, 2025
Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests
DataDog/system-tests#4806

APPSEC-58051

## 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
- [x] 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)
brettlangdon pushed a commit that referenced this pull request Jun 20, 2025
Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests
DataDog/system-tests#4806

APPSEC-58051

## 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
- [x] 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)
sydney-tung pushed a commit that referenced this pull request Jun 24, 2025
Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests
DataDog/system-tests#4806

APPSEC-58051

## 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
- [x] 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)
happynancee pushed a commit that referenced this pull request Jul 7, 2025
Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests
DataDog/system-tests#4806

APPSEC-58051

## 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
- [x] 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)
alyshawang pushed a commit that referenced this pull request Jul 25, 2025
Add telemetry support for the legacy ATO SDK.

This will also be tested using system tests
DataDog/system-tests#4806

APPSEC-58051

## 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
- [x] 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
ASM Application Security Monitoring 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.

2 participants