Ccodemod

codemod/dd-trace-js-v6-flatten-ingestion-options

Flatten dd-trace ingestion.sampleRate/rateLimit options to top-level TracerOptions

apmnodejsv6datadogdd-trace-jsv5-to-v6
Public
0 executions

Run locally

npx codemod @codemod/dd-trace-js-v6-flatten-ingestion-options

@codemod/dd-trace-js-v6-flatten-ingestion-options

Flattens the removed ingestion wrapper in dd-trace v6:

ts

becomes:

ts

Safety

The transform only updates object literals passed directly to .init(...)
through a local dd-trace binding or direct require("dd-trace") call. It
skips objects with existing top-level sampleRate or rateLimit fields, and
it skips ingestion wrappers containing unsupported keys.

Ready to contribute?

Build your own codemod and share it with the community.