Skip to content

Commit

Permalink
Merge branch 'master' into khanayan123/update-otel-invalid-telemetry-…
Browse files Browse the repository at this point in the history
…calculation
  • Loading branch information
khanayan123 authored Jun 24, 2024
2 parents 2d6993f + e939d31 commit 502b03c
Show file tree
Hide file tree
Showing 118 changed files with 5,026 additions and 983 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/datadog-static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Datadog Static Analysis

on:
pull_request:
push:
branches: [master]

jobs:
static-analysis:
runs-on: ubuntu-latest
name: Datadog Static Analyzer
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check code meets quality and security standards
id: datadog-static-analysis
uses: DataDog/datadog-static-analyzer-github-action@v1
with:
dd_api_key: ${{ secrets.DD_STATIC_ANALYSIS_API_KEY }}
dd_app_key: ${{ secrets.DD_STATIC_ANALYSIS_APP_KEY }}
dd_service: dd-trace-js
dd_env: ci
dd_site: datadoghq.com
cpu_count: 2
26 changes: 19 additions & 7 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ jobs:
runs-on: ubuntu-latest
services:
cassandra:
image: spotify/cassandra
env:
CASSANDRA_TOKEN: '-9223372036854775808'
image: cassandra:3-focal
ports:
- 9042:9042
env:
Expand Down Expand Up @@ -946,10 +944,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/testagent/start
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ matrix.version }}
- uses: ./.github/actions/node/setup
- run: yarn install
- run: yarn test:plugins:ci
- if: always()
Expand Down Expand Up @@ -1248,6 +1243,23 @@ jobs:
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v3

undici:
runs-on: ubuntu-latest
env:
PLUGINS: undici
steps:
- uses: actions/checkout@v4
- 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()
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v3

when:
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ stages:
- benchmarks-pr-comment
- single-step-instrumentation-tests
- manual_images
- macrobenchmarks

include:
- remote: https://gitlab-templates.ddbuild.io/apm/packaging.yml
- local: ".gitlab/benchmarks.yml"
- local: ".gitlab/single-step-instrumentation-tests.yml"
- local: ".gitlab/macrobenchmarks.yml"

variables:

Expand Down
8 changes: 4 additions & 4 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
BASE_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-js
MICROBENCHMARKS_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-js
SLS_CI_IMAGE: registry.ddbuild.io/ci/serverless-tools:1

# Benchmark's env variables. Modify to tweak benchmark parameters.
Expand All @@ -10,7 +10,7 @@ variables:
stage: benchmarks
when: on_success
tags: ["runner:apm-k8s-tweaked-metal"]
image: $BASE_CI_IMAGE
image: $MICROBENCHMARKS_CI_IMAGE
interruptible: true
timeout: 15m
script:
Expand All @@ -31,7 +31,7 @@ benchmarks-pr-comment:
stage: benchmarks-pr-comment
when: on_success
tags: ["arch:amd64"]
image: $BASE_CI_IMAGE
image: $MICROBENCHMARKS_CI_IMAGE
script:
- cd platform && (git init && git remote add origin https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform && git pull origin dd-trace-js)
- bp-runner bp-runner.pr-comment.yml --debug
Expand All @@ -44,7 +44,7 @@ check-big-regressions:
stage: benchmarks-pr-comment
when: on_success
tags: ["arch:amd64"]
image: $BASE_CI_IMAGE
image: $MICROBENCHMARKS_CI_IMAGE
script:
- cd platform && (git init && git remote add origin https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform && git pull origin dd-trace-js)
- bp-runner bp-runner.fail-on-regression.yml --debug
Expand Down
67 changes: 67 additions & 0 deletions .gitlab/macrobenchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.macrobenchmarks:
stage: macrobenchmarks
rules:
- if: ($NIGHTLY_BENCHMARKS || $CI_PIPELINE_SOURCE != "schedule") && $CI_COMMIT_REF_NAME == "master"
when: always
- when: manual
tags: ["runner:apm-k8s-same-cpu"]
needs: []
interruptible: true
timeout: 1h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:js-hapi
script:
- git clone --branch js/hapi https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
- bp-runner bp-runner.yml --debug -t
artifacts:
name: "artifacts"
when: always
paths:
- platform/artifacts/
expire_in: 3 months
variables:
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"

