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.23.0 #4736

Merged
merged 60 commits into from
Oct 1, 2024
Merged

v5.23.0 #4736

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
2c50d5d
use shared code for safe wrapping, rather than calling wrapMethod on …
bengl Aug 29, 2024
102d293
Revert "use shared code for safe wrapping, rather than calling wrapMe…
bengl Aug 29, 2024
99e524f
Review Error-throwing sites for whether they can sabotage SSI (#4627)
szegedi Aug 30, 2024
3ef9555
[test visibility] Add test session name (#4621)
juan-fernandez Sep 2, 2024
a429889
aws payload tagging (#4309)
tlhunter Sep 3, 2024
5f80887
feat(kafka): add datastreams monitoring support for kafkajs batches (…
wconti27 Sep 3, 2024
9e012cc
Add permissions to package-size-report workflow (#4650)
CarlesDD Sep 4, 2024
3606b91
Allow Remote Config acknowledgements to be async (#4638)
watson Sep 4, 2024
85b8f3a
fix(openai): content and tool calls in streamed responses do not erro…
sabrenner Sep 4, 2024
e5b9317
[test visibility] Fix cucumber e2e tests (#4654)
juan-fernandez Sep 5, 2024
e98adf9
Check context disposal before calling WAF run (#4653)
CarlesDD Sep 5, 2024
f5106b9
[test visibility] Use new metadata field in citestcycle (#4649)
juan-fernandez Sep 6, 2024
9c1e2a7
Bump path-to-regexp dependency to v0.1.10 (#4664)
watson Sep 10, 2024
3c6756d
Stop instrumenting microgateway-core >3.0.0 (#4660)
uurien Sep 10, 2024
f835e64
[test visibility] Enable log collection for test visibility (#4657)
juan-fernandez Sep 10, 2024
4ce6b36
Fix package.json and yarn.lock issues (#4661)
watson Sep 10, 2024
50974ca
Filter addresses before calling to waf to prevent running without kno…
uurien Sep 10, 2024
852ba2f
Revert "[test visibility] Use new metadata field in citestcycle (#46…
juan-fernandez Sep 10, 2024
8efdf49
Update to actions/upload-artifact@v4 in system tests workflow (#4669)
uurien Sep 11, 2024
097b9f9
Exploit prevention SQLi in pg (#4566)
uurien Sep 11, 2024
c120178
split couchbase tests by node versions (#4667)
rochdev Sep 11, 2024
eec5820
Add rasp capabilities in RC (#4672)
uurien Sep 11, 2024
a8729df
clearer profiling error
bengl Sep 3, 2024
dd8aa36
[test visibility] Fix cucumber@11 (#4666)
juan-fernandez Sep 12, 2024
3a4fa9f
Revert "Fix Node.js version to v22.6 instead of "latest" (#4629)" (#4…
watson Sep 12, 2024
22b4bcc
[test visibility] Cap vitest support until we fix it (#4681)
juan-fernandez Sep 13, 2024
9d6bb48
PROF-10497: Add span IDs to timeline DNS and TCP events (#4655)
szegedi Sep 13, 2024
6edbb51
[test visibility] Fix [email protected] (#4682)
juan-fernandez Sep 13, 2024
34b52c6
[test visibility] Fix @jest/test-sequencer instrumentation (#4678)
juan-fernandez Sep 13, 2024
e5cc13c
Prepare support for Dynamic Instrumentation (#4492)
watson Sep 13, 2024
20ea2b2
[DI] Make it easier to debug integration test (#4683)
watson Sep 14, 2024
cf05fde
[DI] Improve variable naming (#4684)
watson Sep 16, 2024
b68a8b3
[DI] DRY up integration test code (#4685)
watson Sep 16, 2024
ca71169
[test visibility] Add test source file to test suites (#4677)
juan-fernandez Sep 16, 2024
cc36b57
[DI] Simplify integration test by not using async/await (#4686)
watson Sep 16, 2024
7b836eb
system-tests : Use reusable workflow to get scenario/weblog list (#4691)
cbeauchesne Sep 16, 2024
42a947d
fix system tests (#4688)
wconti27 Sep 16, 2024
a704ea3
Revert "Revert "[test visibility] Use new metadata field in citestcyc…
juan-fernandez Sep 17, 2024
32586b7
add dsm schema tracking (#4687)
wconti27 Sep 19, 2024
871a128
Fix tedious and fastify plugin tests (#4710)
juan-fernandez Sep 20, 2024
6eb95ec
fix(openai): do not add usage tags or emit usage metrics if they are …
sabrenner Sep 20, 2024
87543c1
[test visibility] Rename DD_SESSION_NAME to DD_TEST_SESSION_NAME (#4703)
juan-fernandez Sep 20, 2024
42fde60
Revert "[test visibility] Enable log collection for test visibility …
juan-fernandez Sep 20, 2024
5b69a94
[test visibility] Report logical CPU count (#4709)
juan-fernandez Sep 20, 2024
7304c5e
restore next test version range (#4711)
rochdev Sep 20, 2024
2a8c61d
[test visibility] Remove beta flag from manual test API (#4705)
juan-fernandez Sep 23, 2024
3582894
[test visibility] Early Flake Detection for vitest (#4714)
juan-fernandez Sep 25, 2024
d418dd6
Remove debug code in test file (#4721)
watson Sep 25, 2024
361a680
Update/fix settings in .vscode directory (#4722)
watson Sep 25, 2024
7a7b9df
always enable tracing header injection for AWS requests (#4717)
tlhunter Sep 25, 2024
2f8b077
Use DD_VERSION as version for tracer computed stats if available (#4720)
duncanpharvey Sep 26, 2024
4d527d7
[test visibility] Early flake detection for mocha (parallel mode) (#4…
juan-fernandez Sep 27, 2024
1fe2488
pin iitm (#4732)
juan-fernandez Sep 27, 2024
3a1f2b8
Moving Rhea plugin test to its own job (#4731)
crysmags Sep 27, 2024
6b82e5c
Fix: Calculate correct Content-Length in requests to agent (#4734)
watson Sep 27, 2024
44aa97d
[test visibility] Support early flake detection for cucumber (#4733)
juan-fernandez Sep 30, 2024
625b4b4
Do not run fastify >=5 plugin tests in node <=18 (#4737)
juan-fernandez Sep 30, 2024
b9a9a55
Bump import-in-the-middle to 1.11.2 (#4740)
juan-fernandez Sep 30, 2024
daab7f7
fix: still set dsm consume checkpoint when no DSM parent context is a…
wconti27 Sep 30, 2024
2fdad9f
v5.23.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 @@ -208,7 +208,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 @@ -96,7 +96,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 @@ -107,7 +107,7 @@ jobs:
ports:
- 5673:5672
env:
PLUGINS: amqp10|rhea
PLUGINS: amqp10
SERVICES: qpid
DD_DATA_STREAMS_ENABLED: true
steps:
Expand Down Expand Up @@ -139,7 +139,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 @@ -245,7 +245,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 @@ -262,8 +266,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 @@ -412,7 +419,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 @@ -648,7 +655,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 @@ -825,6 +833,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 @@ -852,7 +878,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