Skip to content

ci: add riot hash to DD_TAGS [backport 3.10] #14310

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

Open
wants to merge 2 commits into
base: 3.10
Choose a base branch
from

Conversation

vitor-de-araujo
Copy link
Contributor

Backport 02b1c2b from #14296 to 3.10.

Add the riot environment hash to the tags sent with tests, so that runs of the same test in different environments get different test fingerprints in the backend. This avoids an issue where a test that passes in one environment and fails in another would end up being marked as flaky.

To avoid breaking tests that check for tags, a new _CI_DD_TAGS environment variable was added that only sets the tags for the CI environment, but does not affect the tracer being tested.

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

Add the riot environment hash to the tags sent with tests, so that runs
of the same test in different environments get different test
fingerprints in the backend. This avoids an issue where a test that
passes in one environment and fails in another would end up being marked
as flaky.

To avoid breaking tests that check for tags, a new `_CI_DD_TAGS`
environment variable was added that only sets the tags for the CI
environment, but does not affect the tracer being tested.

- [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))

- [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)

---------

Co-authored-by: Brett Langdon <[email protected]>
(cherry picked from commit 02b1c2b)
Copy link
Contributor

CODEOWNERS have been resolved as:

.gitlab/tests.yml                                                       @DataDog/python-guild @DataDog/apm-core-python
ddtrace/internal/ci_visibility/recorder.py                              @DataDog/ci-app-libraries

@vitor-de-araujo vitor-de-araujo added changelog/no-changelog A changelog entry is not required for this PR. CI labels Aug 14, 2025
Copy link
Contributor

github-actions bot commented Aug 14, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

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

The average import time from base is: 303 ± 7 ms.

