Skip to content

Commit 329916f

Browse files
committed
Merge branch 'master' into ishabi/fastify-iast
2 parents d7bdb68 + ef608d6 commit 329916f

File tree

446 files changed

+1851
-660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

446 files changed

+1851
-660
lines changed

.github/actions/install/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ runs:
1818
shell: bash
1919
if: inputs.cache == 'true' && steps.yarn-cache.outputs.cache-hit == 'true'
2020
# Retry in case of server error from registry.
21-
- run: yarn install --frozen-lockfile --ignore-engines || yarn install --frozen-lockfile --ignore-engines
21+
# Wait 60 seconds to give the registry server time to heal.
22+
- run: yarn install --frozen-lockfile --ignore-engines || sleep 60 && yarn install --frozen-lockfile --ignore-engines
2223
shell: bash
2324
- run: tar -cf node_modules.tar node_modules
2425
shell: bash

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ updates:
3131
- dependency-name: "jest-docblock"
3232
# 30.0.0 onwards only supports Node.js 18.14.x and above
3333
update-types: ["version-update:semver-major"]
34+
# The path-to-regexp version has to be the same as used in express v4.
35+
# Consider vendoring it instead.
36+
- dependency-name: "path-to-regexp"
37+
- dependency-name: "lru-cache"
38+
# 11.0.0 onwards only supports Node.js 20 and above
39+
update-types: ["version-update:semver-major"]
3440
groups:
3541
dev-minor-and-patch-dependencies:
3642
dependency-type: "development"

.github/workflows/apm-integrations.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ jobs:
482482
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
483483

484484
kafkajs:
485+
strategy:
486+
matrix:
487+
node-version: ['oldest', 'latest']
485488
runs-on: ubuntu-latest
486489
services:
487490
kafka:
@@ -506,7 +509,17 @@ jobs:
506509
SERVICES: kafka
507510
steps:
508511
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
509-
- uses: ./.github/actions/plugins/test
512+
- uses: ./.github/actions/testagent/start
513+
- uses: ./.github/actions/node
514+
with:
515+
version: ${{ matrix.node-version }}
516+
- uses: ./.github/actions/install
517+
- run: yarn test:plugins:ci
518+
- if: always()
519+
uses: ./.github/actions/testagent/logs
520+
with:
521+
suffix: plugins-${{ github.job }}-${{ matrix.node-version }}
522+
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
510523

511524
koa:
512525
runs-on: ubuntu-latest

.github/workflows/platform.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ jobs:
296296
version: ${{ matrix.version }}
297297
- uses: ./.github/actions/install
298298
- run: yarn add --ignore-scripts mocha@10 # Use older mocha to support old Node.js versions
299+
- run: yarn add --ignore-scripts express@4 # Use older express to support old Node.js versions
299300
- run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js
300301

301302
integration-guardrails-unsupported:

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@ To install dependencies once you have Node and yarn installed, run this in the p
8989
$ yarn
9090
```
9191

92+
## Adding a Plugin
93+
94+
To create a new plugin for a third-party package, follow these steps:
95+
96+
1. `mkdir -p packages/datadog-plugin-<pluginname>/src`
97+
2. Copy an `index.js` file from another plugin to use as a starting point: `cp packages/datadog-plugin-kafkajs/src/index.js packages/datadog-plugin-<pluginname>/src`
98+
3. Edit index.js as appropriate for your new plugin
99+
4. `mkdir -p packages/datadog-plugin-<pluginname>/test`
100+
5. Create an packages/datadog-plugin-<pluginname>/test/index.spec.js file and add the necessary tests. See other plugin tests for inspiration to file structure.
101+
6. Edit index.spec.js as appropriate for your new plugin
102+
7. Add entries to the following files for your new plugin:
103+
- `packages/dd-trace/src/plugins/index.js`
104+
- `index.d.ts`
105+
- `docs/test.ts`
106+
- `docs/API.md`
107+
- `.github/workflows/apm-integrations.yml`
108+
109+
### Adding a Plugin Test to CI
110+
111+
The plugin tests run on pull requests in Github Actions. Each plugin test suite has its own Github job, so adding a new suite to CI
112+
requires adding a new job to the Github Actions config. The file containing these configs is `.github/workflows/apm-integrations.yml`.
113+
You can copypaste and modify an existing plugin job configuration in this file to create a new job config.
92114

93115
## Testing
94116

LICENSE-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ dev,sinon,BSD-3-Clause,Copyright 2010-2017 Christian Johansen
6868
dev,sinon-chai,WTFPL and BSD-2-Clause,Copyright 2004 Sam Hocevar 2012–2017 Domenic Denicola
6969
dev,tap,ISC,Copyright 2011-2022 Isaac Z. Schlueter and Contributors
7070
dev,tiktoken,MIT,Copyright (c) 2022 OpenAI, Shantanu Jain
71+
dev,workerpool,Apache license 2.0,Copyright (C) 2014-2024 Jos de Jong wjosdejong@gmail.com
7172
dev,yaml,ISC,Copyright Eemeli Aro <eemeli@gmail.com>
7273
dev,yarn-deduplicate,Apache license 2.0,Copyright [yyyy] [name of copyright owner]
7374
file,aws-lambda-nodejs-runtime-interface-client,Apache 2.0,Copyright 2019 Amazon.com Inc. or its affiliates. All Rights Reserved.

benchmark/sirun/appsec-iast/insecure-bank.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const http = require('http')
24
const app = require('/opt/insecure-bank-js/app') // eslint-disable-line import/no-absolute-path
35

benchmark/sirun/appsec/insecure-bank.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const http = require('http')
24
const app = require('/opt/insecure-bank-js/app') // eslint-disable-line import/no-absolute-path
35

benchmark/sirun/encoding/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const {
24
ENCODER_VERSION
35
} = process.env

benchmark/sirun/gc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const { createHistogram, PerformanceObserver } = require('perf_hooks')
24
if (createHistogram) {
35
const StatsD = require('./statsd')

0 commit comments

Comments
 (0)