K6_OPTIONS_WARMUP_RATE: 500
K6_OPTIONS_WARMUP_DURATION: 1m
K6_OPTIONS_WARMUP_GRACEFUL_STOP: 10s
K6_OPTIONS_WARMUP_PRE_ALLOCATED_VUS: 4
K6_OPTIONS_WARMUP_MAX_VUS: 4

K6_OPTIONS_NORMAL_OPERATION_RATE: 300
K6_OPTIONS_NORMAL_OPERATION_DURATION: 10m
K6_OPTIONS_NORMAL_OPERATION_GRACEFUL_STOP: 10s
K6_OPTIONS_NORMAL_OPERATION_PRE_ALLOCATED_VUS: 4
K6_OPTIONS_NORMAL_OPERATION_MAX_VUS: 4

K6_OPTIONS_HIGH_LOAD_RATE: 700
K6_OPTIONS_HIGH_LOAD_DURATION: 3m
K6_OPTIONS_HIGH_LOAD_GRACEFUL_STOP: 10s
K6_OPTIONS_HIGH_LOAD_PRE_ALLOCATED_VUS: 4
K6_OPTIONS_HIGH_LOAD_MAX_VUS: 4

DDTRACE_INSTALL_VERSION: "git://github.com/Datadog/dd-trace-js.git#${CI_COMMIT_SHA}"

# Workaround: Currently we're not running the benchmarks on every PR, but GitHub still shows them as pending.
# By marking the benchmarks as allow_failure, this should go away. (This workaround should be removed once the
# benchmarks get changed to run on every PR)
allow_failure: true

# Retry on Gitlab internal system failures
retry:
max: 2
when:
- unknown_failure
- data_integrity_failure
- runner_system_failure
- scheduler_failure
- api_failure

baseline:
extends: .macrobenchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: baseline

only-tracing:
extends: .macrobenchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: only-tracing
26 changes: 25 additions & 1 deletion .gitlab/single-step-instrumentation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- export DD_APP_KEY_ONBOARDING=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.dd-app-key-onboarding --with-decryption --query "Parameter.Value" --out text)
- export ONBOARDING_AWS_INFRA_SUBNET_ID=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.aws-infra-subnet-id --with-decryption --query "Parameter.Value" --out text)
- export ONBOARDING_AWS_INFRA_SECURITY_GROUPS_ID=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.aws-infra-securiy-groups-id --with-decryption --query "Parameter.Value" --out text)
- export ONBOARDING_AWS_INFRA_IAM_INSTANCE_PROFILE=ec2InstanceRole
- export PULUMI_CONFIG_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.pulumi-config-passphrase --with-decryption --query "Parameter.Value" --out text)
#Install plugins for PULUMI you need connect to gh. Sometimes this problem arises: GitHub rate limit exceeded
- export GITHUB_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.gh-token --with-decryption --query "Parameter.Value" --out text)
Expand Down Expand Up @@ -64,4 +65,27 @@ onboarding_tests:
- ls system-tests/binaries
- cd system-tests
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env prod --vm-library ${TEST_LIBRARY} --vm-provider aws --vm-skip-branches ubuntu18_amd64
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env prod --vm-library ${TEST_LIBRARY} --vm-provider aws --vm-skip-branches ubuntu18_amd64

onboarding_tests_installer:
extends: .base_job_onboarding_tests
stage: single-step-instrumentation-tests
needs: [oci-internal-test-ecr-publish]
rules:
- when: on_success
allow_failure: true
allow_failure: false
variables:
TEST_LIBRARY: nodejs
ONBOARDING_FILTER_ENV: prod
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs,test-app-nodejs-container]
SCENARIO: [INSTALLER_AUTO_INJECTION]
script:
- git clone https://[email protected]/DataDog/system-tests.git system-tests
- export DD_INSTALLER_LIBRARY_VERSION="pipeline-${CI_PIPELINE_ID}"
- ls system-tests/binaries
- cd system-tests
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env prod --vm-library ${TEST_LIBRARY} --vm-provider aws --vm-skip-branches ubuntu18_amd64
9 changes: 4 additions & 5 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/packages/dd-trace/src/appsec/ @DataDog/asm-js
/packages/dd-trace/test/appsec/ @DataDog/asm-js
/packages/dd-trace/src/lambda/ @DataDog/serverless
/packages/dd-trace/test/lambda/ @DataDog/serverless
/packages/dd-trace/src/lambda/ @DataDog/serverless-aws
/packages/dd-trace/test/lambda/ @DataDog/serverless-aws

