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.7.0 #4172

Merged
merged 17 commits into from
Mar 20, 2024
Merged

v5.7.0 #4172

Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ jobs:
uses: ./.github/actions/install_runner

- name: Build agent
id: build-agent
run: ./build.sh -i agent

- name: Run
run: ./run.sh TRACER_ESSENTIAL_SCENARIOS

- name: Run Cross Tracer Propagation Tests
# run if builds passed (allows these tests to still run in case the previous Run step failed)
if: steps.build-agent.outcome == 'success'
run: ./run.sh CROSSED_TRACING_LIBRARIES

- name: Compress artifact
if: ${{ always() }}
run: tar -czvf artifact.tar.gz $(ls | grep logs)
Expand Down
4 changes: 1 addition & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
!packages/*/lib/**/*
!packages/*/src/**/*
!packages/*/index.js
!scripts/**/*
!scripts/preinstall.js
!vendor/**/*
!CONTRIBUTING.md
!LICENSE
!LICENSE-3rdparty.csv
!MIGRATING.md
!README.md
!index.d.ts
!index.js
Expand Down
100 changes: 50 additions & 50 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,56 +98,56 @@ tracer.use('pg', {
<h5 id="winston"></h5>
<h3 id="integrations-list">Available Plugins</h3>

* [amqp10](./interfaces/plugins.amqp10.html)
* [amqplib](./interfaces/plugins.amqplib.html)
* [aws-sdk](./interfaces/plugins.aws_sdk.html)
* [bluebird](./interfaces/plugins.bluebird.html)
* [couchbase](./interfaces/plugins.couchbase.html)
* [cucumber](./interfaces/plugins.cucumber.html)
* [bunyan](./interfaces/plugins.bunyan.html)
* [cassandra-driver](./interfaces/plugins.cassandra_driver.html)
* [connect](./interfaces/plugins.connect.html)
* [dns](./interfaces/plugins.dns.html)
* [elasticsearch](./interfaces/plugins.elasticsearch.html)
* [express](./interfaces/plugins.express.html)
* [fastify](./interfaces/plugins.fastify.html)
* [fetch](./interfaces/plugins.fetch.html)
* [generic-pool](./interfaces/plugins.generic_pool.html)
* [google-cloud-pubsub](./interfaces/plugins.google_cloud_pubsub.html)
* [graphql](./interfaces/plugins.graphql.html)
* [grpc](./interfaces/plugins.grpc.html)
* [hapi](./interfaces/plugins.hapi.html)
* [http](./interfaces/plugins.http.html)
* [http2](./interfaces/plugins.http2.html)
* [ioredis](./interfaces/plugins.ioredis.html)
* [jest](./interfaces/plugins.jest.html)
* [kafkajs](./interfaces/plugins.kafkajs.html)
* [knex](./interfaces/plugins.knex.html)
* [koa](./interfaces/plugins.koa.html)
* [ldapjs](./interfaces/plugins.ldapjs.html)
* [mariadb](./interfaces/plugins.mariadb.html)
* [microgateway--core](./interfaces/plugins.microgateway_core.html)
* [mocha](./interfaces/plugins.mocha.html)
* [mongodb-core](./interfaces/plugins.mongodb_core.html)
* [mysql](./interfaces/plugins.mysql.html)
* [mysql2](./interfaces/plugins.mysql2.html)
* [net](./interfaces/plugins.net.html)
* [next](./interfaces/plugins.next.html)
* [opensearch](./interfaces/plugins.opensearch.html)
* [openai](./interfaces/plugins.openai.html)
* [oracledb](./interfaces/plugins.oracledb.html)
* [paperplane](./interfaces/plugins.paperplane.html)
* [pino](./interfaces/plugins.pino.html)
* [pg](./interfaces/plugins.pg.html)
* [promise](./interfaces/plugins.promise.html)
* [promise-js](./interfaces/plugins.promise_js.html)
* [q](./interfaces/plugins.q.html)
* [redis](./interfaces/plugins.redis.html)
* [restify](./interfaces/plugins.restify.html)
* [router](./interfaces/plugins.router.html)
* [tedious](./interfaces/plugins.tedious.html)
* [when](./interfaces/plugins.when.html)
* [winston](./interfaces/plugins.winston.html)
* [amqp10](./interfaces/export_.plugins.amqp10.html)
* [amqplib](./interfaces/export_.plugins.amqplib.html)
* [aws-sdk](./interfaces/export_.plugins.aws_sdk.html)
* [bluebird](./interfaces/export_.plugins.bluebird.html)
* [couchbase](./interfaces/export_.plugins.couchbase.html)
* [cucumber](./interfaces/export_.plugins.cucumber.html)
* [bunyan](./interfaces/export_.plugins.bunyan.html)
* [cassandra-driver](./interfaces/export_.plugins.cassandra_driver.html)
* [connect](./interfaces/export_.plugins.connect.html)
* [dns](./interfaces/export_.plugins.dns.html)
* [elasticsearch](./interfaces/export_.plugins.elasticsearch.html)
* [express](./interfaces/export_.plugins.express.html)
* [fastify](./interfaces/export_.plugins.fastify.html)
* [fetch](./interfaces/export_.plugins.fetch.html)
* [generic-pool](./interfaces/export_.plugins.generic_pool.html)
* [google-cloud-pubsub](./interfaces/export_.plugins.google_cloud_pubsub.html)
* [graphql](./interfaces/export_.plugins.graphql.html)
* [grpc](./interfaces/export_.plugins.grpc.html)
* [hapi](./interfaces/export_.plugins.hapi.html)
* [http](./interfaces/export_.plugins.http.html)
* [http2](./interfaces/export_.plugins.http2.html)
* [ioredis](./interfaces/export_.plugins.ioredis.html)
* [jest](./interfaces/export_.plugins.jest.html)
* [kafkajs](./interfaces/export_.plugins.kafkajs.html)
* [knex](./interfaces/export_.plugins.knex.html)
* [koa](./interfaces/export_.plugins.koa.html)
* [ldapjs](./interfaces/export_.plugins.ldapjs.html)
* [mariadb](./interfaces/export_.plugins.mariadb.html)
* [microgateway--core](./interfaces/export_.plugins.microgateway_core.html)
* [mocha](./interfaces/export_.plugins.mocha.html)
* [mongodb-core](./interfaces/export_.plugins.mongodb_core.html)
* [mysql](./interfaces/export_.plugins.mysql.html)
* [mysql2](./interfaces/export_.plugins.mysql2.html)
* [net](./interfaces/export_.plugins.net.html)
* [next](./interfaces/export_.plugins.next.html)
* [opensearch](./interfaces/export_.plugins.opensearch.html)
* [openai](./interfaces/export_.plugins.openai.html)
* [oracledb](./interfaces/export_.plugins.oracledb.html)
* [paperplane](./interfaces/export_.plugins.paperplane.html)
* [pino](./interfaces/export_.plugins.pino.html)
* [pg](./interfaces/export_.plugins.pg.html)
* [promise](./interfaces/export_.plugins.promise.html)
* [promise-js](./interfaces/export_.plugins.promise_js.html)
* [q](./interfaces/export_.plugins.q.html)
* [redis](./interfaces/export_.plugins.redis.html)
* [restify](./interfaces/export_.plugins.restify.html)
* [router](./interfaces/export_.plugins.router.html)
* [tedious](./interfaces/export_.plugins.tedious.html)
* [when](./interfaces/export_.plugins.when.html)
* [winston](./interfaces/export_.plugins.winston.html)

<h2 id="manual-instrumentation">Manual Instrumentation</h2>

Expand Down
72 changes: 72 additions & 0 deletions docs/add-redirects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash

# Previously, URLs to plugin pages looked like this:
# interfaces/plugins.amqp10.html
#
# Now, with an updated typedoc and updated types, they look like this:
# interfaces/export_.plugins.connect.html
#
# This script automatically generates basic HTML files to redirect users who
# visit the old URLs to the new URL.

echo "writing redirects..."

declare -a plugins=(
"amqp10"
"amqplib"
"aws_sdk"
"bluebird"
"couchbase"
"cucumber"
"bunyan"
"cassandra_driver"
"connect"
"dns"
"elasticsearch"
"express"
"fastify"
"fetch"
"generic_pool"
"google_cloud_pubsub"
"graphql"
"grpc"
"hapi"
"http"
"http2"
"ioredis"
"jest"
"kafkajs"
"knex"
"koa"
"ldapjs"
"mariadb"
"microgateway_core"
"mocha"
"mongodb_core"
"mysql"
"mysql2"
"net"
"next"
"opensearch"
"openai"
"oracledb"
"paperplane"
"pino"
"pg"
"promise"
"promise_js"
"q"
"redis"
"restify"
"router"
"tedious"
"when"
"winston"
)

for i in "${plugins[@]}"
do
echo "<meta http-equiv=\"refresh\" content=\"0; URL=./export_.plugins.$i.html\" />" > out/interfaces/plugins.$i.html
done

echo "done."
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "typedoc.js",
"scripts": {
"build": "typedoc ../index.d.ts",
"build": "typedoc ../index.d.ts && ./add-redirects.sh",
"pretest": "tsc -p . && tsc test",
"test": "node test"
},
Expand Down
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,10 @@ declare namespace tracer {
* The service name to be used for this plugin. If a function is used, it will be passed the connection parameters and its return value will be used as the service name.
*/
service?: string | ((params: any) => string);
/**
* The database monitoring propagation mode to be used for this plugin.
*/
dbmPropagationMode?: string;
}

/**
Expand Down
14 changes: 7 additions & 7 deletions integration-tests/ci-visibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {
TEST_ITR_FORCED_RUN,
TEST_SOURCE_FILE,
TEST_IS_NEW,
TEST_EARLY_FLAKE_IS_RETRY,
TEST_IS_RETRY,
TEST_EARLY_FLAKE_IS_ENABLED,
TEST_NAME,
JEST_DISPLAY_NAME
Expand Down Expand Up @@ -688,7 +688,7 @@ testFrameworks.forEach(({
newTests.forEach(test => {
assert.propertyVal(test.meta, TEST_IS_NEW, 'true')
})
const retriedTests = newTests.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true')
const retriedTests = newTests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
// all but one has been retried
assert.equal(
newTests.length - 1,
Expand Down Expand Up @@ -777,12 +777,12 @@ testFrameworks.forEach(({
// all but one have been retried
assert.equal(
testsForFirstParameter.length - 1,
testsForFirstParameter.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true').length
testsForFirstParameter.filter(test => test.meta[TEST_IS_RETRY] === 'true').length
)

assert.equal(
testsForSecondParameter.length - 1,
testsForSecondParameter.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true').length
testsForSecondParameter.filter(test => test.meta[TEST_IS_RETRY] === 'true').length
)
})

Expand Down Expand Up @@ -903,7 +903,7 @@ testFrameworks.forEach(({

const tests = events.filter(event => event.type === 'test').map(event => event.content)

const retriedTests = tests.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true')
const retriedTests = tests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
// all but one has been retried
assert.equal(
tests.length - 1,
Expand Down Expand Up @@ -979,14 +979,14 @@ testFrameworks.forEach(({
test => test.meta[TEST_NAME] === 'ci visibility skip will not be retried'
)
assert.equal(newSkippedTests.length, 1)
assert.notProperty(newSkippedTests[0].meta, TEST_EARLY_FLAKE_IS_RETRY)
assert.notProperty(newSkippedTests[0].meta, TEST_IS_RETRY)

if (name === 'jest') {
const newTodoTests = tests.filter(
test => test.meta[TEST_NAME] === 'ci visibility todo will not be retried'
)
assert.equal(newTodoTests.length, 1)
assert.notProperty(newTodoTests[0].meta, TEST_EARLY_FLAKE_IS_RETRY)
assert.notProperty(newTodoTests[0].meta, TEST_IS_RETRY)
}
})

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {
TEST_SOURCE_FILE,
TEST_EARLY_FLAKE_IS_ENABLED,
TEST_IS_NEW,
TEST_EARLY_FLAKE_IS_RETRY,
TEST_IS_RETRY,
TEST_NAME
} = require('../../packages/dd-trace/src/plugins/util/test')

Expand Down Expand Up @@ -818,7 +818,7 @@ versions.forEach(version => {
newTests.forEach(test => {
assert.propertyVal(test.meta, TEST_IS_NEW, 'true')
})
const retriedTests = newTests.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true')
const retriedTests = newTests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
// all but one has been retried
assert.equal(
newTests.length - 1,
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/cypress/cypress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {
TEST_ITR_FORCED_RUN,
TEST_SOURCE_FILE,
TEST_IS_NEW,
TEST_EARLY_FLAKE_IS_RETRY,
TEST_IS_RETRY,
TEST_EARLY_FLAKE_IS_ENABLED
} = require('../../packages/dd-trace/src/plugins/util/test')
const { ERROR_MESSAGE } = require('../../packages/dd-trace/src/constants')
Expand Down Expand Up @@ -939,7 +939,7 @@ moduleType.forEach(({
const newTests = tests.filter(test => test.meta[TEST_IS_NEW] === 'true')
assert.equal(newTests.length, NUM_RETRIES_EFD + 1)

const retriedTests = tests.filter(test => test.meta[TEST_EARLY_FLAKE_IS_RETRY] === 'true')
const retriedTests = tests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
assert.equal(retriedTests.length, NUM_RETRIES_EFD)

newTests.forEach(newTest => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dd-trace",
"version": "5.6.0",
"version": "5.7.0",
"description": "Datadog APM tracing client for JavaScript",
"main": "index.js",
"typings": "index.d.ts",
Expand Down Expand Up @@ -70,7 +70,7 @@
},
"dependencies": {
"@datadog/native-appsec": "7.1.0",
"@datadog/native-iast-rewriter": "2.2.3",
"@datadog/native-iast-rewriter": "2.3.0",
"@datadog/native-iast-taint-tracking": "1.7.0",
"@datadog/native-metrics": "^2.0.0",
"@datadog/pprof": "5.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/datadog-plugin-cucumber/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {
TEST_SOURCE_FILE,
TEST_EARLY_FLAKE_IS_ENABLED,
TEST_IS_NEW,
TEST_EARLY_FLAKE_IS_RETRY
TEST_IS_RETRY
} = require('../../dd-trace/src/plugins/util/test')
const { RESOURCE_NAME } = require('../../../ext/tags')
const { COMPONENT, ERROR_MESSAGE } = require('../../dd-trace/src/constants')
Expand Down Expand Up @@ -181,7 +181,7 @@ class CucumberPlugin extends CiPlugin {
if (isNew) {
span.setTag(TEST_IS_NEW, 'true')
if (isEfdRetry) {
span.setTag(TEST_EARLY_FLAKE_IS_RETRY, 'true')
span.setTag(TEST_IS_RETRY, 'true')
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/datadog-plugin-cypress/src/cypress-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {
ITR_CORRELATION_ID,
TEST_SOURCE_FILE,
TEST_IS_NEW,
TEST_EARLY_FLAKE_IS_RETRY,
TEST_IS_RETRY,
TEST_EARLY_FLAKE_IS_ENABLED
} = require('../../dd-trace/src/plugins/util/test')
const { isMarkedAsUnskippable } = require('../../datadog-plugin-jest/src/util')
Expand Down Expand Up @@ -592,7 +592,7 @@ class CypressPlugin {
if (isNew) {
this.activeTestSpan.setTag(TEST_IS_NEW, 'true')
if (isEfdRetry) {
this.activeTestSpan.setTag(TEST_EARLY_FLAKE_IS_RETRY, 'true')
this.activeTestSpan.setTag(TEST_IS_RETRY, 'true')
}
}
const finishedTest = {
Expand Down
Loading
Loading