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

v4.47.0 #4735

Merged
merged 60 commits into from
Oct 1, 2024
Merged

v4.47.0 #4735

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d3c8ce1
use shared code for safe wrapping, rather than calling wrapMethod on …
bengl Aug 29, 2024
26ec791
Revert "use shared code for safe wrapping, rather than calling wrapMe…
bengl Aug 29, 2024
ed8aa39
Review Error-throwing sites for whether they can sabotage SSI (#4627)
szegedi Aug 30, 2024
9bdcac5
[test visibility] Add test session name (#4621)
juan-fernandez Sep 2, 2024
9a49079
aws payload tagging (#4309)
tlhunter Sep 3, 2024
3b3dab9
feat(kafka): add datastreams monitoring support for kafkajs batches (…
wconti27 Sep 3, 2024
03b5d73
Add permissions to package-size-report workflow (#4650)
CarlesDD Sep 4, 2024
0f1e548
Allow Remote Config acknowledgements to be async (#4638)
watson Sep 4, 2024
47e2a0c
fix(openai): content and tool calls in streamed responses do not erro…
sabrenner Sep 4, 2024
809db12
[test visibility] Fix cucumber e2e tests (#4654)
juan-fernandez Sep 5, 2024
2874d78
Check context disposal before calling WAF run (#4653)
CarlesDD Sep 5, 2024
663e434
[test visibility] Use new metadata field in citestcycle (#4649)
juan-fernandez Sep 6, 2024
e8309fb
Bump path-to-regexp dependency to v0.1.10 (#4664)
watson Sep 10, 2024
46d6f75
Stop instrumenting microgateway-core >3.0.0 (#4660)
uurien Sep 10, 2024
517cf5d
[test visibility] Enable log collection for test visibility (#4657)
juan-fernandez Sep 10, 2024
cee5af7
Fix package.json and yarn.lock issues (#4661)
watson Sep 10, 2024
9a7e1e1
Filter addresses before calling to waf to prevent running without kno…
uurien Sep 10, 2024
ced7cd8
Revert "[test visibility] Use new metadata field in citestcycle (#46…
juan-fernandez Sep 10, 2024
b9c4817
Update to actions/upload-artifact@v4 in system tests workflow (#4669)
uurien Sep 11, 2024
0470298
Exploit prevention SQLi in pg (#4566)
uurien Sep 11, 2024
c0d12a9
split couchbase tests by node versions (#4667)
rochdev Sep 11, 2024
030ddf9
Add rasp capabilities in RC (#4672)
uurien Sep 11, 2024
4b5d3f3
clearer profiling error
bengl Sep 3, 2024
27684b2
[test visibility] Fix cucumber@11 (#4666)
juan-fernandez Sep 12, 2024
934f12c
Revert "Fix Node.js version to v22.6 instead of "latest" (#4629)" (#4…
watson Sep 12, 2024
1cf0454
[test visibility] Cap vitest support until we fix it (#4681)
juan-fernandez Sep 13, 2024
cb81b82
PROF-10497: Add span IDs to timeline DNS and TCP events (#4655)
szegedi Sep 13, 2024
b5557a9
[test visibility] Fix [email protected] (#4682)
juan-fernandez Sep 13, 2024
a520d41
[test visibility] Fix @jest/test-sequencer instrumentation (#4678)
juan-fernandez Sep 13, 2024
ce73f26
Prepare support for Dynamic Instrumentation (#4492)
watson Sep 13, 2024
73b8e29
[DI] Make it easier to debug integration test (#4683)
watson Sep 14, 2024
e4a78c0
[DI] Improve variable naming (#4684)
watson Sep 16, 2024
6b04553
[DI] DRY up integration test code (#4685)
watson Sep 16, 2024
62f9884
[test visibility] Add test source file to test suites (#4677)
juan-fernandez Sep 16, 2024
5cd85e5
[DI] Simplify integration test by not using async/await (#4686)
watson Sep 16, 2024
2a0c688
system-tests : Use reusable workflow to get scenario/weblog list (#4691)
cbeauchesne Sep 16, 2024
56d7c96
fix system tests (#4688)
wconti27 Sep 16, 2024
06b9704
Revert "Revert "[test visibility] Use new metadata field in citestcyc…
juan-fernandez Sep 17, 2024
44fa11e
add dsm schema tracking (#4687)
wconti27 Sep 19, 2024
701d70a
Fix tedious and fastify plugin tests (#4710)
juan-fernandez Sep 20, 2024
4f5f898
fix(openai): do not add usage tags or emit usage metrics if they are …
sabrenner Sep 20, 2024
5421e3d
[test visibility] Rename DD_SESSION_NAME to DD_TEST_SESSION_NAME (#4703)
juan-fernandez Sep 20, 2024
5234671
Revert "[test visibility] Enable log collection for test visibility …
juan-fernandez Sep 20, 2024
e8a46ca
[test visibility] Report logical CPU count (#4709)
juan-fernandez Sep 20, 2024
2581b14
restore next test version range (#4711)
rochdev Sep 20, 2024
bf12ecd
[test visibility] Remove beta flag from manual test API (#4705)
juan-fernandez Sep 23, 2024
6c79d53
[test visibility] Early Flake Detection for vitest (#4714)
juan-fernandez Sep 25, 2024
5b2b461
Remove debug code in test file (#4721)
watson Sep 25, 2024
f60d409
Update/fix settings in .vscode directory (#4722)
watson Sep 25, 2024
630a686
always enable tracing header injection for AWS requests (#4717)
tlhunter Sep 25, 2024
90ed009
Use DD_VERSION as version for tracer computed stats if available (#4720)
duncanpharvey Sep 26, 2024
810e07d
[test visibility] Early flake detection for mocha (parallel mode) (#4…
juan-fernandez Sep 27, 2024
072950e
pin iitm (#4732)
juan-fernandez Sep 27, 2024
75b0663
Moving Rhea plugin test to its own job (#4731)
crysmags Sep 27, 2024
d7dba0c
Fix: Calculate correct Content-Length in requests to agent (#4734)
watson Sep 27, 2024
5ba4f26
[test visibility] Support early flake detection for cucumber (#4733)
juan-fernandez Sep 30, 2024
6b82eee
Do not run fastify >=5 plugin tests in node <=18 (#4737)
juan-fernandez Sep 30, 2024
68b1035
Bump import-in-the-middle to 1.11.2 (#4740)
juan-fernandez Sep 30, 2024
dd7e503
fix: still set dsm consume checkpoint when no DSM parent context is a…
wconti27 Sep 30, 2024
2c3ce03
v4.47.0
juan-fernandez Oct 1, 2024
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/actions/node/latest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: '22.6'
node-version: 'latest'
3 changes: 2 additions & 1 deletion .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ jobs:
matrix:
version:
- 18
- 22.6
- latest
range: ['9.5.0', '11.1.4', '13.2.0', '14.2.6']
runs-on: ubuntu-latest
env:
PLUGINS: next
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/debugger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Debugger

on:
pull_request:
push:
branches: [master]
schedule:
- cron: '0 4 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- uses: ./.github/actions/node/18
- run: yarn test:debugger:ci
- run: yarn test:integration:debugger
- uses: ./.github/actions/node/20
- run: yarn test:debugger:ci
- run: yarn test:integration:debugger
- uses: ./.github/actions/node/latest
- run: yarn test:debugger:ci
- run: yarn test:integration:debugger
- if: always()
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v3
2 changes: 2 additions & 0 deletions .github/workflows/package-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
jobs:
package-size-report:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
Expand Down
44 changes: 35 additions & 9 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v3

amqp10: # TODO: move rhea to its own job
amqp10:
runs-on: ubuntu-latest
services:
qpid:
Expand All @@ -98,7 +98,7 @@ jobs:
ports:
- 5673:5672
env:
PLUGINS: amqp10|rhea
PLUGINS: amqp10
SERVICES: qpid
DD_DATA_STREAMS_ENABLED: true
steps:
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
aws-sdk:
strategy:
matrix:
node-version: ['18', '22.6']
node-version: ['18', 'latest']
runs-on: ubuntu-latest
services:
localstack:
Expand Down Expand Up @@ -236,7 +236,11 @@ jobs:
couchbase:
strategy:
matrix:
range: ['^2.6.12', '^3.0.7', '>=4.2.0']
node-version: [16]
range: ['^2.6.12', '^3.0.7', '>=4.0.0 <4.2.0']
include:
- node-version: 18
range: '>=4.2.0'
runs-on: ubuntu-latest
services:
couchbase:
Expand All @@ -253,8 +257,11 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- uses: ./.github/actions/node/oldest
- run: yarn test:plugins:ci
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn config set ignore-engines true
- run: yarn test:plugins:ci --ignore-engines
- uses: codecov/codecov-action@v3

connect:
Expand Down Expand Up @@ -405,7 +412,7 @@ jobs:
http:
strategy:
matrix:
node-version: ['18', '20', '22.6']
node-version: ['18', '20', 'latest']
runs-on: ubuntu-latest
env:
PLUGINS: http
Expand Down Expand Up @@ -645,7 +652,8 @@ jobs:
matrix:
version:
- 18
- 22.6
- latest
range: ['9.5.0', '11.1.4', '13.2.0', '14.2.6']
runs-on: ubuntu-latest
env:
PLUGINS: next
Expand Down Expand Up @@ -820,6 +828,24 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test

rhea:
runs-on: ubuntu-latest
services:
qpid:
image: scholzj/qpid-cpp:1.38.0
env:
QPIDD_ADMIN_USERNAME: admin
QPIDD_ADMIN_PASSWORD: admin
ports:
- 5673:5672
env:
PLUGINS: rhea
SERVICES: qpid
DD_DATA_STREAMS_ENABLED: true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/plugins/test-and-upstream

router:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -847,7 +873,7 @@ jobs:
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: 'Y'
SA_PASSWORD: DD_HUNTER2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# setting fail-fast to false in an attempt to prevent this from happening
fail-fast: false
matrix:
version: [18, 20, 22.6]
version: [18, 20, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
integration-ci:
strategy:
matrix:
version: [18, 22.6]
version: [18, latest]
framework: [cucumber, playwright, selenium, jest, mocha]
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# Important: This is outside the minimum supported version of dd-trace-js
# Node > 16 does not work with [email protected] (not even without our plugin)
# TODO: figure out what to do with this: we might have to deprecate support for [email protected]
version: [16, 22.6]
version: [16, latest]
# 6.7.0 is the minimum version we support
cypress-version: [6.7.0, latest]
module-type: ['commonJS', 'esm']
Expand Down
31 changes: 13 additions & 18 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,30 @@ jobs:
path: ./binaries/**/*

get-essential-scenarios:
runs-on: ubuntu-latest
outputs:
scenario: ${{ steps.parse-yml.outputs.scenario }}
steps:
- name: Checkout system tests
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Get Essential Scenarios
id: parse-yml
run: yq -o tsv .TRACER_ESSENTIAL_SCENARIOS ./scenario_groups.yml | xargs node -p "x=process.argv;x.shift();x.push('CROSSED_TRACING_LIBRARIES');'scenario='+JSON.stringify(x)" >> $GITHUB_OUTPUT

name: Get parameters
uses: DataDog/system-tests/.github/workflows/compute-workflow-parameters.yml@main
with:
library: nodejs
scenarios: CROSSED_TRACING_LIBRARIES
scenarios_groups: essentials

system-tests:
runs-on: ${{ contains(fromJSON('["CROSSED_TRACING_LIBRARIES", "INTEGRATIONS"]'), matrix.scenario) && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
needs:
- get-essential-scenarios
strategy:
matrix:
weblog-variant:
- express4
- express4-typescript
- nextjs
scenario: ${{fromJson(needs.get-essential-scenarios.outputs.scenario)}}
weblog-variant: ${{fromJson(needs.get-essential-scenarios.outputs.endtoend_weblogs)}}
scenario: ${{fromJson(needs.get-essential-scenarios.outputs.endtoend_scenarios)}}

env:
TEST_LIBRARY: nodejs
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.IDM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.IDM_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
AWS_DEFAULT_REGION: us-east-1 # AWS services should use `AWS_REGION`, but some still use the older `AWS_DEFAULT_REGION`

steps:
- name: Checkout system tests
Expand Down Expand Up @@ -86,7 +81,7 @@ jobs:
if: ${{ always() }}
run: tar -czvf artifact.tar.gz $(ls | grep logs)
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: logs_${{ matrix.weblog-variant }}-${{ matrix.scenario }}
Expand Down
14 changes: 5 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
"type": "node",
"request": "launch",
"name": "Test Current File",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"tdd",
"${file}",
"--inspect-brk=9229"
"skipFiles": [
"<node_internals>/**"
],
"port": 9229,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
"program": "${file}",
"console": "integratedTerminal"
}
]
}
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

2 changes: 2 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc.
require,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki
require,istanbul-lib-coverage,BSD-3-Clause,Copyright 2012-2015 Yahoo! Inc.
require,jest-docblock,MIT,Copyright Meta Platforms, Inc. and affiliates.
require,jsonpath-plus,MIT,Copyright (c) 2011-2019 Stefan Goessner, Subbu Allamaraju, Mike Brevoort, Robert Krahn, Brett Zamir, Richard Schneider
require,koalas,MIT,Copyright 2013-2017 Brian Woodward
require,limiter,MIT,Copyright 2011 John Hurliman
require,lodash.sortby,MIT,Copyright JS Foundation and other contributors
Expand All @@ -26,6 +27,7 @@ require,pprof-format,MIT,Copyright 2022 Stephen Belanger
require,protobufjs,BSD-3-Clause,Copyright 2016 Daniel Wirtz
require,tlhunter-sorted-set,MIT,Copyright (c) 2023 Datadog Inc.
require,retry,MIT,Copyright 2011 Tim Koschützki Felix Geisendörfer
require,rfdc,MIT,Copyright 2019 David Mark Clements
require,semver,ISC,Copyright Isaac Z. Schlueter and Contributors
require,shell-quote,mit,Copyright (c) 2013 James Halliday
dev,@types/node,MIT,Copyright Authors
Expand Down
3 changes: 0 additions & 3 deletions docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,6 @@ tracer.use('http', {
tracer.use('http', {
client: httpClientOptions
});
tracer.use('http', {
enablePropagationWithAmazonHeaders: true
});
tracer.use('http2');
tracer.use('http2', {
server: http2ServerOptions
Expand Down
28 changes: 20 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,26 @@ declare namespace tracer {
* The selection and priority order of context propagation injection and extraction mechanisms.
*/
propagationStyle?: string[] | PropagationStyle

/**
* Cloud payload report as tags
*/
cloudPayloadTagging?: {
/**
* Additional JSONPath queries to replace with `redacted` in request payloads
* Undefined or invalid JSONPath queries disable the feature for requests.
*/
request?: string,
/**
* Additional JSONPath queries to replace with `redacted` in response payloads
* Undefined or invalid JSONPath queries disable the feature for responses.
*/
response?: string,
/**
* Maximum depth of payload traversal for tags
*/
maxDepth?: number
}
}

/**
Expand Down Expand Up @@ -1010,14 +1030,6 @@ declare namespace tracer {
* @default code => code < 500
*/
validateStatus?: (code: number) => boolean;

/**
* Enable injection of tracing headers into requests signed with AWS IAM headers.
* Disable this if you get AWS signature errors (HTTP 403).
*
* @default false
*/
enablePropagationWithAmazonHeaders?: boolean;
}

/** @hidden */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ Then('I should have heard {string}', function (expectedResponse) {
})

When('the greeter says flaky', function () {
this.whatIHeard = globalCounter++ % 2 === 0 ? 'flaky' : 'not flaky'
// It's important that the first time this fails. The reason is the following:
// In `getWrappedRunTestCase` we were returning the first result from
// `runTestCaseFunction`, so if the first time it passed, the EFD logic was
// not kicking in. By making it fail, `runTestCaseResult` is false (fail),
// and the EFD logic is tested correctly, i.e. the test passes as long as a single
// attempt has passed.
this.whatIHeard = globalCounter++ % 2 === 1 ? 'flaky' : 'not flaky'
})
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('can run tests', () => {
})
test('integration test', () => {
// Just for testing purposes, so we don't create a custom span
if (!process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED) {
if (process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED === 'false') {
return Promise.resolve()
}
const testSpan = tracer.scope().active()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { describe, test, expect } from 'vitest'
import { sum } from './sum'

let numAttempt = 0
let numOtherAttempt = 0

describe('early flake detection', () => {
test('can retry tests that eventually pass', { repeats: process.env.SHOULD_REPEAT && 2 }, () => {
expect(sum(1, 2)).to.equal(numAttempt++ > 1 ? 3 : 4)
})

test('can retry tests that always pass', { repeats: process.env.SHOULD_REPEAT && 2 }, () => {
if (process.env.ALWAYS_FAIL) {
expect(sum(1, 2)).to.equal(4)
} else {
expect(sum(1, 2)).to.equal(3)
}
})

test('does not retry if it is not new', () => {
expect(sum(1, 2)).to.equal(3)
})

test.skip('does not retry if the test is skipped', () => {
expect(sum(1, 2)).to.equal(3)
})

if (process.env.SHOULD_ADD_EVENTUALLY_FAIL) {
test('can retry tests that eventually fail', () => {
expect(sum(1, 2)).to.equal(numOtherAttempt++ < 3 ? 3 : 4)
})
}
})
Loading
Loading