/packages/datadog-plugin-*/ @Datadog/dd-trace-js @Datadog/apm-idm-js
/packages/datadog-instrumentations/ @Datadog/dd-trace-js @Datadog/apm-idm-js
Expand Down Expand Up @@ -42,7 +42,7 @@
/.github/workflows/ci-visibility-performance.yml @DataDog/ci-app-libraries
/.github/workflows/codeql-analysis.yml @DataDog/dd-trace-js
/.github/workflows/core.yml @DataDog/dd-trace-js
/.github/workflows/lambda.yml @DataDog/serverless-apm
/.github/workflows/lambda.yml @DataDog/serverless-aws
/.github/workflows/package-size.yml @DataDog/dd-trace-js
/.github/workflows/plugins.yml @DataDog/dd-trace-js
/.github/workflows/pr-labels.yml @DataDog/dd-trace-js
Expand All @@ -52,8 +52,7 @@
/.github/workflows/release-dev.yml @DataDog/dd-trace-js
/.github/workflows/release-latest.yml @DataDog/dd-trace-js
/.github/workflows/release-proposal.yml @DataDog/dd-trace-js
/.github/workflows/serverless-integration-test.yml @DataDog/serverless
/.github/workflows/serverless-performance.yml @DataDog/serverless-apm @DataDog/serverless
/.github/workflows/serverless-integration-test.yml @DataDog/serverless-aws @DataDog/serverless
/.github/workflows/system-tests.yml @DataDog/asm-js
/.github/workflows/test-k8s-lib-injection.yaml @DataDog/dd-trace-js
/.github/workflows/tracing.yml @DataDog/dd-trace-js
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ services:
ports:
- "11211:11211"
cassandra:
image: spotify/cassandra
environment:
- CASSANDRA_TOKEN=-9223372036854775808
image: cassandra:3-focal
ports:
- "127.0.0.1:9042:9042"
limitd:
Expand Down
2 changes: 2 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ tracer.use('pg', {
<h5 id="restify-tags"></h5>
<h5 id="restify-config"></h5>
<h5 id="tedious"></h5>
<h5 id="undici"></h5>
<h5 id="when"></h5>
<h5 id="winston"></h5>
<h3 id="integrations-list">Available Plugins</h3>
Expand Down Expand Up @@ -146,6 +147,7 @@ tracer.use('pg', {
* [restify](./interfaces/export_.plugins.restify.html)
* [router](./interfaces/export_.plugins.router.html)
* [tedious](./interfaces/export_.plugins.tedious.html)
* [undici](./interfaces/export_.plugins.undici.html)
* [when](./interfaces/export_.plugins.when.html)
* [winston](./interfaces/export_.plugins.winston.html)

Expand Down
1 change: 1 addition & 0 deletions docs/add-redirects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ declare -a plugins=(
"restify"
"router"
"tedious"
"undici"
"when"
"winston"
)
Expand Down
14 changes: 14 additions & 0 deletions docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ tracer.init({
apiSecurity: {
enabled: true,
requestSampling: 1.0
},
rasp: {
enabled: true
},
stackTrace: {
enabled: true,
maxStackTraces: 5,
maxDepth: 42
}
}
});
Expand All @@ -131,6 +139,11 @@ tracer.init({
redactionEnabled: true,
redactionNamePattern: 'password',
redactionValuePattern: 'bearer'
},
appsec: {
standalone: {
enabled: true
}
}
}
})
Expand Down Expand Up @@ -349,6 +362,7 @@ tracer.use('selenium');
tracer.use('sharedb');
tracer.use('sharedb', sharedbOptions);
tracer.use('tedious');
tracer.use('undici');
tracer.use('winston');

tracer.use('express', false)
Expand Down
1 change: 1 addition & 0 deletions ext/tags.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare const tags: {
MANUAL_DROP: 'manual.drop'
MEASURED: '_dd.measured'
BASE_SERVICE: '_dd.base_service'
DD_PARENT_ID: '_dd.parent_id'
HTTP_URL: 'http.url'
HTTP_METHOD: 'http.method'
HTTP_STATUS_CODE: 'http.status_code'
Expand Down
1 change: 1 addition & 0 deletions ext/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const tags = {
MANUAL_DROP: 'manual.drop',
MEASURED: '_dd.measured',
BASE_SERVICE: '_dd.base_service',
DD_PARENT_ID: '_dd.parent_id',

// HTTP
HTTP_URL: 'http.url',
Expand Down
Loading

0 comments on commit 502b03c

Please sign in to comment.