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.21.0 proposal #3871

Merged
merged 36 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
585ec42
[core] Collapse Next.js Static Resources to Reduce Cardinality (#3809)
sabrenner Nov 21, 2023
e97ace9
API Security integration (#3685)
hoolioh Nov 22, 2023
dd240af
Expose a promise for profiler start (#3817)
szegedi Nov 24, 2023
b842082
Add source code integration tags to profiles (#3821)
nsavoire Nov 24, 2023
dd42d7a
[ci-visibility] Fix debug message for ITR settings (#3825)
juan-fernandez Nov 27, 2023
ea6ccd6
instrument aerospike v4, v5 (#3804)
khanayan123 Nov 28, 2023
54fe1df
Instrument Aerospike V3 (#3830)
khanayan123 Nov 29, 2023
7c40c38
[ci-visibility] New ITR settings logic (#3790)
juan-fernandez Dec 1, 2023
0b12655
[ci-visibility] Do not report total code coverage unless user has exp…
juan-fernandez Dec 1, 2023
daf81b5
PROF-8520: Add DNS events to timeline (#3822)
szegedi Dec 1, 2023
51b8442
configurable tracing header w/ aws signed request (#3836)
tlhunter Dec 1, 2023
20ca899
[core] Do Not Report HTTP Requests Over 5 Seconds as Errors on Node 2…
sabrenner Dec 1, 2023
94ed847
Fix integ tests for DNS (#3844)
szegedi Dec 5, 2023
b3ce51a
Detect header injection code vulnerability (#3813)
uurien Dec 5, 2023
7c05480
Add integration test for OOM in worker (#3843)
nsavoire Dec 6, 2023
8605394
[core] Ensure Explicit Timeouts from Underlying Request Socket are Re…
sabrenner Dec 8, 2023
bfbb7a7
chore: updating protobuf for security reasons (#3851)
tlhunter Dec 8, 2023
65ba4f1
PROF-8523: Add Net events to timeline (#3832)
szegedi Dec 11, 2023
8cd9dd6
Partially upgrade instrumentation telemetry from v1 to v2 (#3827)
ida613 Dec 11, 2023
2988bfe
Emit address and port as separate labels; it's more compact like that…
szegedi Dec 12, 2023
0a6b7e9
[ci-visibility] Speed up git unshallow (#3839)
juan-fernandez Dec 12, 2023
70383b1
Update rules version to v1.10.0 (#3857)
uurien Dec 12, 2023
73cdb85
manual logging and garbage collection of old spans (#3849)
tlhunter Dec 12, 2023
9a01460
chore: fix aws-sdk failing test suite (#3860)
wconti27 Dec 12, 2023
317c724
create a security policy via SECURITY.md (#3863)
tlhunter Dec 12, 2023
9eb9d18
Apply new rules for header injection detection to prevent false posit…
uurien Dec 13, 2023
84f9eaa
restify: resolve 0th promise arg, not arguments (#3818)
tlhunter Dec 13, 2023
5d9f715
PROF-8523: Bugfix and integration test for Net timeline events (#3870)
szegedi Dec 13, 2023
8c7ff18
Fix failing Aerospike tests (#3873)
khanayan123 Dec 14, 2023
6f4dd76
Only run DNS and Net timeline events integration tests on Node 16+ (#…
szegedi Dec 14, 2023
4e14d25
Fix tedious and elasticsearch plugin tests (#3877)
juan-fernandez Dec 14, 2023
7c32247
DSM: add kafka offset lag (#3761)
Dec 14, 2023
01f7587
ci: no longer test sharedb against node v14 (#3881)
tlhunter Dec 14, 2023
6b39b4b
PROF-8521: Remove lane logic from profiler library (#3880)
szegedi Dec 14, 2023
229ccfd
quick telemetry test fix (#3882)
ida613 Dec 14, 2023
dba6ad5
v4.21.0
khanayan123 Dec 13, 2023
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
156 changes: 146 additions & 10 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,132 @@ env:


jobs:
aerospike-3:
runs-on: ubuntu-latest
container:
image: ubuntu:18.04
services:
aerospike:
image: aerospike:ce-5.3.0.16
ports:
- 3000:3000
testagent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:latest
env:
LOG_LEVEL: DEBUG
TRACE_LANGUAGE: javascript
DISABLED_CHECKS: trace_content_length
PORT: 9126
ports:
- 9126:9126
env:
PLUGINS: aerospike
SERVICES: aerospike
PACKAGE_VERSION_RANGE: '3.16.2 - 3.16.7'
DD_TEST_AGENT_URL: http://testagent:9126
AEROSPIKE_HOST_ADDRESS: aerospike
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '14'
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "::set-output name=json::$content"
- id: extract
run: |
version="${{fromJson(steps.pkg.outputs.json).version}}"
majorVersion=$(echo "$version" | cut -d '.' -f 1)
echo "Major Version: $majorVersion"
echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV
- name: Check package version
if: env.MAJOR_VERSION == '3'
run: |
echo "Package version is 3. Proceeding with the next steps."
- name: Install dependencies
if: env.MAJOR_VERSION == '3'
run: |
apt-get update && \
apt-get install -y \
python3 python3-pip \
wget \
g++ libssl1.0.0 libssl-dev zlib1g-dev && \
npm install -g yarn
- if: env.MAJOR_VERSION == '3'
run: yarn install --ignore-engines
- if: env.MAJOR_VERSION == '3'
uses: ./.github/actions/node/14
- if: env.MAJOR_VERSION == '3'
run: yarn test:plugins:ci
- if: env.MAJOR_VERSION == '3'
uses: codecov/codecov-action@v2
aerospike-4:
runs-on: ubuntu-latest
services:
aerospike:
image: aerospike:ce-5.7.0.15
ports:
- "127.0.0.1:3000-3002:3000-3002"
env:
PLUGINS: aerospike
SERVICES: aerospike
PACKAGE_VERSION_RANGE: '4.0.0 - 5.4.0'
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- run: yarn install --ignore-engines
- uses: ./.github/actions/node/oldest
- run: yarn test:plugins:ci
- if: always()
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v2
aerospike-5:
runs-on: ubuntu-latest
services:
aerospike:
image: aerospike:ce-6.4.0.3
ports:
- "127.0.0.1:3000-3002:3000-3002"
env:
PLUGINS: aerospike
SERVICES: aerospike
PACKAGE_VERSION_RANGE: '5.5.0 - 5.7.0'
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "::set-output name=json::$content"
- id: extract
run: |
version="${{fromJson(steps.pkg.outputs.json).version}}"
majorVersion=$(echo "$version" | cut -d '.' -f 1)
echo "Major Version: $majorVersion"
echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV
- name: Check package version
if: env.MAJOR_VERSION != '3'
run: |
echo "Package version is not 3. Proceeding with the next steps."
- if: env.MAJOR_VERSION != '3'
run: yarn install --ignore-engines
- if: env.MAJOR_VERSION != '3'
uses: ./.github/actions/node/oldest
- if: env.MAJOR_VERSION != '3'
run: yarn test:plugins:ci
- if: env.MAJOR_VERSION != '3'
run: echo "PACKAGE_VERSION_RANGE=>=5.8.0" >> "$GITHUB_ENV"
- if: env.MAJOR_VERSION != '3'
uses: ./.github/actions/node/20 # currently the latest version of aerospike only supports node 20
- if: env.MAJOR_VERSION != '3'
run: yarn test:plugins:ci
- if: env.MAJOR_VERSION != '3'
uses: ./.github/actions/testagent/logs
- if: env.MAJOR_VERSION != '3'
uses: codecov/codecov-action@v2
amqp10: # TODO: move rhea to its own job
runs-on: ubuntu-latest
services:
Expand Down Expand Up @@ -77,9 +203,9 @@ jobs:
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:1.1.0
image: localstack/localstack:3.0.2
env:
LOCALSTACK_SERVICES: dynamodb,kinesis,s3,sqs,sns,redshift,route53,logs,serverless
LOCALSTACK_SERVICES: dynamodb,kinesis,s3,sqs,sns,redshift,route53,logs,serverless,lambda
EXTRA_CORS_ALLOWED_HEADERS: x-amz-request-id,x-amzn-requestid,x-amz-id-2
EXTRA_CORS_EXPOSE_HEADERS: x-amz-request-id,x-amzn-requestid,x-amz-id-2
AWS_DEFAULT_REGION: us-east-1
Expand All @@ -88,9 +214,26 @@ jobs:
START_WEB: '0'
ports:
- 4566:4566
# we have two localstacks since upgrading localstack was causing lambda & S3 tests to fail
# To-Do: Debug localstack / lambda and localstack / S3
localstack-legacy:
image: localstack/localstack:1.1.0
ports:
- "127.0.0.1:4567:4567" # Edge
env:
LOCALSTACK_SERVICES: dynamodb,kinesis,s3,sqs,sns,redshift,route53,logs,serverless
EXTRA_CORS_ALLOWED_HEADERS: x-amz-request-id,x-amzn-requestid,x-amz-id-2
EXTRA_CORS_EXPOSE_HEADERS: x-amz-request-id,x-amzn-requestid,x-amz-id-2
AWS_DEFAULT_REGION: us-east-1
FORCE_NONINTERACTIVE: 'true'
LAMBDA_EXECUTOR: local
START_WEB: '0'
GATEWAY_LISTEN: 127.0.0.1:4567
EDGE_PORT: 4567
EDGE_PORT_HTTP: 4567
env:
PLUGINS: aws-sdk
SERVICES: localstack
SERVICES: localstack localstack-legacy
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/testagent/start
Expand Down Expand Up @@ -291,8 +434,6 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- run: yarn install
- uses: ./.github/actions/node/oldest
- run: yarn test:plugins:ci
- uses: ./.github/actions/node/latest
- run: yarn test:plugins:ci
- if: always()
Expand Down Expand Up @@ -1041,8 +1182,6 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- run: yarn install
- uses: ./.github/actions/node/oldest
- run: yarn test:plugins:ci
- uses: ./.github/actions/node/latest
- run: yarn test:plugins:ci
- if: always()
Expand All @@ -1068,9 +1207,6 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- run: yarn install
- uses: ./.github/actions/node/16
- run: yarn test:plugins:ci
- run: yarn test:plugins:upstream
- uses: ./.github/actions/node/latest
- run: yarn test:plugins:ci
- run: yarn test:plugins:upstream
Expand Down
1 change: 1 addition & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ require,opentracing,MIT,Copyright 2016 Resonance Labs Inc
require,path-to-regexp,MIT,Copyright 2014 Blake Embrey
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,semver,ISC,Copyright Isaac Z. Schlueter and Contributors
dev,@types/node,MIT,Copyright Authors
Expand Down
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

This document outlines the security policy for the Datadog Node.js Tracer (aka `dd-trace-js`) and what to do if you discover a security vulnerability in the project.
Most notably, please do not share the details in a public forum (such as in a discussion, issue, or pull request) but instead reach out to us with the details.
This gives us an opportunity to release a fix for others to benefit from by the time details are made public.


## Supported Versions

We accept vulnerability submissions for any [currently maintained release lines](https://github.com/DataDog/dd-trace-js#version-release-lines-and-maintenance).


## Reporting a Vulnerability

If you discover a vulnerability in the Datadog Node.js Tracer (or any Datadog product for that matter) please submit details to the following email address:

* [[email protected]](mailto:[email protected])
39 changes: 35 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: "2"
services:
aerospike:
image: aerospike:ce-6.4.0.3
ports:
- "127.0.0.1:3000-3002:3000-3002"
couchbase:
image: ghcr.io/datadog/couchbase-server-sandbox:latest
ports:
Expand Down Expand Up @@ -83,31 +87,58 @@ services:
ports:
- "127.0.0.1:8081:8081"
localstack:
# TODO: Figure out why SNS doesn't work in >=1.2
# https://github.com/localstack/localstack/issues/7479
image: localstack/localstack:1.1.0
image: localstack/localstack:3.0.2
ports:
- "127.0.0.1:4566:4566" # Edge
environment:
- LOCALSTACK_SERVICES=dynamodb,kinesis,s3,sqs,sns,redshift,route53,logs,serverless,lambda
- EXTRA_CORS_ALLOWED_HEADERS=x-amz-request-id,x-amzn-requestid,x-amz-id-2
- EXTRA_CORS_EXPOSE_HEADERS=x-amz-request-id,x-amzn-requestid,x-amz-id-2
- AWS_DEFAULT_REGION=us-east-1
- FORCE_NONINTERACTIVE=true
- START_WEB=0
- DEBUG=${DEBUG-}
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
localstack-legacy:
# we have two localstacks since upgrading localstack was causing lambda & S3 tests to fail
# To-Do: Debug localstack / lambda and localstack / S3
image: localstack/localstack:1.1.0
ports:
- "127.0.0.1:4567:4567" # Edge
environment:
- LOCALSTACK_SERVICES=dynamodb,kinesis,s3,sqs,sns,redshift,route53,logs,serverless
- EXTRA_CORS_ALLOWED_HEADERS=x-amz-request-id,x-amzn-requestid,x-amz-id-2
- EXTRA_CORS_EXPOSE_HEADERS=x-amz-request-id,x-amzn-requestid,x-amz-id-2
- AWS_DEFAULT_REGION=us-east-1
- FORCE_NONINTERACTIVE=true
- START_WEB=0
- GATEWAY_LISTEN=127.0.0.1:4567
- EDGE_PORT=4567
- EDGE_PORT_HTTP=4567
- LAMBDA_EXECUTOR=local
kafka:
image: debezium/kafka:1.7
platform: linux/arm64
image: wurstmeister/kafka:2.13-2.8.1
ports:
- "127.0.0.1:9092:9092"
- "127.0.0.1:9093:9093"
environment:
- CLUSTER_ID=5Yr1SIgYQz-b-dgRabWx4g
- NODE_ID=1
- CREATE_TOPICS="test-topic:1:1"
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_CONTROLLER_QUORUM_VOTERS=1@kafka:9093
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
depends_on:
- zookeeper
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
opensearch:
image: opensearchproject/opensearch:2
environment:
Expand Down
7 changes: 7 additions & 0 deletions docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ tracer.init({
blockedTemplateJson: './blocked.json',
eventTracking: {
mode: 'safe'
},
apiSecurity: {
enabled: true,
requestSampling: 1.0
}
}
});
Expand Down Expand Up @@ -288,6 +292,9 @@ tracer.use('http', {
tracer.use('http', {
client: httpClientOptions
});
tracer.use('http', {
enablePropagationWithAmazonHeaders: true
});
tracer.use('http2');
tracer.use('http2', {
server: http2ServerOptions
Expand Down
24 changes: 24 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,22 @@ export declare interface TracerOptions {
* @default 'safe'
*/
mode?: 'safe' | 'extended' | 'disabled'
},

/**
* Configuration for Api Security sampling
*/
apiSecurity?: {
/** Whether to enable Api Security.
* @default false
*/
enabled?: boolean,

/** Controls the request sampling rate (between 0 and 1) in which Api Security is triggered.
* The value will be coerced back if it's outside of the 0-1 range.
* @default 0.1
*/
requestSampling?: number
}
};

Expand Down Expand Up @@ -927,6 +943,14 @@ declare namespace plugins {
* @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
3 changes: 2 additions & 1 deletion integration-tests/ci-visibility-intake.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const { FakeAgent } = require('./helpers')

const DEFAULT_SETTINGS = {
code_coverage: true,
tests_skipping: true
tests_skipping: true,
itr_enabled: true
}

const DEFAULT_SUITES_TO_SKIP = []
Expand Down
Loading
Loading