Skip to content

Commit 45ee17b

Browse files
authored
Merge branch 'main' into 4.0-breaking-changes
2 parents 82cf8a4 + 55e4eec commit 45ee17b

File tree

26 files changed

+657
-219
lines changed

26 files changed

+657
-219
lines changed

.github/workflows/build_python_3.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ jobs:
9494
CIBW_BEFORE_ALL_MACOS: rustup target add aarch64-apple-darwin
9595
CIBW_BEFORE_ALL_LINUX: |
9696
if [[ "$(uname -m)-$(uname -i)-$(uname -o | tr '[:upper:]' '[:lower:]')-$(ldd --version 2>&1 | head -n 1 | awk '{print $1}')" != "i686-unknown-linux-musl" ]]; then
97-
if command -v yum &> /dev/null; then
98-
yum install -y libatomic.i686
99-
fi
10097
curl -sSf https://sh.rustup.rs | sh -s -- -y;
10198
fi
10299
CIBW_ENVIRONMENT_LINUX: PATH=$HOME/.cargo/bin:$PATH CMAKE_BUILD_PARALLEL_LEVEL=24 CMAKE_ARGS="-DNATIVE_TESTING=OFF" SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DDTRACE=${{ needs.compute_version.outputs.library_version }}

.github/workflows/generate-package-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ jobs:
8181

8282
- name: Install Python dependencies
8383
run: |
84-
python -m pip install --upgrade pip
84+
python -m pip install --upgrade "pip<25.3"
8585
pip install packaging
8686
pip install requests
8787
pip install riot==0.20.1
8888
pip install PyYAML
8989
pip install ddtrace
9090
# Install latest pip-tools from main branch for Python 3.14 compatibility
91-
pip install --upgrade git+https://github.com/jazzband/pip-tools.git@934b46a8795554f994b984ac743957f8458a29d6
91+
pip install --upgrade git+https://github.com/jazzband/pip-tools.git@1c2692b7f45a94d93e3f4bb252da3fd711ad08a9 # v7.5.1
9292
9393
- name: Run regenerate-riot-latest
9494
run: scripts/regenerate-riot-latest.sh

.gitlab/benchmarks/bp-runner.microbenchmarks.fail-on-breach.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,11 +799,11 @@ experiments:
799799
- name: otelspan-add-metrics
800800
thresholds:
801801
- execution_time < 344.80 ms
802-
- max_rss_usage < 675.00 MB
802+
- max_rss_usage < 47.50 MB
803803
- name: otelspan-add-tags
804804
thresholds:
805-
- execution_time < 344.80 ms
806-
- max_rss_usage < 675.00 MB
805+
- execution_time < 314.00 ms
806+
- max_rss_usage < 47.50 MB
807807
- name: otelspan-get-context
808808
thresholds:
809809
- execution_time < 92.35 ms
@@ -1032,11 +1032,11 @@ experiments:
10321032
- name: span-add-metrics
10331033
thresholds:
10341034
- execution_time < 93.50 ms
1035-
- max_rss_usage < 961.00 MB
1035+
- max_rss_usage < 53.00 MB
10361036
- name: span-add-tags
10371037
thresholds:
10381038
- execution_time < 155.00 ms
1039-
- max_rss_usage < 962.50 MB
1039+
- max_rss_usage < 53.00 MB
10401040
- name: span-get-context
10411041
thresholds:
10421042
- execution_time < 20.50 ms

benchmarks/otel_span/scenario.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ def _(loops):
9292
if finishspan:
9393
s.end()
9494

95-
# If we are finishing spans, we need to ensure that the span aggregator is cleared
96-
# to avoid memory leaks and errors on shutdown
97-
if not finishspan:
98-
if hasattr(tracer, "_span_aggregator"):
99-
if hasattr(tracer._span_aggregator, "_traces"):
100-
tracer._span_aggregator._traces.clear()
95+
# If we are finishing spans, we need to ensure that the span aggregator is cleared
96+
# to avoid memory leaks and errors on shutdown
97+
# DEV: Do this per-loop to keep memory usage lower during the test
98+
if not finishspan:
99+
if hasattr(tracer, "_span_aggregator"):
100+
if hasattr(tracer._span_aggregator, "_traces"):
101+
tracer._span_aggregator._traces.clear()
101102

102103
yield _

benchmarks/span/scenario.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ def _(loops):
8484
if finishspan:
8585
s.finish()
8686

87-
# If we are finishing spans, we need to ensure that the span aggregator is cleared
88-
# to avoid memory leaks and errors on shutdown
89-
if not finishspan:
90-
if hasattr(tracer, "_span_aggregator"):
91-
if hasattr(tracer._span_aggregator, "_traces"):
92-
tracer._span_aggregator._traces.clear()
87+
# If we are finishing spans, we need to ensure that the span aggregator is cleared
88+
# to avoid memory leaks and errors on shutdown
89+
# DEV: Do this per-loop to keep memory usage lower during the test
90+
if not finishspan:
91+
if hasattr(tracer, "_span_aggregator"):
92+
if hasattr(tracer._span_aggregator, "_traces"):
93+
tracer._span_aggregator._traces.clear()
9394

9495
yield _

ddtrace/appsec/_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ def __init__(
173173
self.location = location.replace(APPSEC.SECURITY_RESPONSE_ID, security_response_id)
174174
self.content_type: str = "application/json"
175175

176+
def get(self, method_name: str, default: Any = None) -> Any:
177+
"""
178+
Dictionary-like get method for backward compatibility with Lambda integration.
179+
180+
Returns the attribute value if it exists, otherwise returns the default value.
181+
This allows Block_config to be used in contexts that expect dictionary-like access.
182+
"""
183+
return getattr(self, method_name, default)
184+
176185

177186
class Telemetry_result:
178187
__slots__ = [

ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
include(CheckIPOSupported)
22

33
function(add_ddup_config target)
4-
# Profiling native extensions are built with C++17, even though underlying repo adheres to the manylinux 2014
4+
# Profiling native extensions are built with C++20, even though underlying repo adheres to the manylinux 2014
55
# standard. This isn't currently a problem, but if it becomes one, we may have to structure the library differently.
6-
target_compile_features(${target} PUBLIC cxx_std_17)
6+
target_compile_features(${target} PUBLIC cxx_std_20)
77

88
# Common compile options
99
target_compile_options(

ddtrace/internal/datadog/profiling/dd_wrapper/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
cmake_minimum_required(VERSION 3.19)
2+
3+
# Disable testing by default (can be overridden with -DBUILD_TESTING=ON) Don't use FORCE to allow command-line overrides
4+
if(NOT DEFINED BUILD_TESTING)
5+
set(BUILD_TESTING
6+
OFF
7+
CACHE BOOL "Build the testing tree")
8+
endif()
9+
210
project(
311
dd_wrapper
412
VERSION 0.1.1

ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@ function(dd_wrapper_add_test name)
4040
add_ddup_config(${name})
4141
target_link_options(${name} PRIVATE -Wl,--no-as-needed)
4242

43+
# Test executable needs to find libdd_wrapper in parent directory Append to INSTALL_RPATH instead of replacing to
44+
# preserve sanitizer library paths set by add_ddup_config
45+
get_target_property(EXISTING_INSTALL_RPATH ${name} INSTALL_RPATH)
46+
if(EXISTING_INSTALL_RPATH)
47+
set_target_properties(${name} PROPERTIES INSTALL_RPATH "${EXISTING_INSTALL_RPATH};$ORIGIN/.."
48+
BUILD_WITH_INSTALL_RPATH TRUE)
49+
else()
50+
set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/.." BUILD_WITH_INSTALL_RPATH TRUE)
51+
endif()
52+
4353
gtest_discover_tests(
44-
${name}
54+
${name} DISCOVERY_MODE PRE_TEST # Delay test discovery until test execution to avoid running sanitizer-built
55+
# executables during build
4556
PROPERTIES # We start new threads after fork(), and we want to continue running the tests after that instead of
4657
# dying.
4758
ENVIRONMENT "TSAN_OPTIONS=die_after_fork=0:suppressions=${CMAKE_CURRENT_SOURCE_DIR}/TSan.supp")
4859

49-
set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/..")
50-
5160
if(LIB_INSTALL_DIR)
5261
install(TARGETS ${name} RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../test)
5362
endif()

ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,23 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES PREFIX "")
6464
set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "")
6565

6666
# RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is
67-
# typical.
67+
# typical. Use BUILD_WITH_INSTALL_RPATH to avoid rpath manipulation during install phase which can cause conflicts For
68+
# standalone/test builds, also include LIB_INSTALL_DIR so tests can find libdd_wrapper
6869
if(APPLE)
69-
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..")
70+
if(BUILD_TESTING AND LIB_INSTALL_DIR)
71+
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..;${LIB_INSTALL_DIR}"
72+
BUILD_WITH_INSTALL_RPATH TRUE)
73+
else()
74+
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/.." BUILD_WITH_INSTALL_RPATH
75+
TRUE)
76+
endif()
7077
elseif(UNIX)
71-
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..")
78+
if(BUILD_TESTING AND LIB_INSTALL_DIR)
79+
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..;${LIB_INSTALL_DIR}"
80+
BUILD_WITH_INSTALL_RPATH TRUE)
81+
else()
82+
set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." BUILD_WITH_INSTALL_RPATH TRUE)
83+
endif()
7284
endif()
7385
target_include_directories(
7486
${EXTENSION_NAME}

0 commit comments

Comments
 (0)