Skip to content

Commit 41b2489

Browse files
committed
Merge remote-tracking branch 'origin/master' into glopes/sidecar-ffi-tel-metrics
2 parents e1360ac + 4df27be commit 41b2489

File tree

27 files changed

+469
-105
lines changed

27 files changed

+469
-105
lines changed

.github/workflows/prof_correctness.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ jobs:
99
prof-correctness:
1010
runs-on: ubuntu-24.04
1111
strategy:
12+
fail-fast: false
1213
matrix:
13-
php-version: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
14+
php-version: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1415
phpts: [nts, zts]
1516
include:
1617
- phpts: zts
@@ -27,6 +28,7 @@ jobs:
2728
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
2829
with:
2930
php-version: ${{ matrix.php-version }}
31+
coverage: none
3032
extensions: ${{ matrix.extensions }}
3133
env:
3234
phpts: ${{ matrix.phpts }}
@@ -108,6 +110,26 @@ jobs:
108110
USE_ZEND_ALLOC=0 php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/allocations.php
109111
unset DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE
110112
113+
- name: Run allocation_time_combined test (PHP 8.4+)
114+
if: fromJSON(matrix.php-version) >= 8.4
115+
run: |
116+
export DD_PROFILING_LOG_LEVEL=trace
117+
export DD_PROFILING_EXPERIMENTAL_FEATURES_ENABLED=1
118+
export DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE=1
119+
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
120+
php -v
121+
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
122+
mkdir -p profiling/tests/correctness/allocation_time_combined/
123+
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/allocation_time_combined/test.pprof
124+
export DD_PROFILING_ALLOCATION_ENABLED=yes
125+
export DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE=1
126+
export DD_PROFILING_WALL_TIME_ENABLED=yes
127+
export DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED=no
128+
export DD_PROFILING_ENDPOINT_COLLECTION_ENABLED=no
129+
export EXECUTION_TIME=5
130+
php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/allocation_time_combined.php
131+
unset DD_PROFILING_ALLOCATION_ENABLED DD_PROFILING_ALLOCATION_SAMPLING_DISTANCE DD_PROFILING_WALL_TIME_ENABLED DD_PROFILING_EXPERIMENTAL_CPU_TIME_ENABLED DD_PROFILING_ENDPOINT_COLLECTION_ENABLED EXECUTION_TIME
132+
111133
- name: Run ZTS tests
112134
if: matrix.phpts == 'zts'
113135
run: |
@@ -159,6 +181,13 @@ jobs:
159181
expected_json: profiling/tests/correctness/timeline.json
160182
pprof_path: profiling/tests/correctness/timeline/
161183

184+
- name: Check profiler correctness for allocation_time_combined
185+
if: fromJSON(matrix.php-version) >= 8.4
186+
uses: Datadog/prof-correctness/analyze@main
187+
with:
188+
expected_json: profiling/tests/correctness/allocation_time_combined.json
189+
pprof_path: profiling/tests/correctness/allocation_time_combined/
190+
162191
- name: Check profiler correctness for exceptions ZTS
163192
if: matrix.phpts == 'zts'
164193
uses: Datadog/prof-correctness/analyze@main

.gitlab/dockerhub-login.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@ if ! command -v jq > /dev/null 2>&1; then
3737
export PATH="/tmp:${PATH}"
3838
fi
3939

40+
# Install unzip if not already available
41+
if ! command -v unzip > /dev/null 2>&1; then
42+
echo "Installing unzip..."
43+
if command -v apt-get > /dev/null 2>&1; then
44+
apt-get update -qq && apt-get install -y -qq unzip > /dev/null 2>&1 || {
45+
echo "Warning: Failed to install unzip. Skipping Docker Hub authentication." >&2
46+
exit 0
47+
}
48+
elif command -v apk > /dev/null 2>&1; then
49+
apk add --no-cache unzip > /dev/null 2>&1 || {
50+
echo "Warning: Failed to install unzip. Skipping Docker Hub authentication." >&2
51+
exit 0
52+
}
53+
else
54+
echo "Warning: No package manager found to install unzip. Skipping Docker Hub authentication." >&2
55+
exit 0
56+
fi
57+
fi
58+
4059
# Install Vault if not already available
4160
vault_cmd="vault"
4261
if ! command -v vault > /dev/null 2>&1; then