The import time difference between this PR and base is: -13.6 ± 0.3 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 8.204 ms (2.84%)
ddtrace 4.252 ms (1.47%)
ddtrace._logger 1.829 ms (0.63%)
ddtrace.internal.telemetry 1.622 ms (0.56%)
ddtrace.settings._agent 0.782 ms (0.27%)
ddtrace.settings 0.732 ms (0.25%)
ddtrace.settings.http 0.426 ms (0.15%)
ddtrace.internal.utils.cache 0.295 ms (0.10%)
inspect 0.295 ms (0.10%)
ddtrace.internal.utils.http 0.132 ms (0.05%)
dataclasses 0.046 ms (0.02%)
ddtrace.settings.integration 0.306 ms (0.11%)
ddtrace.vendor.debtcollector 0.306 ms (0.11%)
ddtrace.vendor 0.214 ms (0.07%)
ddtrace.internal.module 0.214 ms (0.07%)
ddtrace.internal.wrapping.context 0.214 ms (0.07%)
ddtrace.internal.wrapping 0.159 ms (0.06%)
bytecode 0.159 ms (0.06%)
bytecode.bytecode 0.104 ms (0.04%)
bytecode.flags 0.104 ms (0.04%)
bytecode.instr 0.104 ms (0.04%)
bytecode.cfg 0.055 ms (0.02%)
ddtrace.vendor.debtcollector.moves 0.058 ms (0.02%)
socket 0.050 ms (0.02%)
_socket 0.050 ms (0.02%)
ddtrace.internal.telemetry.writer 0.663 ms (0.23%)
http.client 0.238 ms (0.08%)
ssl 0.146 ms (0.05%)
email.parser 0.023 ms (0.01%)
email.feedparser 0.023 ms (0.01%)
email._policybase 0.023 ms (0.01%)
email.utils 0.023 ms (0.01%)
random 0.023 ms (0.01%)
bisect 0.023 ms (0.01%)
_bisect 0.023 ms (0.01%)
ddtrace.internal.telemetry.data 0.121 ms (0.04%)
ddtrace.internal.packages 0.121 ms (0.04%)
_sysconfigdata__linux_x86_64-linux-gnu 0.052 ms (0.02%)
ddtrace.internal.runtime 0.091 ms (0.03%)
uuid 0.091 ms (0.03%)
platform 0.051 ms (0.02%)
ddtrace.internal.telemetry.metrics_namespaces 0.056 ms (0.02%)
ddtrace.internal.encoding 0.055 ms (0.02%)
ddtrace.internal._encoding 0.055 ms (0.02%)
ddtrace.settings._telemetry 0.048 ms (0.02%)
ddtrace.internal.utils.formats 0.104 ms (0.04%)
ddtrace.internal.compat 0.104 ms (0.04%)
pathlib 0.056 ms (0.02%)
urllib.parse 0.056 ms (0.02%)
ipaddress 0.048 ms (0.02%)
ddtrace.internal.telemetry.constants 0.029 ms (0.01%)
typing 0.103 ms (0.04%)
logging 0.103 ms (0.04%)
traceback 0.034 ms (0.01%)
ddtrace.trace 0.571 ms (0.20%)
ddtrace._trace.filters 0.347 ms (0.12%)
ddtrace._trace.processor 0.347 ms (0.12%)
ddtrace._trace.sampler 0.126 ms (0.04%)
ddtrace._trace.span 0.126 ms (0.04%)
ddtrace._trace._span_pointer 0.035 ms (0.01%)
ddtrace.internal.sampling 0.025 ms (0.01%)
ddtrace._trace.sampling_rule 0.025 ms (0.01%)
ddtrace.internal.dogstatsd 0.083 ms (0.03%)
ddtrace.vendor.dogstatsd 0.083 ms (0.03%)
ddtrace.vendor.dogstatsd.base 0.083 ms (0.03%)
ddtrace.vendor.dogstatsd.container 0.035 ms (0.01%)
ddtrace.internal.writer 0.078 ms (0.03%)
ddtrace.internal.writer.writer 0.078 ms (0.03%)
ddtrace._trace.context 0.079 ms (0.03%)
ddtrace._trace._span_link 0.044 ms (0.02%)
ddtrace._trace.tracer 0.047 ms (0.02%)
ddtrace.settings._config 0.472 ms (0.16%)
ddtrace.internal.gitmetadata 0.260 ms (0.09%)
ddtrace.ext.ci 0.260 ms (0.09%)
ddtrace.ext.git 0.260 ms (0.09%)
tempfile 0.181 ms (0.06%)
shutil 0.024 ms (0.01%)
zlib 0.024 ms (0.01%)
ddtrace.internal._file_queue 0.053 ms (0.02%)
secrets 0.053 ms (0.02%)
hmac 0.053 ms (0.02%)
_hashlib 0.053 ms (0.02%)
ddtrace.internal.schema 0.031 ms (0.01%)
ddtrace.internal._unpatched 0.429 ms (0.15%)
subprocess 0.227 ms (0.08%)
contextlib 0.209 ms (0.07%)
fcntl 0.019 ms (0.01%)
json 0.158 ms (0.05%)
json.decoder 0.158 ms (0.05%)
re 0.139 ms (0.05%)
enum 0.111 ms (0.04%)
types 0.049 ms (0.02%)
re._compiler 0.028 ms (0.01%)
json.scanner 0.020 ms (0.01%)
_json 0.020 ms (0.01%)
threading 0.043 ms (0.02%)
ddtrace._monkey 0.269 ms (0.09%)
ddtrace.vendor.packaging.specifiers 0.103 ms (0.04%)
ddtrace.appsec._listeners 0.063 ms (0.02%)
ddtrace.internal.core 0.063 ms (0.02%)
ddtrace.internal.core.event_hub 0.063 ms (0.02%)
ddtrace.settings.asm 0.048 ms (0.02%)
ddtrace.bootstrap.sitecustomize 3.952 ms (1.37%)
ddtrace.bootstrap.preload 3.665 ms (1.27%)
ddtrace.internal.remoteconfig.client 0.894 ms (0.31%)
ddtrace.internal.remoteconfig.constants 0.016 ms (0.01%)
ddtrace.settings.profiling 0.523 ms (0.18%)
ddtrace.vendor.psutil 0.393 ms (0.14%)
ddtrace.vendor.psutil._pslinux 0.191 ms (0.07%)
ddtrace.vendor.psutil._psutil_linux 0.028 ms (0.01%)
glob 0.028 ms (0.01%)
ddtrace.vendor.psutil._common 0.087 ms (0.03%)
ddtrace.vendor.psutil._compat 0.027 ms (0.01%)
ddtrace.internal.datadog.profiling.ddup 0.059 ms (0.02%)
ddtrace.internal.datadog.profiling.ddup._ddup 0.059 ms (0.02%)
ddtrace.internal.products 0.280 ms (0.10%)
importlib.metadata 0.280 ms (0.10%)
zipfile 0.197 ms (0.07%)
zipfile._path 0.197 ms (0.07%)
multiprocessing.sharedctypes 0.217 ms (0.08%)
multiprocessing.heap 0.217 ms (0.08%)
mmap 0.217 ms (0.08%)
ddtrace.internal.symbol_db.remoteconfig 0.120 ms (0.04%)
ddtrace.internal.symbol_db.symbols 0.120 ms (0.04%)
ddtrace.internal.flare.flare 0.070 ms (0.02%)
ddtrace.internal.remoteconfig._connectors 0.063 ms (0.02%)
ctypes 0.063 ms (0.02%)
_ctypes 0.063 ms (0.02%)
ddtrace.settings.crashtracker 0.055 ms (0.02%)
ddtrace.internal.datadog.profiling.crashtracker 0.055 ms (0.02%)
ddtrace.internal.datadog.profiling.crashtracker._crashtracker 0.055 ms (0.02%)
ddtrace.debugging._import 0.055 ms (0.02%)
ddtrace.debugging._function.discovery 0.055 ms (0.02%)
ddtrace.internal.remoteconfig.worker 0.050 ms (0.02%)
ddtrace.settings.code_origin 0.028 ms (0.01%)
ddtrace._trace.trace_handlers 0.057 ms (0.02%)
ddtrace.appsec._common_module_patches 0.045 ms (0.02%)
ddtrace.appsec._asm_request_context 0.045 ms (0.02%)

@pr-commenter
Copy link

pr-commenter bot commented Aug 14, 2025

Benchmarks

Benchmark execution time: 2025-08-20 11:48:40

Comparing candidate commit 333bb84 in PR branch backport-14296-to-3.10 with baseline commit 47b9f8e in branch 3.10.

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

scenario:iastaspects-rstrip_aspect

  • 🟥 execution_time [+797.138ns; +878.461ns] or [+7.777%; +8.571%]

juanjux pushed a commit that referenced this pull request Aug 20, 2025
Multiple PRs experienced `tests/smoke_test.py` failing on
build_base_venv jobs, blocking merging those PRs, examples include

- #14310
- #14353

## 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. CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants