Skip to content

Conversation

avara1986
Copy link
Member

@avara1986 avara1986 commented Sep 2, 2025

Summary: This PR refactors IAST context management to be concurrency-correct across threads and asyncio tasks by switching to ContextVar-indexed context arrays, with diagnostic and benchmark tooling to validate behavior and performance.

Problem

[pid=121307 tid=136453574387520] process-0:entry: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] thread-0:entry: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] create_context() -> done: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-0:start: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] thread-1:entry: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-1:start: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-2:start: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-3:start: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-4:start: init_map_addr=0x7c1a58000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] create_context() -> done: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-0:start: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-1:start: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-2:start: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-3:start: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-4:start: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-0:after_sleep_0.02: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-0:after_sleep_0.02: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] task-1:after_sleep_0.04: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452800431872] task-1:after_sleep_0.04: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] reset_context:before: init_map_addr=0x7c1a54000d90 active_map_addreses_size=1
[pid=121307 tid=136452721604352] reset_context:after: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] reset_context:before: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] reset_context:after: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452721604352] task-2:after_sleep_0.06: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] task-2:after_sleep_0.06: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452721604352] task-3:after_sleep_0.08: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] task-3:after_sleep_0.08: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] task-4:after_sleep_0.1: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] workflow:done: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452800431872] thread-0:exit: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452721604352] task-4:after_sleep_0.1: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452721604352] workflow:done: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136452721604352] thread-1:exit: init_map_addr=0x0 active_map_addreses_size=0
[pid=121307 tid=136453574387520] process-0:exit: init_map_addr=0x0 active_map_addreses_size=0

Solution Overview

  • Introduce a new ApplicationContext design:
    • Use a ContextVar (IAST_CONTEXT) storing an index (context_id) into a native-managed array of taint maps.
    • On propagation, resolve the taint map by context_id; on lookup, fall back by scanning all active maps when needed.
    • This isolates per-thread/task contexts correctly while keeping fast-path lookups.

Evidence: Concurrency Correctness

New context-array approach works correctly across threads and tasks:
https://gist.github.com/avara1986/c8566d077f92c4f3641c8c7285f4f6c6
Output:

[pid=108114 tid=125674768054080] process-0:entry: context_id=None slot_addr=0x0
[pid=108114 tid=125673994098432] thread-0:entry: context_id=None slot_addr=0x0
[pid=108114 tid=125673985705728] thread-1:entry: context_id=None slot_addr=0x0
[pid=108114 tid=125673994098432] create_context_array() -> 0: context_id=0 slot_addr=0x724cb4000d90[pid=108114 tid=125673985705728] create_context_array() -> 1: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673985705728] task-0:start: context_id=1 slot_addr=0x724cb8000d90

[pid=108114 tid=125673985705728] task-1:start: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673994098432] task-0:start: context_id=0 slot_addr=0x724cb4000d90[pid=108114 tid=125673985705728] task-2:start: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673985705728] task-3:start: context_id=1 slot_addr=0x724cb8000d90

[pid=108114 tid=125673994098432] task-1:start: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673985705728] task-4:start: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673994098432] task-2:start: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673994098432] task-3:start: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673994098432] task-4:start: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673985705728] task-0:after_sleep_0.02: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673994098432] task-0:after_sleep_0.02: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673985705728] task-1:after_sleep_0.04: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673994098432] task-1:after_sleep_0.04: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673985705728] reset_context:before: context_id=1 slot_addr=0x724cb8000d90
[pid=108114 tid=125673985705728] reset_context:after: context_id=1 slot_addr=0x0
[pid=108114 tid=125673994098432] reset_context:before: context_id=0 slot_addr=0x724cb4000d90
[pid=108114 tid=125673994098432] reset_context:after: context_id=0 slot_addr=0x0
[pid=108114 tid=125673985705728] task-2:after_sleep_0.06: context_id=1 slot_addr=0x0[pid=108114 tid=125673994098432] task-2:after_sleep_0.06: context_id=0 slot_addr=0x0

[pid=108114 tid=125673985705728] task-3:after_sleep_0.08: context_id=1 slot_addr=0x0
[pid=108114 tid=125673994098432] task-3:after_sleep_0.08: context_id=0 slot_addr=0x0
[pid=108114 tid=125673994098432] task-4:after_sleep_0.1: context_id=0 slot_addr=0x0[pid=108114 tid=125673985705728] task-4:after_sleep_0.1: context_id=1 slot_addr=0x0

[pid=108114 tid=125673985705728] workflow:done: context_id=1 slot_addr=0x0
[pid=108114 tid=125673994098432] workflow:done: context_id=0 slot_addr=0x0
[pid=108114 tid=125673994098432] thread-0:exit: context_id=None slot_addr=0x0
[pid=108114 tid=125673985705728] thread-1:exit: context_id=None slot_addr=0x0
[pid=108114 tid=125674768054080] process-0:exit: context_id=None slot_addr=0x0

Benchmarks

  1. Low-level primitives (gist): https://gist.github.com/avara1986/ee247788c80901d85a60d5173ecfc370
Operation                           Avg time (us)
-------------------------------------------------
init.create_tainting_map            0.5
init.get_tainting_map*x1000         72.2
init.reset_context                  0.2
ctx.create_context_array            0.2
ctx.get_taint_map_by_ctx_id*x1000   173.9
ctx.reset_context                   0.4

Note: direct get-by-id shows overhead vs thread-local, but real code requires context association anyway.

  1. End-to-end taint/propagate/delete (gist): https://gist.github.com/avara1986/d586e17375d7510d92462fe115749445
Running with n_iters=100000
[OLD WAY taint_pyobject/is_pyobject_tainted] taint: 0.733557s  is(tainted): 0.030582s  is(untainted): 0.026595s
[NEW WAY taint_pyobject_new/is_pyobject_tainted_new] taint: 0.702725s  is(tainted): 0.030617s  is(untainted): 0.025490s

Follow-ups

  • Integrate ContextVar-based context usage broadly across IAST paths.
  • Expand tests for mixed thread + asyncio scenarios within web frameworks.
  • Monitor performance in real services; tune ContextVar/index lookup if needed.

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

@avara1986 avara1986 added the ASM Application Security Monitoring label Sep 2, 2025
Copy link
Contributor

github-actions bot commented Sep 2, 2025

CODEOWNERS have been resolved as:

ddtrace/appsec/_iast/_taint_tracking/context/_application_context.h     @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/context/application_context.cpp    @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/context/application_context.h      @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/tests/test_application_context.cpp  @DataDog/asm-python
.gitignore                                                              @DataDog/apm-core-python
ddtrace/appsec/_iast/_iast_request_context_base.py                      @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/CMakeLists.txt                     @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/__init__.py                        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_taint_objects.py                  @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_taint_objects_base.py             @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/clean.sh                           @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/initializer/initializer.cpp        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/initializer/initializer.h          @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/native.cpp                         @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/taint_tracking/taint_range.cpp     @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/taint_tracking/taint_range.h       @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/taint_tracking/taint_tracking.h    @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/taint_tracking/tainted_object.cpp  @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/taint_tracking/tainted_object.h    @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/tainted_ops/tainted_ops.cpp        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/tainted_ops/tainted_ops.h          @DataDog/asm-python
tests/appsec/iast/taint_tracking/test_native_taint_range.py             @DataDog/asm-python
tests/appsec/iast_memcheck/test_iast_mem_check.py                       @DataDog/asm-python

@avara1986 avara1986 added the changelog/no-changelog A changelog entry is not required for this PR. label Sep 2, 2025
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

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

The average import time from base is: 271 ± 2 ms.

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

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.034 ms (0.75%)
ddtrace.bootstrap.sitecustomize 1.357 ms (0.50%)
ddtrace.bootstrap.preload 1.357 ms (0.50%)
ddtrace.internal.remoteconfig.client 0.640 ms (0.24%)
ddtrace 0.677 ms (0.25%)
ddtrace.internal._unpatched 0.030 ms (0.01%)
json 0.030 ms (0.01%)
json.decoder 0.030 ms (0.01%)
re 0.030 ms (0.01%)
enum 0.030 ms (0.01%)
types 0.030 ms (0.01%)

@avara1986 avara1986 marked this pull request as ready for review September 2, 2025 14:21
@avara1986 avara1986 requested a review from a team as a code owner September 2, 2025 14:21
@pr-commenter
Copy link

pr-commenter bot commented Sep 2, 2025

Performance SLOs

Candidate: avara1986/APPSEC-58122_context_refactor (f04f0a4)

🔵 No Baseline Data (24 suites)
🔵 coreapiscenario - 12/12 (2 unstable)

🔵 No baseline data available for this suite

⚠️ context_with_data_listeners

Time: ⚠️ 13.399µs (SLO: <20.000µs 📉 -33.0%)

Memory: ✅ 31.221MB (SLO: <33.500MB -6.8%)


✅ context_with_data_no_listeners

Time: ✅ 3.436µs (SLO: <10.000µs 📉 -65.6%)

Memory: ✅ 31.300MB (SLO: <33.500MB -6.6%)


⚠️ context_with_data_only_all_listeners

Time: ⚠️ 13.396µs (SLO: <20.000µs 📉 -33.0%)

Memory: ✅ 31.320MB (SLO: <33.500MB -6.5%)


✅ get_item_exists

Time: ✅ 0.585µs (SLO: <10.000µs 📉 -94.2%)

Memory: ✅ 31.320MB (SLO: <33.500MB -6.5%)


✅ get_item_missing

Time: ✅ 0.641µs (SLO: <10.000µs 📉 -93.6%)

Memory: ✅ 31.320MB (SLO: <33.500MB -6.5%)


✅ set_item

Time: ✅ 24.810µs (SLO: <30.000µs 📉 -17.3%)

Memory: ✅ 31.320MB (SLO: <33.500MB -6.5%)


🔵 djangosimple - 26/26

🔵 No baseline data available for this suite

✅ appsec

Time: ✅ 20.617ms (SLO: <22.300ms -7.5%)

Memory: ✅ 64.291MB (SLO: <66.000MB -2.6%)


✅ exception-replay-enabled

Time: ✅ 1.365ms (SLO: <1.450ms -5.8%)

Memory: ✅ 63.249MB (SLO: <66.000MB -4.2%)


✅ iast

Time: ✅ 20.674ms (SLO: <22.250ms -7.1%)

Memory: ✅ 64.251MB (SLO: <66.000MB -2.6%)


✅ profiler

Time: ✅ 15.208ms (SLO: <16.550ms -8.1%)

Memory: ✅ 52.643MB (SLO: <53.500MB 🟡 -1.6%)


✅ span-code-origin

Time: ✅ 26.221ms (SLO: <28.200ms -7.0%)

Memory: ✅ 66.365MB (SLO: <68.500MB -3.1%)


✅ tracer

Time: ✅ 20.669ms (SLO: <21.750ms -5.0%)

Memory: ✅ 64.350MB (SLO: <66.000MB -2.5%)


✅ tracer-and-profiler

Time: ✅ 22.272ms (SLO: <23.500ms -5.2%)

Memory: ✅ 65.292MB (SLO: <67.000MB -2.5%)


✅ tracer-dont-create-db-spans

Time: ✅ 19.526ms (SLO: <21.500ms -9.2%)

Memory: ✅ 64.330MB (SLO: <66.000MB -2.5%)


✅ tracer-native

Time: ✅ 20.688ms (SLO: <21.750ms -4.9%)

Memory: ✅ 65.549MB (SLO: <66.000MB 🟡 -0.7%)


✅ tracer-no-caches

Time: ✅ 18.555ms (SLO: <19.650ms -5.6%)

Memory: ✅ 64.173MB (SLO: <66.000MB -2.8%)


✅ tracer-no-databases

Time: ✅ 18.951ms (SLO: <20.100ms -5.7%)

Memory: ✅ 63.917MB (SLO: <66.000MB -3.2%)


✅ tracer-no-middleware

Time: ✅ 20.365ms (SLO: <21.500ms -5.3%)

Memory: ✅ 64.310MB (SLO: <66.000MB -2.6%)


✅ tracer-no-templates

Time: ✅ 20.490ms (SLO: <22.000ms -6.9%)

Memory: ✅ 64.310MB (SLO: <66.000MB -2.6%)


🔵 errortrackingdjangosimple - 6/6

🔵 No baseline data available for this suite

✅ errortracking-enabled-all

Time: ✅ 18.206ms (SLO: <19.850ms -8.3%)

Memory: ✅ 63.956MB (SLO: <65.500MB -2.4%)


✅ errortracking-enabled-user

Time: ✅ 18.162ms (SLO: <19.400ms -6.4%)

Memory: ✅ 63.937MB (SLO: <65.500MB -2.4%)


✅ tracer-enabled

Time: ✅ 18.116ms (SLO: <19.450ms -6.9%)

Memory: ✅ 64.104MB (SLO: <65.500MB -2.1%)


🔵 errortrackingflasksqli - 6/6

🔵 No baseline data available for this suite

✅ errortracking-enabled-all

Time: ✅ 2.111ms (SLO: <2.300ms -8.2%)

Memory: ✅ 51.006MB (SLO: <53.500MB -4.7%)


✅ errortracking-enabled-user

Time: ✅ 2.115ms (SLO: <2.250ms -6.0%)

Memory: ✅ 50.951MB (SLO: <53.500MB -4.8%)


✅ tracer-enabled

Time: ✅ 2.108ms (SLO: <2.300ms -8.4%)

Memory: ✅ 51.064MB (SLO: <53.500MB -4.6%)


🔵 flasksimple - 17/17

🔵 No baseline data available for this suite

✅ appsec-get

Time: ✅ 4.586ms (SLO: <4.750ms -3.5%)

Memory: ✅ 61.696MB (SLO: <64.500MB -4.3%)


✅ appsec-post

Time: ✅ 6.593ms (SLO: <6.750ms -2.3%)

Memory: ✅ 62.167MB (SLO: <64.500MB -3.6%)


✅ appsec-telemetry

Time: ✅ 4.589ms (SLO: <4.750ms -3.4%)

Memory: ✅ 61.755MB (SLO: <64.500MB -4.3%)


✅ debugger

Time: ✅ 1.859ms (SLO: <2.000ms -7.1%)

Memory: ✅ 44.551MB (SLO: <45.000MB 🟡 -1.0%)


✅ iast-get

Time: ✅ 1.857ms (SLO: <2.000ms -7.1%)

Memory: ✅ 41.563MB (SLO: <49.000MB 📉 -15.2%)


✅ profiler

Time: ✅ 1.919ms (SLO: <2.100ms -8.6%)

Memory: ✅ 44.237MB (SLO: <46.500MB -4.9%)


✅ tracer

Time: ✅ 3.380ms (SLO: <3.650ms -7.4%)

Memory: ✅ 51.177MB (SLO: <53.500MB -4.3%)


✅ tracer-native

Time: ✅ 3.382ms (SLO: <3.650ms -7.3%)

Memory: ✅ 52.435MB (SLO: <53.500MB 🟡 -2.0%)


🔵 flasksqli - 6/6