.gitlab/generate-appsec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
147147
- find appsec/tests/integration/build/test-results -name "*.xml" -exec cp --parents '{}' "${CI_PROJECT_DIR}/artifacts/" \;
148148
- cp -r appsec/tests/integration/build/test-logs "${CI_PROJECT_DIR}/artifacts/" 2>/dev/null || true
149-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:appsec"
149+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:appsec"
150150
artifacts:
151151
reports:
152152
junit: "artifacts/**/test-results/**/TEST-*.xml"

.gitlab/generate-package.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
# One pipeline job overrides
9999
configure_system_tests:
100100
variables:
101-
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,lib-injection,lib-injection-profiling"
101+
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,lib-injection,lib-injection-profiling,docker-ssi"
102102
ALLOW_MULTIPLE_CHILD_LEVELS: "false"
103103

104104
package-oci:
@@ -998,7 +998,20 @@
998998
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
999999
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
10001000
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
1001-
- yum update -y
1001+
- |
1002+
# Retry yum update as vault.centos.org can be slow/unreliable
1003+
for i in 1 2 3; do
1004+
if yum update -y; then
1005+
echo "yum update succeeded on attempt $i"
1006+
break
1007+
fi
1008+
echo "yum update failed (attempt $i/3), retrying in 5 seconds..."
1009+
sleep 5
1010+
if [ $i -eq 3 ]; then
1011+
echo "yum update failed after 3 attempts, exiting"
1012+
exit 1
1013+
fi
1014+
done
10021015

10031016
"verify debian":
10041017
extends: .verify_job

.gitlab/generate-profiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
after_script:
5959
- |
6060
if [ "${IMAGE_SUFFIX}" != "_centos-7" ]; then
61-
.gitlab/upload-junit-to-datadog.sh "test.source.file:profiling"
61+
.gitlab/silent-upload-junit-to-datadog.sh "test.source.file:profiling"
6262
else
6363
echo "Skipping JUnit upload on CentOS 7 (old glibc/OpenSSL incompatible with datadog-ci)"
6464
fi

.gitlab/generate-shared.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
after_script:
3434
- mkdir -p tmp/artifacts
3535
- cp tmp/build_php_components_asan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestASan.log
36-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:components-rs"
36+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:components-rs"
3737
artifacts:
3838
reports:
3939
junit: "artifacts/*-results.xml"
@@ -57,7 +57,7 @@
5757
after_script:
5858
- mkdir -p tmp/artifacts
5959
- cp tmp/build_php_components_ubsan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestUBSan.log
60-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:components-rs"
60+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:components-rs"
6161
artifacts:
6262
reports:
6363
junit: "artifacts/*-results.xml"
@@ -85,7 +85,7 @@
8585
after_script:
8686
- mkdir -p tmp/artifacts/
8787
- cp tmp/build-tea-${SWITCH_PHP_VERSION}/Testing/Temporary/LastTest.log tmp/artifacts/LastTest.log
88-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
88+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
8989
artifacts:
9090
reports:
9191
junit: "artifacts/*-results.xml"
@@ -107,7 +107,7 @@
107107
after_script:
108108
- mkdir -p tmp/artifacts
109109
- cp tmp/build*/Testing/Temporary/LastTest.log tmp/artifacts/LastTest.log
110-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
110+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
111111
artifacts:
112112
reports:
113113
junit: "artifacts/*-results.xml"

.gitlab/generate-tracer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function after_script($execute_dir = ".", $has_test_agent = false) {
2323
- .gitlab/check_test_agent.sh
2424
<?php endif; ?>
2525
- .gitlab/collect_artifacts.sh "<?= $execute_dir ?>"
26-
- .gitlab/upload-junit-to-datadog.sh "test.source.file:src"
26+
- .gitlab/silent-upload-junit-to-datadog.sh "test.source.file:src"
2727
<?php
2828
}
2929

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
OUTFILE=/tmp/datadog-junit-upload.txt
3+
"$(dirname -- "${BASH_SOURCE[0]}")"/upload-junit-to-datadog.sh "$@" >$OUTFILE 2>&1
4+
if [[ $? -ne 0 ]]; then
5+
cat $OUTFILE
6+
else
7+
grep -E '^\* ' $OUTFILE
8+
fi

