Skip to content
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

v5.37.1 proposal #5295

Merged
merged 8 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: DataDog/system-tests/.github/workflows/compute-workflow-parameters.yml@main
with:
library: nodejs
scenarios_groups: essentials,appsec_rasp
scenarios_groups: essentials,appsec_rasp,debugger

system-tests:
runs-on: ${{ contains(fromJSON('["CROSSED_TRACING_LIBRARIES", "INTEGRATIONS"]'), matrix.scenario) && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variables:
tags: ["runner:apm-k8s-tweaked-metal"]
image: $MICROBENCHMARKS_CI_IMAGE
interruptible: true
timeout: 15m
timeout: 20m
script:
- git clone --branch dd-trace-js https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
- bp-runner bp-runner.yml --debug
Expand Down
6 changes: 2 additions & 4 deletions benchmark/sirun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ RUN wget -O sirun.tar.gz https://github.com/DataDog/sirun/releases/download/v0.1
RUN mkdir -p /usr/local/nvm \
&& wget -q -O - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install --no-progress 14.21.3 \
&& nvm install --no-progress 16.20.1 \
&& nvm install --no-progress 18.16.1 \
&& nvm install --no-progress 20.4.0 \
&& nvm install --no-progress 22.10.0 \
&& nvm alias default 18 \
&& nvm use 18
&& nvm alias default 22 \
&& nvm use 22

RUN mkdir /opt/insecure-bank-js
RUN git clone --depth 1 https://github.com/hdiv/insecure-bank-js.git /opt/insecure-bank-js
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sirun/plugin-graphql/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"run": "node index.js",
"run_with_affinity": "bash -c \"taskset -c $CPU_AFFINITY node index.js\"",
"cachegrind": false,
"iterations": 2,
"iterations": 30,
"instructions": true,
"variants": {
"control": {},
Expand Down
4 changes: 2 additions & 2 deletions benchmark/sirun/plugin-graphql/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Human = new graphql.GraphQLObjectType({
async resolve (obj, args) {
const promises = []

for (let i = 0; i < 100; i++) {
for (let i = 0; i < 20; i++) {
promises.push(await Promise.resolve({}))
}

Expand All @@ -115,7 +115,7 @@ const schema = new graphql.GraphQLSchema({
async resolve (obj, args) {
const promises = []

for (let i = 0; i < 100; i++) {
for (let i = 0; i < 20; i++) {
promises.push(await Promise.resolve({}))
}

Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default [
'integration-tests/debugger/target-app/source-map-support/typescript.js', // Generated
'integration-tests/esbuild/out.js', // Generated
'integration-tests/esbuild/aws-sdk-out.js', // Generated
'packages/dd-trace/src/appsec/blocked_templates.js', // TODO Why is this ignored?
'packages/dd-trace/src/payload-tagging/jsonpath-plus.js' // Vendored
]
},
Expand Down
22 changes: 8 additions & 14 deletions integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ versions.forEach(version => {
})
// Dynamic instrumentation only supported from >=8.0.0
context('dynamic instrumentation', () => {
it('does not activate if DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED is not set', (done) => {
it('does not activate if DD_TEST_FAILED_TEST_REPLAY_ENABLED is set to false', (done) => {
receiver.setSettings({
flaky_test_retries_enabled: true,
di_enabled: true
Expand Down Expand Up @@ -1621,7 +1621,10 @@ versions.forEach(version => {
'./node_modules/.bin/cucumber-js ci-visibility/features-di/test-hit-breakpoint.feature --retry 1',
{
cwd,
env: envVars,
env: {
...envVars,
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 'false'
},
stdio: 'pipe'
}
)
Expand Down Expand Up @@ -1666,10 +1669,7 @@ versions.forEach(version => {
'./node_modules/.bin/cucumber-js ci-visibility/features-di/test-hit-breakpoint.feature --retry 1',
{
cwd,
env: {
...envVars,
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true'
},
env: envVars,
stdio: 'pipe'
}
)
Expand Down Expand Up @@ -1748,10 +1748,7 @@ versions.forEach(version => {
'./node_modules/.bin/cucumber-js ci-visibility/features-di/test-hit-breakpoint.feature --retry 1',
{
cwd,
env: {
...envVars,
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true'
},
env: envVars,
stdio: 'pipe'
}
)
Expand Down Expand Up @@ -1800,10 +1797,7 @@ versions.forEach(version => {
'./node_modules/.bin/cucumber-js ci-visibility/features-di/test-not-hit-breakpoint.feature --retry 1',
{
cwd,
env: {
...envVars,
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true'
},
env: envVars,
stdio: 'pipe'
}
)
Expand Down
12 changes: 4 additions & 8 deletions integration-tests/jest/jest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ describe('jest CommonJS', () => {
}).catch(done)
})

it('can work with Dynamic Instrumentation', (done) => {
it('can work with Failed Test Replay', (done) => {
receiver.setSettings({
flaky_test_retries_enabled: true,
di_enabled: true
Expand Down Expand Up @@ -565,7 +565,6 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1',
RUN_IN_PARALLEL: true
},
Expand Down Expand Up @@ -2537,7 +2536,7 @@ describe('jest CommonJS', () => {
})

context('dynamic instrumentation', () => {
it('does not activate dynamic instrumentation if DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED is not set', (done) => {
it('does not activate dynamic instrumentation if DD_TEST_FAILED_TEST_REPLAY_ENABLED is set to false', (done) => {
receiver.setSettings({
flaky_test_retries_enabled: true,
di_enabled: true
Expand Down Expand Up @@ -2571,7 +2570,8 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-hit-breakpoint',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1',
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 'false'
},
stdio: 'inherit'
}
Expand Down Expand Up @@ -2618,7 +2618,6 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-hit-breakpoint',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down Expand Up @@ -2703,7 +2702,6 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-hit-breakpoint',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down Expand Up @@ -2753,7 +2751,6 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-not-hit-breakpoint',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down Expand Up @@ -2793,7 +2790,6 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TESTS_TO_RUN: 'dynamic-instrumentation/test-hit-breakpoint',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1',
TEST_SHOULD_PASS_AFTER_RETRY: '1'
},
Expand Down
8 changes: 3 additions & 5 deletions integration-tests/mocha/mocha.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ describe('mocha CommonJS', function () {
})

context('dynamic instrumentation', () => {
it('does not activate dynamic instrumentation if DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED is not set', (done) => {
it('does not activate dynamic instrumentation if DD_TEST_FAILED_TEST_REPLAY_ENABLED is set to false', (done) => {
receiver.setSettings({
flaky_test_retries_enabled: true,
di_enabled: true
Expand Down Expand Up @@ -2247,7 +2247,8 @@ describe('mocha CommonJS', function () {
TESTS_TO_RUN: JSON.stringify([
'./dynamic-instrumentation/test-hit-breakpoint'
]),
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1',
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 'false'
},
stdio: 'inherit'
}
Expand Down Expand Up @@ -2299,7 +2300,6 @@ describe('mocha CommonJS', function () {
TESTS_TO_RUN: JSON.stringify([
'./dynamic-instrumentation/test-hit-breakpoint'
]),
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down Expand Up @@ -2389,7 +2389,6 @@ describe('mocha CommonJS', function () {
TESTS_TO_RUN: JSON.stringify([
'./dynamic-instrumentation/test-hit-breakpoint'
]),
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down Expand Up @@ -2443,7 +2442,6 @@ describe('mocha CommonJS', function () {
TESTS_TO_RUN: JSON.stringify([
'./dynamic-instrumentation/test-not-hit-breakpoint'
]),
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 'true',
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: '1'
},
stdio: 'inherit'
Expand Down
14 changes: 6 additions & 8 deletions integration-tests/vitest/vitest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ versions.forEach((version) => {
// dynamic instrumentation only supported from >=2.0.0
if (version === 'latest') {
context('dynamic instrumentation', () => {
it('does not activate it if DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED is not set', (done) => {
it('does not activate it if DD_TEST_FAILED_TEST_REPLAY_ENABLED is set to false', (done) => {
receiver.setSettings({
flaky_test_retries_enabled: true,
di_enabled: true
Expand Down Expand Up @@ -1025,7 +1025,8 @@ versions.forEach((version) => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TEST_DIR: 'ci-visibility/vitest-tests/dynamic-instrumentation*',
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init'
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init',
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 'false'
},
stdio: 'pipe'
}
Expand Down Expand Up @@ -1075,8 +1076,7 @@ versions.forEach((version) => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TEST_DIR: 'ci-visibility/vitest-tests/dynamic-instrumentation*',
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: '1'
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init'
},
stdio: 'pipe'
}
Expand Down Expand Up @@ -1162,8 +1162,7 @@ versions.forEach((version) => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TEST_DIR: 'ci-visibility/vitest-tests/dynamic-instrumentation*',
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: '1'
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init'
},
stdio: 'pipe'
}
Expand Down Expand Up @@ -1217,8 +1216,7 @@ versions.forEach((version) => {
env: {
...getCiVisAgentlessConfig(receiver.port),
TEST_DIR: 'ci-visibility/vitest-tests/breakpoint-not-hit*',
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init',
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: '1'
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init'
},
stdio: 'pipe'
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dd-trace",
"version": "5.37.0",
"version": "5.37.1",
"description": "Datadog APM tracing client for JavaScript",
"main": "index.js",
"typings": "index.d.ts",
Expand Down Expand Up @@ -131,7 +131,7 @@
"checksum": "^1.0.0",
"cli-table3": "^0.6.3",
"dotenv": "16.3.1",
"esbuild": "0.16.12",
"esbuild": "^0.25.0",
"eslint": "^9.19.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/dd-trace/src/appsec/blocked_templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class TestVisDynamicInstrumentation {
env: {
...process.env,
DD_TRACE_ENABLED: 0,
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED: 0
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 0
},
workerData: {
config: config.serialize(),
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ class Config {
DD_CIVISIBILITY_FLAKY_RETRY_COUNT,
DD_TEST_SESSION_NAME,
DD_AGENTLESS_LOG_SUBMISSION_ENABLED,
DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED,
DD_TEST_FAILED_TEST_REPLAY_ENABLED,
DD_TEST_MANAGEMENT_ENABLED,
DD_TEST_MANAGEMENT_ATTEMPT_TO_FIX_RETRIES
} = process.env
Expand All @@ -1164,7 +1164,7 @@ class Config {
this._setBoolean(calc, 'isManualApiEnabled', !isFalse(this._isCiVisibilityManualApiEnabled()))
this._setString(calc, 'ciVisibilityTestSessionName', DD_TEST_SESSION_NAME)
this._setBoolean(calc, 'ciVisAgentlessLogSubmissionEnabled', isTrue(DD_AGENTLESS_LOG_SUBMISSION_ENABLED))
this._setBoolean(calc, 'isTestDynamicInstrumentationEnabled', isTrue(DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED))
this._setBoolean(calc, 'isTestDynamicInstrumentationEnabled', !isFalse(DD_TEST_FAILED_TEST_REPLAY_ENABLED))
this._setBoolean(calc, 'isServiceUserProvided', !!this._env.service)
this._setBoolean(calc, 'isTestManagementEnabled', !isFalse(DD_TEST_MANAGEMENT_ENABLED))
this._setValue(calc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ async function addBreakpoint (probe) {
probe.nsBetweenSampling = BigInt(1 / snapshotsPerSecond * 1e9)
probe.lastCaptureNs = 0n

// TODO: Inbetween `await session.post('Debugger.enable')` and here, the scripts are parsed and cached.
// Maybe there's a race condition here or maybe we're guraenteed that `await session.post('Debugger.enable')` will
// not continue untill all scripts have been parsed?
// Warning: The code below relies on undocumented behavior of the inspector!
// It expects that `await session.post('Debugger.enable')` will wait for all loaded scripts to be emitted as
// `Debugger.scriptParsed` events. If this ever changes, we will have a race condition!
const script = findScriptFromPartialPath(file)
if (!script) throw new Error(`No loaded script found for ${file} (probe: ${probe.id}, version: ${probe.version})`)
const { url, scriptId, sourceMapURL, source } = script
Expand Down
Loading
Loading