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

V3.51.0 proposal #4135

Merged
merged 25 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f5acfde
PROF-9193: Add system info to profiles (#4085)
szegedi Feb 26, 2024
3bb7bbe
Replicate images even if other steps fail (#4109)
randomanderson Feb 26, 2024
978cac0
aws-sdk: fix request_id tag for errors (#4101)
Feb 27, 2024
972a695
Update types (#4070)
Feb 27, 2024
f77f399
Fix issue with graphql.execute span naming (#4111)
Feb 27, 2024
abb3a4b
Active tracing configuration (#3928)
ida613 Feb 27, 2024
3837a8a
Add register.js for use with --import flag (#4110)
Feb 27, 2024
6a34216
ci: remove nightly package failure slack reporter (#4115)
tlhunter Feb 27, 2024
6e52132
Update appsec rules to 1.11.0 (#4117)
uurien Feb 29, 2024
e7cb99c
Fix "directives is not iterable" error when directives is not defined…
uurien Feb 29, 2024
2895f0d
[ci-visibility] Fix negative duration in playwright steps (#4113)
juan-fernandez Feb 29, 2024
eaba049
Fix flaky kafkajs test (#4108)
iunanua Feb 29, 2024
0966b7e
Fix circular dependencies in waf calls (#4125)
uurien Mar 4, 2024
b66fe0b
Support mongodb 6.4.0 which uses Promises instead of callbacks in con…
uurien Mar 4, 2024
2f51f15
[ci-visibility] Early flake detection for cypress (#4122)
juan-fernandez Mar 5, 2024
bddaff4
[ci-visibility] Grab jest's displayName config for multi-project conf…
juan-fernandez Mar 5, 2024
14a48be
[ci-visibility] Expose cypress' after:spec handler (#4127)
juan-fernandez Mar 5, 2024
9e57590
Bump profiler version to 5.1.0 (#4136)
nsavoire Mar 5, 2024
1b2d6bb
remove `config.appsec.customRulesProvided` (#4129)
simon-id Mar 5, 2024
37fbafa
[ci-visibility] Adapt early flake detection to new format (#4137)
juan-fernandez Mar 5, 2024
3bfafb9
Check if prepareStackTrace has been wrapped before restore it (#4138)
iunanua Mar 5, 2024
4eb2ec2
feat: update DSM encoding / decoding to work with other languages and…
wconti27 Mar 5, 2024
53d2cf8
fix server stream always cancelled in >=1.10.0 (#4133)
rochdev Mar 5, 2024
bfba6ef
Synchronize index.d.ts and docs/test.ts with master
uurien Mar 6, 2024
ed059a9
v3.51.0
uurien Mar 5, 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
5 changes: 0 additions & 5 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

env:
SLACK_REPORT_ENABLE: ${{ github.event.schedule }} # value is empty for non-nightly jobs
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MOREINFO: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

# TODO: upstream jobs


Expand Down
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ deploy_to_reliability_env:

deploy_to_docker_registries:
stage: deploy
needs: []
rules:
- if: '$CI_COMMIT_TAG =~ /^v.*/ || $CI_COMMIT_TAG == "dev"'
when: on_success
Expand All @@ -80,6 +81,7 @@ deploy_to_docker_registries:

deploy_latest_to_docker_registries:
stage: deploy
needs: []
rules:
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: on_success
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
!esbuild.js
!init.js
!loader-hook.mjs
!register.js
!package.json
!cypress/**/*
!ci/**/*
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ but code loaded using `import` might not always work.

Use the following command to enable experimental ESM support with your application:

Node.js < v20.6

```sh
node --loader dd-trace/loader-hook.mjs entrypoint.js
```

Node.js >= v20.6

```sh
node --import dd-trace/register.js entrypoint.js
```

## Serverless / Lambda

Expand Down
1 change: 1 addition & 0 deletions ci/cypress/after-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../packages/datadog-plugin-cypress/src/after-spec')
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",
"build": "typedoc ../index.d.ts",
"pretest": "tsc -p . && tsc test",
"test": "node test"
},
Expand Down
60 changes: 31 additions & 29 deletions docs/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { performance } from 'perf_hooks'
import ddTrace, { tracer, Tracer, TracerOptions, Span, SpanContext, SpanOptions, Scope, User } from '..';
import type { plugins } from '..';
import { opentelemetry } from '..';
import { formats, kinds, priority, tags, types } from '../ext';
import { BINARY, HTTP_HEADERS, LOG, TEXT_MAP } from '../ext/formats';
Expand Down Expand Up @@ -157,64 +158,64 @@ const httpOptions = {
middleware: true
};

const httpServerOptions = {
const httpServerOptions: plugins.HttpServer = {
...httpOptions,
hooks: {
request: (span: Span, req, res) => {}
request: (span?: Span, req?, res?) => {}
}
};

const httpClientOptions = {
const httpClientOptions: plugins.HttpClient = {
...httpOptions,
splitByDomain: true,
propagationBlocklist: ['url', /url/, url => true],
hooks: {
request: (span: Span, req, res) => {}
request: (span?: Span, req?, res?) => { }
}
};

const http2ServerOptions = {
const http2ServerOptions: plugins.Http2Server = {
...httpOptions
};

const http2ClientOptions = {
const http2ClientOptions: plugins.Http2Client = {
...httpOptions,
splitByDomain: true
};

const nextOptions = {
const nextOptions: plugins.next = {
service: 'test',
hooks: {
request: (span: Span, params) => { },
request: (span?: Span, params?) => { },
},
};

const graphqlOptions = {
const graphqlOptions: plugins.graphql = {
service: 'test',
depth: 2,
source: true,
variables: ({ foo, baz }) => ({ foo }),
collapse: false,
signature: false,
hooks: {
execute: (span: Span, args, res) => {},
validate: (span: Span, document, errors) => {},
parse: (span: Span, source, document) => {}
execute: (span?: Span, args?, res?) => {},
validate: (span?: Span, document?, errors?) => {},
parse: (span?: Span, source?, document?) => {}
}
};

const elasticsearchOptions = {
const elasticsearchOptions: plugins.elasticsearch = {
service: 'test',
hooks: {
query: (span: Span, params) => {},
query: (span?: Span, params?) => {},
},
};

const awsSdkOptions = {
const awsSdkOptions: plugins.aws_sdk = {
service: 'test',
splitByAwsService: false,
hooks: {
request: (span: Span, response) => {},
request: (span?: Span, response?) => {},
},
s3: false,
sqs: {
Expand All @@ -223,33 +224,32 @@ const awsSdkOptions = {
}
};

const redisOptions = {
const redisOptions: plugins.redis = {
service: 'test',
allowlist: ['info', /auth/i, command => true],
blocklist: ['info', /auth/i, command => true],
};

const sharedbOptions = {
const sharedbOptions: plugins.sharedb = {
service: 'test',
hooks: {
receive: (span: Span, request) => {},
reply: (span: Span, request, reply) => {},
receive: (span?: Span, request?) => {},
reply: (span?: Span, request?, reply?) => {},
},
};

const moleculerOptions = {
const moleculerOptions: plugins.moleculer = {
service: 'test',
client: false,
params: true,
server: {
meta: true
}
};

const openSearchOptions = {
const openSearchOptions: plugins.opensearch = {
service: 'test',
hooks: {
query: (span: Span, params) => {},
query: (span?: Span, params?) => {},
},
};

Expand Down Expand Up @@ -356,8 +356,9 @@ tracer.use('express', { measured: true });

span = tracer.startSpan('test');
span = tracer.startSpan('test', {});
span = tracer.startSpan('test', { childOf: span });
span = tracer.startSpan('test', {
childOf: span || span.context(),
childOf: span.context(),
references: [],
startTime: 123456789.1234,
tags: {
Expand All @@ -371,7 +372,7 @@ tracer.trace('test', { service: 'foo', resource: 'bar', type: 'baz' }, () => {})
tracer.trace('test', { measured: true }, () => {})
tracer.trace('test', (span: Span) => {})
tracer.trace('test', (span: Span, fn: () => void) => {})
tracer.trace('test', (span: Span, fn: (err: Error) => string) => {})
tracer.trace('test', (span: Span, fn: (err: Error) => void) => {})

promise = tracer.trace('test', () => Promise.resolve())

Expand All @@ -382,16 +383,17 @@ promise = tracer.wrap('test', () => Promise.resolve())()

const carrier = {}

tracer.inject(span || span.context(), HTTP_HEADERS, carrier);
context = tracer.extract(HTTP_HEADERS, carrier);
tracer.inject(span, HTTP_HEADERS, carrier);
tracer.inject(span.context(), HTTP_HEADERS, carrier);
context = tracer.extract(HTTP_HEADERS, carrier)!;

traceId = context.toTraceId();
spanId = context.toSpanId();
traceparent = context.toTraceparent();

const scope = tracer.scope()

span = scope.active();
span = scope.active()!;

const activateStringType: string = scope.activate(span, () => 'test');
const activateVoidType: void = scope.activate(span, () => {});
Expand Down
4 changes: 2 additions & 2 deletions docs/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = {
excludeExternals: true,
excludePrivate: true,
excludeProtected: true,
includeDeclarations: true,
mode: 'file',
// includeDeclarations: true,
// mode: 'file',
name: 'dd-trace',
out: 'out',
readme: 'API.md'
Expand Down
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ handlebars@^4.7.6:
uglify-js "^3.1.4"

hasown@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c"
integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==
version "2.0.1"
resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa"
integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==
dependencies:
function-bind "^1.1.2"

Expand Down
Loading
Loading