CHANGELOG.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,59 @@
11
Changelog for older versions can be found in our [release page](https://github.com/DataDog/dd-trace-php/releases).
22

33
## All products
4-
### Internal
5-
- bump tracing-core from 0.1.33 to 0.1.35 #3516
4+
### Fixed
5+
- Fix packaging apks for new alpine versions #3555
6+
- Fix http_response_header deprecation in installer #3553
67

78
## Tracer
8-
### Internal
9-
- Const-ify some logging thread-local variables #3513
9+
### Added
10+
- Support OpenTelemetry Metrics #3487
11+
- Adds process_tags to the first span of each tracing payload #3566
12+
- Distributed tracing header injection in HyperF/Swoole environments #3544
13+
- Stream context integration with HTTP method #3534
14+
15+
### Changed
16+
- Enable http.endpoint calculation when appsec is explicitly enabled #3556
17+
1018
### Fixed
11-
- Avoid curl's `getenv` calls #3528
12-
- `code_origin_for_spans_enabled` naming inconsistency #3494
13-
- Add `NULL` guard clause in sidecar reconnect callback #3499
19+
- Fix panic after bailout in previous request #3537
20+
- Avoid curl_getenv for unix:// too #3540
21+
- Correct a bug on prepared statement regarding DBM correlation #3545
22+
- Fix onclose in cycle collected spans #3587
23+
- prefer poll() for channel DataDog/libdatadog#1443
24+
- AWS lambda also can return EACCESS for shm_open DataDog/libdatadog#1446
25+
26+
### Internal
27+
- bump libdatadog to v25.0.0 #3568
1428

1529
## Profiler
16-
### Added
17-
- Detect parallel threads #3515
1830
### Changed
19-
- Speedup hot path in allocator #3505
31+
- Optimise allocation profiling for PHP >= 8.4 #3550
32+
2033
### Fixed
21-
- Fixed asserting length of INI #3508
34+
- Fixed bindgen compatibility with PHP 8.5.1+ on macOS #3583
35+
- Fixed SystemSettings initialization #3579
36+
- Fixed UB and simplify SystemSettings #3578
37+
- Fixed crash in upload for DD_EXTERNAL_ENV #3576
38+
- Fixed crash in ddtrace_get_profiling_context #3563
39+
- Check long string before allocating #3561
40+
- Fixed incompatibility with ext-grpc #3542
41+
- Revert unsafe optimization in memory profiling #3541
42+
- Cap dependency name length to copied bytes #3538
43+
44+
### Internal
45+
- Pre-reserve function name buffer #3445
46+
- Use cached heap in alloc_prof_orig_* functions #3547
2247

2348
## AppSec
2449
### Added
25-
- Minify blocking json message #3502
26-
- Add Custom Data Classification #3524
27-
- Add metrics for extension connections #3527
50+
- Reduce cardinality of helper.connection_* #3586
51+
- Added fallback on http.endpoint for schema sampler #3557
52+
2853
### Fixed
29-
- Amend string on request abort #3506
30-
- Fix accessing to incorrectly hardcoded `$_GET` #3501
31-
- Amend issue where `security_response_id` is being release before displaying it #3493
32-
- AppSec helper: add send timeouts #3518
33-
- Minor fixes and improvements to file descriptor reclamation #3526
34-
- LaravelIntegration: be more defensive #3503
35-
- Fix `duration_ext` metric #3507
36-
- Fix segfault iterating mapping #3517
37-
- Fix double end hook run/segfault when blocking in PHP 7.x #3490
38-
- Fix `_iovec_writer_flush` and enforce limits on `$_POST` #3495
39-
- Clear `client_ip` on `request_init` #3496
54+
- Use abstract namespace on linux #3525
55+
- Fix spurious munmaps in ZTS mode #3590
56+
57+
### Internal
58+
- Improvements for appsec libxml2 usage #3564
59+
- Improve xml parsing in appsec #3558

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.15.0
1+
1.16.0

0 commit comments

Comments
 (0)