Skip to content

Commit 5e82809

Browse files
szegediclaude
andauthored
Update profiler to 5.14.0 (#7815)
* Update profiler to 5.14.0 * test(profiler): fix wall profiler context telemetry tests on Ubuntu+Node24 With pprof 5.14.0, SetContext() in CPED mode only creates context holders when inside an ALS run() scope. On Ubuntu (more aggressive GC), the transient holders created by the profiler exporter's storage.run() were collected before getMetrics() was called, causing the gauge to always report 0. Fix by wrapping busyWait in tracer.trace() in the profiler test fixture so there's a long-lived span context keeping CPED holders alive throughout the test duration. Additionally, use resolveAtFirstSuccess=true in both profiler telemetry assertTelemetryReceived calls: with an active span, dd-trace emits 'tracers' namespace generate-metrics events before the 'profilers' ones, so the handler must keep scanning rather than stopping at the first event. Also removes the macOS skip from the wall profiler context telemetry test and increases TEST_DURATION_MS from 1500 to 3000 to avoid timing races. Co-authored-by: Claude Sonnet 4.6 <[email protected]>
1 parent 0b896cb commit 5e82809

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

integration-tests/profiler/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ function busyWait (ms) {
2121
}))
2222
}
2323

24+
const tracer = require('dd-trace')
2425
const durationMs = Number.parseInt(process.env.TEST_DURATION_MS ?? '500')
25-
setImmediate(async () => busyWait(durationMs))
26+
setImmediate(() => tracer.trace('test-operation', () => busyWait(durationMs)))

integration-tests/profiler/profiler.spec.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ describe('profiler', () => {
720720

721721
// Same number of requests and responses
722722
assert.strictEqual(responses.points[0][1], requestCount)
723-
}, 'generate-metrics', timeout)
723+
}, 'generate-metrics', timeout, 1, true)
724724

725725
const checkDistributions = agent.assertTelemetryReceived(({ _, payload }) => {
726726
const pp = payload.payload
@@ -748,9 +748,6 @@ describe('profiler', () => {
748748
if (process.platform === 'win32') {
749749
this.skip() // Wall profiler context count telemetry is not supported on Windows
750750
}
751-
if (process.platform === 'darwin') {
752-
this.skip() // Test is flaky on macOS
753-
}
754751
proc = fork(profilerTestFile, {
755752
cwd,
756753
env: {
@@ -759,7 +756,7 @@ describe('profiler', () => {
759756
DD_PROFILING_UPLOAD_PERIOD: '1',
760757
DD_PROFILING_ASYNC_CONTEXT_FRAME_ENABLED: '1',
761758
DD_TELEMETRY_HEARTBEAT_INTERVAL: '1', // every second
762-
TEST_DURATION_MS: 1500,
759+
TEST_DURATION_MS: 3000,
763760
},
764761
})
765762

@@ -772,7 +769,7 @@ describe('profiler', () => {
772769
assert.strictEqual(sampleContexts.type, 'gauge')
773770
assert.ok(sampleContexts.points[0][1] >= 1)
774771
})
775-
}, 'generate-metrics', timeout)
772+
}, 'generate-metrics', timeout, 1, true)
776773

777774
await Promise.all([checkProfiles(agent, proc, timeout), checkMetrics])
778775
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"@datadog/native-iast-taint-tracking": "4.1.0",
144144
"@datadog/native-metrics": "3.1.1",
145145
"@datadog/openfeature-node-server": "^1.1.0",
146-
"@datadog/pprof": "5.13.5",
146+
"@datadog/pprof": "5.14.0",
147147
"@datadog/wasm-js-rewriter": "5.0.1",
148148
"@opentelemetry/api": ">=1.0.0 <1.10.0",
149149
"@opentelemetry/api-logs": "<1.0.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@
231231
dependencies:
232232
"@datadog/flagging-core" "1.1.0"
233233

234-
"@datadog/pprof@5.13.5":
235-
version "5.13.5"
236-
resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-5.13.5.tgz#36eea628f321ed512fe4ce440de4cffa2e056569"
237-
integrity sha512-W0dvo91ff2EMQI9Vhv8PNM+w1ZWuClm1pBVdLB6y0bMB3+E+wEGg0VD1iNJxsuPbwDt5+yV0u3e4WkqK12Lzlg==
234+
"@datadog/pprof@5.14.0":
235+
version "5.14.0"
236+
resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-5.14.0.tgz#a5a43fde3ca9369345994cc5cf82d5dcf743fb1c"
237+
integrity sha512-bXYptMf0BY3NdKcAmX5aAOnozj7GFdNYE4SIdPF0/Q/Yfb2fYBIYZaN/Le6BhiDIepBvvH/H75d3EIFhB64kOw==
238238
dependencies:
239239
node-gyp-build "<4.0"
240240
pprof-format "^2.2.1"

0 commit comments

Comments
 (0)