🔵 No baseline data available for this suite

✅ appsec-enabled

Time: ✅ 3.962ms (SLO: <4.200ms -5.7%)

Memory: ✅ 62.097MB (SLO: <66.000MB -5.9%)


✅ iast-enabled

Time: ✅ 2.520ms (SLO: <2.800ms 📉 -10.0%)

Memory: ✅ 57.693MB (SLO: <59.000MB -2.2%)


✅ tracer-enabled

Time: ✅ 2.095ms (SLO: <2.250ms -6.9%)

Memory: ✅ 51.069MB (SLO: <53.500MB -4.5%)


🔵 httppropagationextract - 60/60

🔵 No baseline data available for this suite

✅ all_styles_all_headers

Time: ✅ 81.012µs (SLO: <100.000µs 📉 -19.0%)

Memory: ✅ 31.359MB (SLO: <33.500MB -6.4%)


✅ b3_headers

Time: ✅ 14.235µs (SLO: <20.000µs 📉 -28.8%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ b3_single_headers

Time: ✅ 13.445µs (SLO: <20.000µs 📉 -32.8%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ datadog_tracecontext_tracestate_not_propagated_on_trace_id_no_match

Time: ✅ 64.088µs (SLO: <80.000µs 📉 -19.9%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ datadog_tracecontext_tracestate_propagated_on_trace_id_match

Time: ✅ 66.759µs (SLO: <80.000µs 📉 -16.6%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ empty_headers

Time: ✅ 1.587µs (SLO: <10.000µs 📉 -84.1%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ full_t_id_datadog_headers

Time: ✅ 22.870µs (SLO: <30.000µs 📉 -23.8%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ invalid_priority_header

Time: ✅ 6.536µs (SLO: <10.000µs 📉 -34.6%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ invalid_span_id_header

Time: ✅ 6.538µs (SLO: <10.000µs 📉 -34.6%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ invalid_tags_header

Time: ✅ 6.530µs (SLO: <10.000µs 📉 -34.7%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ invalid_trace_id_header

Time: ✅ 6.531µs (SLO: <10.000µs 📉 -34.7%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ large_header_no_matches

Time: ✅ 27.485µs (SLO: <30.000µs -8.4%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ large_valid_headers_all

Time: ✅ 28.725µs (SLO: <40.000µs 📉 -28.2%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ medium_header_no_matches

Time: ✅ 9.869µs (SLO: <20.000µs 📉 -50.7%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ medium_valid_headers_all

Time: ✅ 11.347µs (SLO: <20.000µs 📉 -43.3%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ none_propagation_style

Time: ✅ 1.710µs (SLO: <10.000µs 📉 -82.9%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ tracecontext_headers

Time: ✅ 34.661µs (SLO: <40.000µs 📉 -13.3%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ valid_headers_all

Time: ✅ 6.567µs (SLO: <10.000µs 📉 -34.3%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ valid_headers_basic

Time: ✅ 6.125µs (SLO: <10.000µs 📉 -38.8%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ wsgi_empty_headers

Time: ✅ 1.608µs (SLO: <10.000µs 📉 -83.9%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ wsgi_invalid_priority_header

Time: ✅ 6.638µs (SLO: <10.000µs 📉 -33.6%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ wsgi_invalid_span_id_header

Time: ✅ 1.596µs (SLO: <10.000µs 📉 -84.0%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ wsgi_invalid_tags_header

Time: ✅ 6.644µs (SLO: <10.000µs 📉 -33.6%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ wsgi_invalid_trace_id_header

Time: ✅ 6.650µs (SLO: <10.000µs 📉 -33.5%)

Memory: ✅ 31.359MB (SLO: <33.500MB -6.4%)


✅ wsgi_large_header_no_matches

Time: ✅ 28.581µs (SLO: <40.000µs 📉 -28.5%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ wsgi_large_valid_headers_all

Time: ✅ 29.704µs (SLO: <40.000µs 📉 -25.7%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ wsgi_medium_header_no_matches

Time: ✅ 10.185µs (SLO: <20.000µs 📉 -49.1%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ wsgi_medium_valid_headers_all

Time: ✅ 11.639µs (SLO: <20.000µs 📉 -41.8%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ wsgi_valid_headers_all

Time: ✅ 6.573µs (SLO: <10.000µs 📉 -34.3%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


✅ wsgi_valid_headers_basic

Time: ✅ 6.137µs (SLO: <10.000µs 📉 -38.6%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


🔵 httppropagationinject - 16/16

🔵 No baseline data available for this suite

✅ ids_only

Time: ✅ 21.921µs (SLO: <30.000µs 📉 -26.9%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ with_all

Time: ✅ 34.744µs (SLO: <40.000µs 📉 -13.1%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ with_dd_origin

Time: ✅ 28.998µs (SLO: <30.000µs -3.3%)

Memory: ✅ 31.457MB (SLO: <33.500MB -6.1%)


✅ with_priority_and_origin

Time: ✅ 28.103µs (SLO: <40.000µs 📉 -29.7%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ with_sampling_priority

Time: ✅ 22.015µs (SLO: <30.000µs 📉 -26.6%)

Memory: ✅ 31.438MB (SLO: <33.500MB -6.2%)


✅ with_tags

Time: ✅ 30.662µs (SLO: <40.000µs 📉 -23.3%)

Memory: ✅ 31.379MB (SLO: <33.500MB -6.3%)


✅ with_tags_invalid

Time: ✅ 34.124µs (SLO: <40.000µs 📉 -14.7%)

Memory: ✅ 31.418MB (SLO: <33.500MB -6.2%)


✅ with_tags_max_size

Time: ✅ 31.531µs (SLO: <40.000µs 📉 -21.2%)

Memory: ✅ 31.398MB (SLO: <33.500MB -6.3%)


🔵 iast_aspects - 40/40

🔵 No baseline data available for this suite

✅ re_expand_aspect

Time: ✅ 31.601µs (SLO: <40.000µs 📉 -21.0%)

Memory: ✅ 37.297MB (SLO: <39.000MB -4.4%)


✅ re_expand_noaspect

Time: ✅ 29.222µs (SLO: <40.000µs 📉 -26.9%)

Memory: ✅ 36.982MB (SLO: <39.000MB -5.2%)


✅ re_findall_aspect

Time: ✅ 3.690µs (SLO: <10.000µs 📉 -63.1%)

Memory: ✅ 36.726MB (SLO: <39.000MB -5.8%)


✅ re_findall_noaspect

Time: ✅ 1.415µs (SLO: <10.000µs 📉 -85.8%)

Memory: ✅ 36.785MB (SLO: <39.000MB -5.7%)


✅ re_finditer_aspect

Time: ✅ 4.442µs (SLO: <10.000µs 📉 -55.6%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ re_finditer_noaspect

Time: ✅ 1.415µs (SLO: <10.000µs 📉 -85.8%)

Memory: ✅ 36.805MB (SLO: <39.000MB -5.6%)


✅ re_fullmatch_aspect

Time: ✅ 2.669µs (SLO: <10.000µs 📉 -73.3%)

Memory: ✅ 36.785MB (SLO: <39.000MB -5.7%)


✅ re_fullmatch_noaspect

Time: ✅ 1.300µs (SLO: <10.000µs 📉 -87.0%)

Memory: ✅ 36.825MB (SLO: <39.000MB -5.6%)


✅ re_group_aspect

Time: ✅ 2.981µs (SLO: <10.000µs 📉 -70.2%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ re_group_noaspect

Time: ✅ 1.602µs (SLO: <10.000µs 📉 -84.0%)

Memory: ✅ 36.844MB (SLO: <39.000MB -5.5%)


✅ re_groups_aspect

Time: ✅ 3.114µs (SLO: <10.000µs 📉 -68.9%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ re_groups_noaspect

Time: ✅ 1.702µs (SLO: <10.000µs 📉 -83.0%)

Memory: ✅ 37.061MB (SLO: <39.000MB -5.0%)


✅ re_match_aspect

Time: ✅ 2.715µs (SLO: <10.000µs 📉 -72.8%)

Memory: ✅ 37.041MB (SLO: <39.000MB -5.0%)


✅ re_match_noaspect

Time: ✅ 1.311µs (SLO: <10.000µs 📉 -86.9%)

Memory: ✅ 36.864MB (SLO: <39.000MB -5.5%)


✅ re_search_aspect

Time: ✅ 2.562µs (SLO: <10.000µs 📉 -74.4%)

Memory: ✅ 36.962MB (SLO: <39.000MB -5.2%)


✅ re_search_noaspect

Time: ✅ 1.194µs (SLO: <10.000µs 📉 -88.1%)

Memory: ✅ 36.825MB (SLO: <39.000MB -5.6%)


✅ re_sub_aspect

Time: ✅ 3.406µs (SLO: <10.000µs 📉 -65.9%)

Memory: ✅ 36.825MB (SLO: <39.000MB -5.6%)


✅ re_sub_noaspect

Time: ✅ 1.531µs (SLO: <10.000µs 📉 -84.7%)

Memory: ✅ 36.864MB (SLO: <39.000MB -5.5%)


✅ re_subn_aspect

Time: ✅ 3.600µs (SLO: <10.000µs 📉 -64.0%)

Memory: ✅ 36.884MB (SLO: <39.000MB -5.4%)


✅ re_subn_noaspect

Time: ✅ 1.597µs (SLO: <10.000µs 📉 -84.0%)

Memory: ✅ 36.825MB (SLO: <39.000MB -5.6%)


🔵 iastaspects - 118/118

🔵 No baseline data available for this suite

✅ add_aspect

Time: ✅ 0.328µs (SLO: <10.000µs 📉 -96.7%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ add_inplace_aspect

Time: ✅ 0.331µs (SLO: <10.000µs 📉 -96.7%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ add_inplace_noaspect

Time: ✅ 0.319µs (SLO: <10.000µs 📉 -96.8%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ add_noaspect

Time: ✅ 0.277µs (SLO: <10.000µs 📉 -97.2%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ bytearray_aspect

Time: ✅ 1.324µs (SLO: <10.000µs 📉 -86.8%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ bytearray_extend_aspect

Time: ✅ 1.381µs (SLO: <10.000µs 📉 -86.2%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ bytearray_extend_noaspect

Time: ✅ 0.613µs (SLO: <10.000µs 📉 -93.9%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ bytearray_noaspect

Time: ✅ 0.482µs (SLO: <10.000µs 📉 -95.2%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ bytes_aspect

Time: ✅ 1.382µs (SLO: <10.000µs 📉 -86.2%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ bytes_noaspect

Time: ✅ 0.490µs (SLO: <10.000µs 📉 -95.1%)

Memory: ✅ 37.297MB (SLO: <39.000MB -4.4%)


✅ bytesio_aspect

Time: ✅ 1.327µs (SLO: <10.000µs 📉 -86.7%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ bytesio_noaspect

Time: ✅ 0.500µs (SLO: <10.000µs 📉 -95.0%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ capitalize_aspect

Time: ✅ 0.736µs (SLO: <10.000µs 📉 -92.6%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ capitalize_noaspect

Time: ✅ 0.431µs (SLO: <10.000µs 📉 -95.7%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ casefold_aspect

Time: ✅ 0.743µs (SLO: <10.000µs 📉 -92.6%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ casefold_noaspect

Time: ✅ 0.372µs (SLO: <10.000µs 📉 -96.3%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ decode_aspect

Time: ✅ 0.727µs (SLO: <10.000µs 📉 -92.7%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ decode_noaspect

Time: ✅ 0.421µs (SLO: <10.000µs 📉 -95.8%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ encode_aspect

Time: ✅ 0.708µs (SLO: <10.000µs 📉 -92.9%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ encode_noaspect

Time: ✅ 0.400µs (SLO: <10.000µs 📉 -96.0%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ format_aspect

Time: ✅ 3.784µs (SLO: <10.000µs 📉 -62.2%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ format_map_aspect

Time: ✅ 3.152µs (SLO: <10.000µs 📉 -68.5%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ format_map_noaspect

Time: ✅ 0.777µs (SLO: <10.000µs 📉 -92.2%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ format_noaspect

Time: ✅ 0.595µs (SLO: <10.000µs 📉 -94.0%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ index_aspect

Time: ✅ 0.348µs (SLO: <10.000µs 📉 -96.5%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ index_noaspect

Time: ✅ 0.281µs (SLO: <10.000µs 📉 -97.2%)

Memory: ✅ 37.336MB (SLO: <39.000MB -4.3%)


✅ join_aspect

Time: ✅ 1.230µs (SLO: <10.000µs 📉 -87.7%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ join_noaspect

Time: ✅ 0.488µs (SLO: <10.000µs 📉 -95.1%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ ljust_aspect

Time: ✅ 10.183µs (SLO: <20.000µs 📉 -49.1%)

Memory: ✅ 37.356MB (SLO: <39.000MB -4.2%)


✅ ljust_noaspect

Time: ✅ 0.400µs (SLO: <10.000µs 📉 -96.0%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ lower_aspect

Time: ✅ 2.259µs (SLO: <10.000µs 📉 -77.4%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ lower_noaspect

Time: ✅ 0.368µs (SLO: <10.000µs 📉 -96.3%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ lstrip_aspect

Time: ✅ 10.938µs (SLO: <20.000µs 📉 -45.3%)

Memory: ✅ 37.356MB (SLO: <39.000MB -4.2%)


✅ lstrip_noaspect

Time: ✅ 0.386µs (SLO: <10.000µs 📉 -96.1%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ modulo_aspect

Time: ✅ 0.930µs (SLO: <10.000µs 📉 -90.7%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ modulo_aspect_for_bytearray_bytearray

Time: ✅ 1.437µs (SLO: <10.000µs 📉 -85.6%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ modulo_aspect_for_bytes

Time: ✅ 0.904µs (SLO: <10.000µs 📉 -91.0%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ modulo_aspect_for_bytes_bytearray

Time: ✅ 1.129µs (SLO: <10.000µs 📉 -88.7%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ modulo_noaspect

Time: ✅ 0.623µs (SLO: <10.000µs 📉 -93.8%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ replace_aspect

Time: ✅ 4.622µs (SLO: <10.000µs 📉 -53.8%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ replace_noaspect

Time: ✅ 0.460µs (SLO: <10.000µs 📉 -95.4%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ repr_aspect

Time: ✅ 0.904µs (SLO: <10.000µs 📉 -91.0%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ repr_noaspect

Time: ✅ 0.418µs (SLO: <10.000µs 📉 -95.8%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ rstrip_aspect

Time: ✅ 10.187µs (SLO: <20.000µs 📉 -49.1%)

Memory: ✅ 37.356MB (SLO: <39.000MB -4.2%)


✅ rstrip_noaspect

Time: ✅ 0.380µs (SLO: <10.000µs 📉 -96.2%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ slice_aspect

Time: ✅ 0.479µs (SLO: <10.000µs 📉 -95.2%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ slice_noaspect

Time: ✅ 0.450µs (SLO: <10.000µs 📉 -95.5%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ stringio_aspect

Time: ✅ 1.552µs (SLO: <10.000µs 📉 -84.5%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ stringio_noaspect

Time: ✅ 0.724µs (SLO: <10.000µs 📉 -92.8%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


✅ strip_aspect

Time: ✅ 10.288µs (SLO: <20.000µs 📉 -48.6%)

Memory: ✅ 37.356MB (SLO: <39.000MB -4.2%)


✅ strip_noaspect

Time: ✅ 0.386µs (SLO: <10.000µs 📉 -96.1%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ swapcase_aspect

Time: ✅ 2.495µs (SLO: <10.000µs 📉 -75.1%)

Memory: ✅ 37.316MB (SLO: <39.000MB -4.3%)


✅ swapcase_noaspect

Time: ✅ 0.532µs (SLO: <10.000µs 📉 -94.7%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ title_aspect

Time: ✅ 2.406µs (SLO: <10.000µs 📉 -75.9%)

Memory: ✅ 37.159MB (SLO: <39.000MB -4.7%)


✅ title_noaspect

Time: ✅ 0.502µs (SLO: <10.000µs 📉 -95.0%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ translate_aspect

Time: ✅ 3.360µs (SLO: <10.000µs 📉 -66.4%)

Memory: ✅ 37.297MB (SLO: <39.000MB -4.4%)


✅ translate_noaspect

Time: ✅ 1.041µs (SLO: <10.000µs 📉 -89.6%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ upper_aspect

Time: ✅ 2.512µs (SLO: <10.000µs 📉 -74.9%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ upper_noaspect

Time: ✅ 0.368µs (SLO: <10.000µs 📉 -96.3%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


🔵 iastaspectsospath - 24/24

🔵 No baseline data available for this suite

✅ ospathbasename_aspect

Time: ✅ 4.132µs (SLO: <10.000µs 📉 -58.7%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ ospathbasename_noaspect

Time: ✅ 1.079µs (SLO: <10.000µs 📉 -89.2%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ ospathjoin_aspect

Time: ✅ 6.087µs (SLO: <10.000µs 📉 -39.1%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ ospathjoin_noaspect

Time: ✅ 2.293µs (SLO: <10.000µs 📉 -77.1%)

Memory: ✅ 37.179MB (SLO: <39.000MB -4.7%)


✅ ospathnormcase_aspect

Time: ✅ 3.388µs (SLO: <10.000µs 📉 -66.1%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ ospathnormcase_noaspect

Time: ✅ 0.566µs (SLO: <10.000µs 📉 -94.3%)

Memory: ✅ 37.277MB (SLO: <39.000MB -4.4%)


✅ ospathsplit_aspect

Time: ✅ 4.799µs (SLO: <10.000µs 📉 -52.0%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ ospathsplit_noaspect

Time: ✅ 1.592µs (SLO: <10.000µs 📉 -84.1%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ ospathsplitdrive_aspect

Time: ✅ 3.551µs (SLO: <10.000µs 📉 -64.5%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ ospathsplitdrive_noaspect

Time: ✅ 0.695µs (SLO: <10.000µs 📉 -93.0%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ ospathsplitext_aspect

Time: ✅ 4.488µs (SLO: <10.000µs 📉 -55.1%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ ospathsplitext_noaspect

Time: ✅ 1.377µs (SLO: <10.000µs 📉 -86.2%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


🔵 iastaspectssplit - 12/12

🔵 No baseline data available for this suite

✅ rsplit_aspect

Time: ✅ 1.587µs (SLO: <10.000µs 📉 -84.1%)

Memory: ✅ 37.257MB (SLO: <39.000MB -4.5%)


✅ rsplit_noaspect

Time: ✅ 0.576µs (SLO: <10.000µs 📉 -94.2%)

Memory: ✅ 36.943MB (SLO: <39.000MB -5.3%)


✅ split_aspect

Time: ✅ 1.492µs (SLO: <10.000µs 📉 -85.1%)

Memory: ✅ 37.238MB (SLO: <39.000MB -4.5%)


✅ split_noaspect

Time: ✅ 0.568µs (SLO: <10.000µs 📉 -94.3%)

Memory: ✅ 36.982MB (SLO: <39.000MB -5.2%)


✅ splitlines_aspect

Time: ✅ 1.433µs (SLO: <10.000µs 📉 -85.7%)

Memory: ✅ 37.218MB (SLO: <39.000MB -4.6%)


✅ splitlines_noaspect

Time: ✅ 0.585µs (SLO: <10.000µs 📉 -94.2%)

Memory: ✅ 37.198MB (SLO: <39.000MB -4.6%)


🔵 iastpropagation - 8/8

🔵 No baseline data available for this suite

✅ no-propagation

Time: ✅ 48.751µs (SLO: <60.000µs 📉 -18.7%)

Memory: ✅ 36.667MB (SLO: <39.000MB -6.0%)


✅ propagation_enabled

Time: ✅ 144.043µs (SLO: <160.000µs -10.0%)

Memory: ✅ 36.903MB (SLO: <39.000MB -5.4%)


✅ propagation_enabled_100

Time: ✅ 1.615ms (SLO: <1.800ms 📉 -10.3%)

Memory: ✅ 36.844MB (SLO: <39.000MB -5.5%)


✅ propagation_enabled_1000

Time: ✅ 29.491ms (SLO: <30.550ms -3.5%)

Memory: ✅ 36.844MB (SLO: <39.000MB -5.5%)


🔵 otelsdkspan - 24/24

🔵 No baseline data available for this suite

✅ add-event

Time: ✅ 40.601ms (SLO: <42.000ms -3.3%)

Memory: ✅ 34.190MB (SLO: <39.000MB 📉 -12.3%)


✅ add-link

Time: ✅ 36.300ms (SLO: <38.550ms -5.8%)

Memory: ✅ 34.151MB (SLO: <39.000MB 📉 -12.4%)


✅ add-metrics

Time: ✅ 219.176ms (SLO: <232.000ms -5.5%)

Memory: ✅ 34.151MB (SLO: <39.000MB 📉 -12.4%)


✅ add-tags

Time: ✅ 212.628ms (SLO: <221.600ms -4.0%)

Memory: ✅ 34.151MB (SLO: <39.000MB 📉 -12.4%)


✅ get-context

Time: ✅ 29.024ms (SLO: <31.300ms -7.3%)

Memory: ✅ 34.210MB (SLO: <39.000MB 📉 -12.3%)


✅ is-recording

Time: ✅ 29.041ms (SLO: <31.000ms -6.3%)

Memory: ✅ 34.170MB (SLO: <39.000MB 📉 -12.4%)


✅ record-exception

Time: ✅ 62.989ms (SLO: <65.850ms -4.3%)

Memory: ✅ 34.210MB (SLO: <39.000MB 📉 -12.3%)


✅ set-status

Time: ✅ 31.968ms (SLO: <34.150ms -6.4%)

Memory: ✅ 34.170MB (SLO: <39.000MB 📉 -12.4%)


✅ start

Time: ✅ 28.812ms (SLO: <30.150ms -4.4%)

Memory: ✅ 34.170MB (SLO: <39.000MB 📉 -12.4%)


✅ start-finish

Time: ✅ 33.834ms (SLO: <35.350ms -4.3%)

Memory: ✅ 34.111MB (SLO: <39.000MB 📉 -12.5%)


✅ start-finish-telemetry

Time: ✅ 33.936ms (SLO: <35.450ms -4.3%)

Memory: ✅ 34.210MB (SLO: <39.000MB 📉 -12.3%)


✅ update-name

Time: ✅ 31.082ms (SLO: <33.400ms -6.9%)

Memory: ✅ 34.170MB (SLO: <39.000MB 📉 -12.4%)


🔵 otelspan - 22/22

🔵 No baseline data available for this suite

✅ add-event

Time: ✅ 45.214ms (SLO: <47.150ms -4.1%)

Memory: ✅ 44.450MB (SLO: <46.500MB -4.4%)


✅ add-metrics

Time: ✅ 323.198ms (SLO: <344.800ms -6.3%)

Memory: ✅ 553.239MB (SLO: <562.000MB 🟡 -1.6%)


✅ add-tags

Time: ✅ 291.214ms (SLO: <314.000ms -7.3%)

Memory: ✅ 560.144MB (SLO: <563.500MB 🟡 -0.6%)


✅ get-context

Time: ✅ 85.600ms (SLO: <92.350ms -7.3%)

Memory: ✅ 39.626MB (SLO: <46.500MB 📉 -14.8%)


✅ is-recording

Time: ✅ 43.278ms (SLO: <44.500ms -2.7%)

Memory: ✅ 43.870MB (SLO: <46.500MB -5.7%)


✅ record-exception

Time: ✅ 62.004ms (SLO: <67.650ms -8.3%)

Memory: ✅ 39.908MB (SLO: <46.500MB 📉 -14.2%)


✅ set-status

Time: ✅ 48.961ms (SLO: <50.400ms -2.9%)

Memory: ✅ 43.791MB (SLO: <46.500MB -5.8%)


✅ start

Time: ✅ 42.379ms (SLO: <43.450ms -2.5%)

Memory: ✅ 43.784MB (SLO: <46.500MB -5.8%)


✅ start-finish

Time: ✅ 82.250ms (SLO: <88.000ms -6.5%)

Memory: ✅ 33.777MB (SLO: <46.500MB 📉 -27.4%)


✅ start-finish-telemetry

Time: ✅ 85.449ms (SLO: <89.000ms -4.0%)

Memory: ✅ 33.777MB (SLO: <46.500MB 📉 -27.4%)


✅ update-name

Time: ✅ 45.024ms (SLO: <45.150ms 🟡 -0.3%)

Memory: ✅ 44.126MB (SLO: <46.500MB -5.1%)


🔵 packagespackageforrootmodulemapping - 4/4

🔵 No baseline data available for this suite

✅ cache_off

Time: ✅ 342.540ms (SLO: <354.300ms -3.3%)

Memory: ✅ 36.915MB (SLO: <40.000MB -7.7%)


✅ cache_on

Time: ✅ 0.387µs (SLO: <10.000µs 📉 -96.1%)

Memory: ✅ 35.210MB (SLO: <39.000MB -9.7%)


🔵 packagesupdateimporteddependencies - 24/24

🔵 No baseline data available for this suite

✅ import_many

Time: ✅ 154.716µs (SLO: <170.000µs -9.0%)

Memory: ✅ 36.058MB (SLO: <38.500MB -6.3%)


✅ import_many_cached

Time: ✅ 120.765µs (SLO: <130.000µs -7.1%)

Memory: ✅ 35.902MB (SLO: <38.500MB -6.7%)


✅ import_many_stdlib

Time: ✅ 1.609ms (SLO: <1.750ms -8.0%)

Memory: ✅ 36.096MB (SLO: <38.500MB -6.2%)


✅ import_many_stdlib_cached

Time: ✅ 0.965ms (SLO: <1.100ms 📉 -12.3%)

Memory: ✅ 35.944MB (SLO: <38.500MB -6.6%)


✅ import_many_unknown

Time: ✅ 824.506µs (SLO: <890.000µs -7.4%)

Memory: ✅ 35.964MB (SLO: <38.500MB -6.6%)


✅ import_many_unknown_cached

Time: ✅ 788.683µs (SLO: <870.000µs -9.3%)

Memory: ✅ 36.311MB (SLO: <38.500MB -5.7%)


✅ import_one

Time: ✅ 19.839µs (SLO: <30.000µs 📉 -33.9%)

Memory: ✅ 35.937MB (SLO: <39.000MB -7.9%)


✅ import_one_cache

Time: ✅ 6.288µs (SLO: <10.000µs 📉 -37.1%)

Memory: ✅ 35.974MB (SLO: <38.500MB -6.6%)


✅ import_one_stdlib

Time: ✅ 18.807µs (SLO: <20.000µs -6.0%)

Memory: ✅ 35.838MB (SLO: <38.500MB -6.9%)


✅ import_one_stdlib_cache

Time: ✅ 6.274µs (SLO: <10.000µs 📉 -37.3%)

Memory: ✅ 35.987MB (SLO: <38.500MB -6.5%)


✅ import_one_unknown

Time: ✅ 45.587µs (SLO: <50.000µs -8.8%)

Memory: ✅ 35.963MB (SLO: <38.500MB -6.6%)


✅ import_one_unknown_cache

Time: ✅ 6.283µs (SLO: <10.000µs 📉 -37.2%)

Memory: ✅ 35.988MB (SLO: <38.500MB -6.5%)


🔵 ratelimiter - 12/12

🔵 No baseline data available for this suite

✅ defaults

Time: ✅ 2.343µs (SLO: <10.000µs 📉 -76.6%)

Memory: ✅ 30.985MB (SLO: <34.000MB -8.9%)


✅ high_rate_limit

Time: ✅ 2.411µs (SLO: <10.000µs 📉 -75.9%)

Memory: ✅ 31.044MB (SLO: <34.000MB -8.7%)


✅ long_window

Time: ✅ 2.334µs (SLO: <10.000µs 📉 -76.7%)

Memory: ✅ 30.985MB (SLO: <34.000MB -8.9%)


✅ low_rate_limit

Time: ✅ 2.365µs (SLO: <10.000µs 📉 -76.3%)

Memory: ✅ 30.946MB (SLO: <34.000MB -9.0%)


✅ no_rate_limit

Time: ✅ 0.826µs (SLO: <10.000µs 📉 -91.7%)

Memory: ✅ 30.946MB (SLO: <34.000MB -9.0%)


✅ short_window

Time: ✅ 2.474µs (SLO: <10.000µs 📉 -75.3%)

Memory: ✅ 30.907MB (SLO: <34.000MB -9.1%)


🔵 recursivecomputation - 8/8

🔵 No baseline data available for this suite

✅ deep

Time: ✅ 308.982ms (SLO: <320.950ms -3.7%)

Memory: ✅ 32.421MB (SLO: <34.500MB -6.0%)


✅ deep-profiled

Time: ✅ 326.955ms (SLO: <359.150ms -9.0%)

Memory: ✅ 35.134MB (SLO: <39.000MB -9.9%)


✅ medium

Time: ✅ 7.091ms (SLO: <7.400ms -4.2%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ shallow

Time: ✅ 0.957ms (SLO: <1.050ms -8.8%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


🔵 samplingrules - 8/8

🔵 No baseline data available for this suite

✅ average_match

Time: ✅ 275.413µs (SLO: <290.000µs -5.0%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ high_match

Time: ✅ 447.887µs (SLO: <480.000µs -6.7%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ low_match

Time: ✅ 110.129µs (SLO: <120.000µs -8.2%)

Memory: ✅ 631.739MB (SLO: <700.000MB -9.8%)


✅ very_low_match

Time: ✅ 7.735ms (SLO: <8.500ms -9.0%)

Memory: ✅ 69.473MB (SLO: <75.000MB -7.4%)


🔵 sethttpmeta - 32/32

🔵 No baseline data available for this suite

✅ all-disabled

Time: ✅ 12.171µs (SLO: <20.000µs 📉 -39.1%)

Memory: ✅ 31.811MB (SLO: <34.000MB -6.4%)


✅ all-enabled

Time: ✅ 42.035µs (SLO: <50.000µs 📉 -15.9%)

Memory: ✅ 31.811MB (SLO: <34.000MB -6.4%)


✅ collectipvariant_exists

Time: ✅ 42.942µs (SLO: <50.000µs 📉 -14.1%)

Memory: ✅ 31.831MB (SLO: <34.000MB -6.4%)


✅ no-collectipvariant

Time: ✅ 42.029µs (SLO: <50.000µs 📉 -15.9%)

Memory: ✅ 31.772MB (SLO: <34.000MB -6.6%)


✅ no-useragentvariant

Time: ✅ 40.680µs (SLO: <50.000µs 📉 -18.6%)

Memory: ✅ 31.831MB (SLO: <34.000MB -6.4%)


✅ obfuscation-no-query

Time: ✅ 42.760µs (SLO: <50.000µs 📉 -14.5%)

Memory: ✅ 31.831MB (SLO: <34.000MB -6.4%)


✅ obfuscation-regular-case-explicit-query

Time: ✅ 78.821µs (SLO: <90.000µs 📉 -12.4%)

Memory: ✅ 32.126MB (SLO: <34.000MB -5.5%)


✅ obfuscation-regular-case-implicit-query

Time: ✅ 79.492µs (SLO: <90.000µs 📉 -11.7%)

Memory: ✅ 32.204MB (SLO: <34.000MB -5.3%)


✅ obfuscation-send-querystring-disabled

Time: ✅ 158.210µs (SLO: <170.000µs -6.9%)

Memory: ✅ 32.204MB (SLO: <34.500MB -6.7%)


✅ obfuscation-worst-case-explicit-query

Time: ✅ 151.193µs (SLO: <160.000µs -5.5%)

Memory: ✅ 32.244MB (SLO: <34.500MB -6.5%)


✅ obfuscation-worst-case-implicit-query

Time: ✅ 158.289µs (SLO: <170.000µs -6.9%)

Memory: ✅ 32.185MB (SLO: <34.500MB -6.7%)


✅ useragentvariant_exists_1

Time: ✅ 42.142µs (SLO: <50.000µs 📉 -15.7%)

Memory: ✅ 31.831MB (SLO: <34.000MB -6.4%)


✅ useragentvariant_exists_2

Time: ✅ 42.431µs (SLO: <50.000µs 📉 -15.1%)

Memory: ✅ 31.772MB (SLO: <34.000MB -6.6%)


✅ useragentvariant_exists_3

Time: ✅ 41.785µs (SLO: <50.000µs 📉 -16.4%)

Memory: ✅ 31.792MB (SLO: <34.000MB -6.5%)


✅ useragentvariant_not_exists_1

Time: ✅ 42.000µs (SLO: <50.000µs 📉 -16.0%)

Memory: ✅ 31.811MB (SLO: <34.000MB -6.4%)


✅ useragentvariant_not_exists_2

Time: ✅ 42.104µs (SLO: <50.000µs 📉 -15.8%)

Memory: ✅ 31.850MB (SLO: <34.000MB -6.3%)


🔵 span - 26/26

🔵 No baseline data available for this suite

✅ add-event

Time: ✅ 24.258ms (SLO: <26.200ms -7.4%)

Memory: ✅ 50.895MB (SLO: <53.000MB -4.0%)


✅ add-metrics

Time: ✅ 92.093ms (SLO: <98.350ms -6.4%)

Memory: ✅ 607.188MB (SLO: <961.000MB 📉 -36.8%)


✅ add-tags

Time: ✅ 150.139ms (SLO: <168.550ms 📉 -10.9%)

Memory: ✅ 607.419MB (SLO: <962.500MB 📉 -36.9%)


✅ get-context

Time: ✅ 22.472ms (SLO: <23.700ms -5.2%)

Memory: ✅ 49.636MB (SLO: <53.000MB -6.3%)


✅ is-recording

Time: ✅ 22.657ms (SLO: <23.900ms -5.2%)

Memory: ✅ 49.689MB (SLO: <53.000MB -6.2%)


✅ record-exception

Time: ✅ 42.480ms (SLO: <44.500ms -4.5%)

Memory: ✅ 42.640MB (SLO: <53.000MB 📉 -19.5%)


✅ set-status

Time: ✅ 24.560ms (SLO: <26.000ms -5.5%)

Memory: ✅ 49.632MB (SLO: <53.000MB -6.4%)


✅ start

Time: ✅ 22.503ms (SLO: <23.500ms -4.2%)

Memory: ✅ 49.632MB (SLO: <53.000MB -6.4%)


✅ start-finish

Time: ✅ 51.428ms (SLO: <55.500ms -7.3%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ start-finish-telemetry

Time: ✅ 52.746ms (SLO: <58.300ms -9.5%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ start-finish-traceid128

Time: ✅ 54.974ms (SLO: <60.050ms -8.5%)

Memory: ✅ 31.182MB (SLO: <34.000MB -8.3%)


✅ start-traceid128

Time: ✅ 22.916ms (SLO: <24.600ms -6.8%)

Memory: ✅ 49.656MB (SLO: <53.000MB -6.3%)


✅ update-name

Time: ✅ 23.153ms (SLO: <24.100ms -3.9%)

Memory: ✅ 50.315MB (SLO: <53.000MB -5.1%)


🔵 telemetryaddmetric - 30/30

🔵 No baseline data available for this suite

✅ 1-count-metric-1-times

Time: ✅ 3.126µs (SLO: <20.000µs 📉 -84.4%)

Memory: ✅ 31.320MB (SLO: <34.000MB -7.9%)


✅ 1-count-metrics-100-times

Time: ✅ 219.411µs (SLO: <250.000µs 📉 -12.2%)

Memory: ✅ 31.280MB (SLO: <34.000MB -8.0%)


✅ 1-distribution-metric-1-times

Time: ✅ 2.983µs (SLO: <20.000µs 📉 -85.1%)

Memory: ✅ 31.300MB (SLO: <34.000MB -7.9%)


✅ 1-distribution-metrics-100-times

Time: ✅ 197.614µs (SLO: <220.000µs 📉 -10.2%)

Memory: ✅ 31.300MB (SLO: <34.000MB -7.9%)


✅ 1-gauge-metric-1-times

Time: ✅ 2.143µs (SLO: <20.000µs 📉 -89.3%)

Memory: ✅ 31.300MB (SLO: <34.000MB -7.9%)


✅ 1-gauge-metrics-100-times

Time: ✅ 125.023µs (SLO: <150.000µs 📉 -16.7%)

Memory: ✅ 31.300MB (SLO: <34.000MB -7.9%)


✅ 1-rate-metric-1-times

Time: ✅ 3.150µs (SLO: <20.000µs 📉 -84.2%)

Memory: ✅ 31.143MB (SLO: <34.000MB -8.4%)


✅ 1-rate-metrics-100-times

Time: ✅ 218.993µs (SLO: <250.000µs 📉 -12.4%)

Memory: ✅ 31.261MB (SLO: <34.000MB -8.1%)


✅ 100-count-metrics-100-times

Time: ✅ 22.440ms (SLO: <23.500ms -4.5%)

Memory: ✅ 31.221MB (SLO: <34.000MB -8.2%)


✅ 100-distribution-metrics-100-times

Time: ✅ 2.070ms (SLO: <2.250ms -8.0%)

Memory: ✅ 31.221MB (SLO: <34.000MB -8.2%)


✅ 100-gauge-metrics-100-times

Time: ✅ 1.295ms (SLO: <1.550ms 📉 -16.5%)

Memory: ✅ 31.241MB (SLO: <34.000MB -8.1%)


✅ 100-rate-metrics-100-times

Time: ✅ 2.250ms (SLO: <2.550ms 📉 -11.8%)

Memory: ✅ 31.221MB (SLO: <34.000MB -8.2%)


✅ flush-1-metric

Time: ✅ 4.345µs (SLO: <20.000µs 📉 -78.3%)

Memory: ✅ 31.241MB (SLO: <34.000MB -8.1%)


✅ flush-100-metrics

Time: ✅ 183.795µs (SLO: <250.000µs 📉 -26.5%)

Memory: ✅ 31.693MB (SLO: <34.000MB -6.8%)


✅ flush-1000-metrics

Time: ✅ 2.208ms (SLO: <2.500ms 📉 -11.7%)

Memory: ✅ 32.499MB (SLO: <34.500MB -5.8%)


🔵 tracer - 6/6

🔵 No baseline data available for this suite

✅ large

Time: ✅ 30.459ms (SLO: <32.950ms -7.6%)

Memory: ✅ 32.755MB (SLO: <34.500MB -5.1%)


✅ medium

Time: ✅ 2.988ms (SLO: <3.200ms -6.6%)

Memory: ✅ 31.202MB (SLO: <34.000MB -8.2%)


✅ small

Time: ✅ 335.512µs (SLO: <370.000µs -9.3%)

Memory: ✅ 31.280MB (SLO: <34.000MB -8.0%)

Copy link
Collaborator

@juanjux juanjux left a comment

Choose a reason for hiding this comment

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

👌 with a couple comments

@avara1986 avara1986 requested a review from a team as a code owner September 3, 2025 13:36
@avara1986 avara1986 enabled auto-merge (squash) September 3, 2025 14:25
@avara1986 avara1986 merged commit 960f91c into main Sep 3, 2025
557 checks passed
@avara1986 avara1986 deleted the avara1986/APPSEC-58122_context_refactor branch September 3, 2025 14:52
avara1986 added a commit that referenced this pull request Sep 5, 2025
This PR is part of the ongoing [IAST context
refactor](#14466), and
focuses on improving the **naming clarity** of internal structures and
functions used within the IAST subsystem.

### 🔄 What’s changed?

* Renamed several classes and functions to more accurately reflect their
role in the taint tracking lifecycle.
* Renamed TaintRangeMapType → TaintedObjectMapType. Consumers of this
map retrieve a tainted object first, and then access the ranges inside
it. This rename clarifies that the value is the tainted object as a
whole, not just range metadata.
* Renamed get_taint_map  →  get_tainted_object_map
* Replaced previously confusing or ambiguous terms with consistent,
descriptive alternatives (e.g., `contexts_array` →
`request_context_slots`, `ApplicationContext` -> `TaintEngineContext`,
etc.).


### 🧠 Why?

The current naming was either overly generic or misleading, making the
IAST implementation harder to understand and maintain. This refactor
aligns terminology with:
```
Application Request
├── start_request_context()
│   ├── Acquire slot from request_context_slots (max 2)
│   ├── Get a new request_context_slots
│   │   └── Initialize TaintedObjectMap (e.g., empty dict keyed by id(obj))
│   └── Register context into ApplicationContext.context_slots[n]
│
├── Propagation phase
│   ├── get_tainted_object_map() → Retrieve current TaintedObjectMap from TaintEngineContext.request_context_slots
│   ├── Check if object is tainted via id(obj) in map
│   └── If needed, update/add TaintRanges to TaintedObject in TaintedObjectMap
│
└── finish_request_context()
    ├── Clear TaintedObjectMap (remove all taint metadata for the request)
    └── Release slot in TaintEngineContext.request_context_slots (allow new request to reuse)
```


## 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)
@avara1986 avara1986 mentioned this pull request Sep 8, 2025
2 tasks
brettlangdon pushed a commit that referenced this pull request Sep 9, 2025
This PR is part of the ongoing [IAST context
refactor](#14466), and
focuses on improving the **naming clarity** of internal structures and
functions used within the IAST subsystem.

### 🔄 What’s changed?

* Renamed several classes and functions to more accurately reflect their
role in the taint tracking lifecycle.
* Renamed TaintRangeMapType → TaintedObjectMapType. Consumers of this
map retrieve a tainted object first, and then access the ranges inside
it. This rename clarifies that the value is the tainted object as a
whole, not just range metadata.
* Renamed get_taint_map  →  get_tainted_object_map
* Replaced previously confusing or ambiguous terms with consistent,
descriptive alternatives (e.g., `contexts_array` →
`request_context_slots`, `ApplicationContext` -> `TaintEngineContext`,
etc.).


### 🧠 Why?

The current naming was either overly generic or misleading, making the
IAST implementation harder to understand and maintain. This refactor
aligns terminology with:
```
Application Request
├── start_request_context()
│   ├── Acquire slot from request_context_slots (max 2)
│   ├── Get a new request_context_slots
│   │   └── Initialize TaintedObjectMap (e.g., empty dict keyed by id(obj))
│   └── Register context into ApplicationContext.context_slots[n]
│
├── Propagation phase
│   ├── get_tainted_object_map() → Retrieve current TaintedObjectMap from TaintEngineContext.request_context_slots
│   ├── Check if object is tainted via id(obj) in map
│   └── If needed, update/add TaintRanges to TaintedObject in TaintedObjectMap
│
└── finish_request_context()
    ├── Clear TaintedObjectMap (remove all taint metadata for the request)
    └── Release slot in TaintEngineContext.request_context_slots (allow new request to reuse)
```


## 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)
avara1986 added a commit that referenced this pull request Sep 16, 2025
## Overview
It replaces the thread/process fragile map semantics with a bounded,
request-scoped context backed by a native, fixed-size array, and adds
end-to-end tests validating Overhead Control Engine (OCE)
max-concurrency enforcement across FastAPI, Django, and Flask test apps.

## Context and motivation
- Problem: The legacy IAST context map (pointer-keyed + thread-local
cache) breaks under asyncio and concurrency, causing incorrect request
association and performance inconsistencies.
- Goal: Make the IAST request map safe and predictable under
threads/async with consistent overhead, enforce request concurrency via
OCE, and provide clear, framework-agnostic tests that verify behavior.

## Related work
- Follows the direction and experiments from:
  - #14466: Initial context refactor and benchmarks groundwork
- #14497, #14555, #14562: Subsequent iterations on IAST context
ownership, perf and integration
- This PR integrates and stabilizes those ideas into the runtime and
test suites.

## What’s in this PR

Core IAST context lifecycle
- New request-scoped flow entrypoint
  - `ddtrace/appsec/_iast/_iast_request_context_base.py`
- `_iast_start_request(span)` now gates with OCE
(`oce.acquire_request(span)`) and creates a native request context only
when needed.
    - Sets `IAST_CONTEXT` ContextVar to the active context id.
- Attaches a per-request `IASTEnvironment(span)` via
`core.set_item(IAST.REQUEST_CONTEXT_KEY, ...)`.
- On finish (`_iast_finish_request(...)`) it updates global limits,
discards the environment, and releases the native context.
- Helper: `is_iast_request_enabled()` exposes whether the taint-tracking
context is active in the current execution.

## Rollout plan
- Land behind existing feature flags/env vars (default disabled for IAST
if unsupported).
- Monitor CI and integration tests for the new concurrency checks.
- Follow-up PRs (tracked in the RFC) will:
  - Complete the native context array migration across all call sites.
  - Add more microbenchmarks and tighten perf budgets (+/- thresholds).
  - Expand sink coverage and per-request metrics.

## 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.

3 participants