@depup/dd-trace 5.90.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -0
- package/LICENSE-3rdparty.csv +102 -0
- package/LICENSE.Apache +200 -0
- package/LICENSE.BSD3 +29 -0
- package/README.md +25 -0
- package/changes.json +5 -0
- package/ci/cypress/after-run.js +3 -0
- package/ci/cypress/after-spec.js +3 -0
- package/ci/cypress/plugin.js +13 -0
- package/ci/cypress/polyfills.js +25 -0
- package/ci/cypress/support.js +3 -0
- package/ci/init.js +86 -0
- package/esbuild.js +3 -0
- package/ext/exporters.d.ts +14 -0
- package/ext/exporters.js +13 -0
- package/ext/formats.d.ts +11 -0
- package/ext/formats.js +9 -0
- package/ext/index.d.ts +8 -0
- package/ext/index.js +17 -0
- package/ext/kinds.d.ts +9 -0
- package/ext/kinds.js +9 -0
- package/ext/priority.d.ts +8 -0
- package/ext/priority.js +8 -0
- package/ext/scopes.d.ts +9 -0
- package/ext/scopes.js +9 -0
- package/ext/tags.d.ts +26 -0
- package/ext/tags.js +40 -0
- package/ext/types.d.ts +7 -0
- package/ext/types.js +7 -0
- package/index.d.ts +3811 -0
- package/index.js +3 -0
- package/init.js +7 -0
- package/initialize.mjs +85 -0
- package/loader-hook.mjs +77 -0
- package/package.json +215 -0
- package/packages/datadog-code-origin/index.js +66 -0
- package/packages/datadog-core/index.js +5 -0
- package/packages/datadog-core/src/storage.js +132 -0
- package/packages/datadog-core/src/utils/src/kebabcase.js +14 -0
- package/packages/datadog-core/src/utils/src/parse-tags.js +33 -0
- package/packages/datadog-core/src/utils/src/pick.js +11 -0
- package/packages/datadog-core/src/utils/src/set.js +18 -0
- package/packages/datadog-core/src/utils/src/uniq.js +5 -0
- package/packages/datadog-esbuild/index.js +403 -0
- package/packages/datadog-esbuild/src/log.js +32 -0
- package/packages/datadog-esbuild/src/utils.js +218 -0
- package/packages/datadog-instrumentations/index.js +5 -0
- package/packages/datadog-instrumentations/src/aerospike.js +48 -0
- package/packages/datadog-instrumentations/src/ai.js +119 -0
- package/packages/datadog-instrumentations/src/amqp10.js +73 -0
- package/packages/datadog-instrumentations/src/amqplib.js +146 -0
- package/packages/datadog-instrumentations/src/anthropic.js +127 -0
- package/packages/datadog-instrumentations/src/apollo-server-core.js +40 -0
- package/packages/datadog-instrumentations/src/apollo-server.js +135 -0
- package/packages/datadog-instrumentations/src/apollo.js +101 -0
- package/packages/datadog-instrumentations/src/avsc.js +39 -0
- package/packages/datadog-instrumentations/src/aws-sdk.js +264 -0
- package/packages/datadog-instrumentations/src/azure-durable-functions.js +75 -0
- package/packages/datadog-instrumentations/src/azure-event-hubs.js +38 -0
- package/packages/datadog-instrumentations/src/azure-functions.js +56 -0
- package/packages/datadog-instrumentations/src/azure-service-bus.js +71 -0
- package/packages/datadog-instrumentations/src/bluebird.js +26 -0
- package/packages/datadog-instrumentations/src/body-parser.js +44 -0
- package/packages/datadog-instrumentations/src/bullmq.js +11 -0
- package/packages/datadog-instrumentations/src/bunyan.js +22 -0
- package/packages/datadog-instrumentations/src/cassandra-driver.js +179 -0
- package/packages/datadog-instrumentations/src/child_process.js +246 -0
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +421 -0
- package/packages/datadog-instrumentations/src/connect.js +118 -0
- package/packages/datadog-instrumentations/src/cookie-parser.js +36 -0
- package/packages/datadog-instrumentations/src/cookie.js +21 -0
- package/packages/datadog-instrumentations/src/couchbase.js +324 -0
- package/packages/datadog-instrumentations/src/crypto.js +33 -0
- package/packages/datadog-instrumentations/src/cucumber.js +1096 -0
- package/packages/datadog-instrumentations/src/cypress.js +11 -0
- package/packages/datadog-instrumentations/src/dd-trace-api.js +7 -0
- package/packages/datadog-instrumentations/src/dns.js +98 -0
- package/packages/datadog-instrumentations/src/elasticsearch.js +129 -0
- package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +45 -0
- package/packages/datadog-instrumentations/src/express-session.js +41 -0
- package/packages/datadog-instrumentations/src/express.js +253 -0
- package/packages/datadog-instrumentations/src/fastify.js +300 -0
- package/packages/datadog-instrumentations/src/fetch.js +33 -0
- package/packages/datadog-instrumentations/src/find-my-way.js +31 -0
- package/packages/datadog-instrumentations/src/fs.js +372 -0
- package/packages/datadog-instrumentations/src/generic-pool.js +48 -0
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +287 -0
- package/packages/datadog-instrumentations/src/google-cloud-vertexai.js +101 -0
- package/packages/datadog-instrumentations/src/google-genai.js +120 -0
- package/packages/datadog-instrumentations/src/graphql.js +382 -0
- package/packages/datadog-instrumentations/src/grpc/client.js +258 -0
- package/packages/datadog-instrumentations/src/grpc/server.js +154 -0
- package/packages/datadog-instrumentations/src/grpc/types.js +10 -0
- package/packages/datadog-instrumentations/src/grpc.js +4 -0
- package/packages/datadog-instrumentations/src/handlebars.js +40 -0
- package/packages/datadog-instrumentations/src/hapi.js +178 -0
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +68 -0
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +103 -0
- package/packages/datadog-instrumentations/src/helpers/extract-package-and-module-path.js +42 -0
- package/packages/datadog-instrumentations/src/helpers/fetch.js +26 -0
- package/packages/datadog-instrumentations/src/helpers/hook.js +75 -0
- package/packages/datadog-instrumentations/src/helpers/hooks.js +151 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +57 -0
- package/packages/datadog-instrumentations/src/helpers/instrumentations.js +8 -0
- package/packages/datadog-instrumentations/src/helpers/promise.js +29 -0
- package/packages/datadog-instrumentations/src/helpers/register.js +242 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +70 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +103 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/bullmq.js +108 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +7 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langchain.js +237 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/loader.js +9 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +11 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/orchestrion/compiler.js +74 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/orchestrion/index.js +43 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/orchestrion/matcher.js +49 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/orchestrion/transformer.js +121 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/orchestrion/transforms.js +322 -0
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +238 -0
- package/packages/datadog-instrumentations/src/helpers/shared-utils.js +9 -0
- package/packages/datadog-instrumentations/src/hono.js +150 -0
- package/packages/datadog-instrumentations/src/http/client.js +315 -0
- package/packages/datadog-instrumentations/src/http/server.js +223 -0
- package/packages/datadog-instrumentations/src/http.js +4 -0
- package/packages/datadog-instrumentations/src/http2/client.js +76 -0
- package/packages/datadog-instrumentations/src/http2/server.js +64 -0
- package/packages/datadog-instrumentations/src/http2.js +4 -0
- package/packages/datadog-instrumentations/src/ioredis.js +57 -0
- package/packages/datadog-instrumentations/src/iovalkey.js +47 -0
- package/packages/datadog-instrumentations/src/jest.js +1895 -0
- package/packages/datadog-instrumentations/src/kafkajs.js +266 -0
- package/packages/datadog-instrumentations/src/knex.js +86 -0
- package/packages/datadog-instrumentations/src/koa.js +173 -0
- package/packages/datadog-instrumentations/src/langchain.js +7 -0
- package/packages/datadog-instrumentations/src/ldapjs.js +101 -0
- package/packages/datadog-instrumentations/src/light-my-request.js +93 -0
- package/packages/datadog-instrumentations/src/limitd-client.js +22 -0
- package/packages/datadog-instrumentations/src/lodash.js +30 -0
- package/packages/datadog-instrumentations/src/mariadb.js +186 -0
- package/packages/datadog-instrumentations/src/memcached.js +45 -0
- package/packages/datadog-instrumentations/src/microgateway-core.js +69 -0
- package/packages/datadog-instrumentations/src/mocha/common.js +50 -0
- package/packages/datadog-instrumentations/src/mocha/main.js +753 -0
- package/packages/datadog-instrumentations/src/mocha/utils.js +526 -0
- package/packages/datadog-instrumentations/src/mocha/worker.js +104 -0
- package/packages/datadog-instrumentations/src/mocha.js +13 -0
- package/packages/datadog-instrumentations/src/moleculer/client.js +44 -0
- package/packages/datadog-instrumentations/src/moleculer/server.js +58 -0
- package/packages/datadog-instrumentations/src/moleculer.js +4 -0
- package/packages/datadog-instrumentations/src/mongodb-core.js +213 -0
- package/packages/datadog-instrumentations/src/mongodb.js +59 -0
- package/packages/datadog-instrumentations/src/mongoose.js +179 -0
- package/packages/datadog-instrumentations/src/mquery.js +65 -0
- package/packages/datadog-instrumentations/src/multer.js +37 -0
- package/packages/datadog-instrumentations/src/mysql.js +105 -0
- package/packages/datadog-instrumentations/src/mysql2.js +380 -0
- package/packages/datadog-instrumentations/src/net.js +143 -0
- package/packages/datadog-instrumentations/src/next.js +320 -0
- package/packages/datadog-instrumentations/src/node-serialize.js +22 -0
- package/packages/datadog-instrumentations/src/nyc.js +59 -0
- package/packages/datadog-instrumentations/src/openai.js +326 -0
- package/packages/datadog-instrumentations/src/opensearch.js +11 -0
- package/packages/datadog-instrumentations/src/oracledb.js +162 -0
- package/packages/datadog-instrumentations/src/orchestrion-config/index.js +86 -0
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +24 -0
- package/packages/datadog-instrumentations/src/passport-http.js +10 -0
- package/packages/datadog-instrumentations/src/passport-local.js +10 -0
- package/packages/datadog-instrumentations/src/passport-utils.js +61 -0
- package/packages/datadog-instrumentations/src/passport.js +45 -0
- package/packages/datadog-instrumentations/src/pg.js +201 -0
- package/packages/datadog-instrumentations/src/pino.js +117 -0
- package/packages/datadog-instrumentations/src/playwright.js +1383 -0
- package/packages/datadog-instrumentations/src/prisma.js +272 -0
- package/packages/datadog-instrumentations/src/process.js +29 -0
- package/packages/datadog-instrumentations/src/promise-js.js +15 -0
- package/packages/datadog-instrumentations/src/promise.js +14 -0
- package/packages/datadog-instrumentations/src/protobufjs.js +128 -0
- package/packages/datadog-instrumentations/src/pug.js +23 -0
- package/packages/datadog-instrumentations/src/q.js +21 -0
- package/packages/datadog-instrumentations/src/redis.js +161 -0
- package/packages/datadog-instrumentations/src/restify.js +89 -0
- package/packages/datadog-instrumentations/src/rhea.js +237 -0
- package/packages/datadog-instrumentations/src/router.js +326 -0
- package/packages/datadog-instrumentations/src/selenium.js +80 -0
- package/packages/datadog-instrumentations/src/sequelize.js +45 -0
- package/packages/datadog-instrumentations/src/sharedb.js +72 -0
- package/packages/datadog-instrumentations/src/stripe.js +92 -0
- package/packages/datadog-instrumentations/src/tedious.js +63 -0
- package/packages/datadog-instrumentations/src/undici.js +29 -0
- package/packages/datadog-instrumentations/src/url.js +80 -0
- package/packages/datadog-instrumentations/src/vitest.js +1116 -0
- package/packages/datadog-instrumentations/src/vm.js +49 -0
- package/packages/datadog-instrumentations/src/when.js +14 -0
- package/packages/datadog-instrumentations/src/winston.js +78 -0
- package/packages/datadog-instrumentations/src/ws.js +264 -0
- package/packages/datadog-plugin-aerospike/src/index.js +113 -0
- package/packages/datadog-plugin-ai/src/index.js +17 -0
- package/packages/datadog-plugin-ai/src/tracing.js +33 -0
- package/packages/datadog-plugin-ai/src/utils.js +28 -0
- package/packages/datadog-plugin-amqp10/src/consumer.js +34 -0
- package/packages/datadog-plugin-amqp10/src/index.js +17 -0
- package/packages/datadog-plugin-amqp10/src/producer.js +37 -0
- package/packages/datadog-plugin-amqp10/src/util.js +15 -0
- package/packages/datadog-plugin-amqplib/src/client.js +44 -0
- package/packages/datadog-plugin-amqplib/src/consumer.js +57 -0
- package/packages/datadog-plugin-amqplib/src/index.js +20 -0
- package/packages/datadog-plugin-amqplib/src/producer.js +63 -0
- package/packages/datadog-plugin-amqplib/src/util.js +14 -0
- package/packages/datadog-plugin-anthropic/src/index.js +17 -0
- package/packages/datadog-plugin-anthropic/src/tracing.js +30 -0
- package/packages/datadog-plugin-apollo/src/gateway/execute.js +18 -0
- package/packages/datadog-plugin-apollo/src/gateway/fetch.js +39 -0
- package/packages/datadog-plugin-apollo/src/gateway/index.js +36 -0
- package/packages/datadog-plugin-apollo/src/gateway/plan.js +18 -0
- package/packages/datadog-plugin-apollo/src/gateway/postprocessing.js +15 -0
- package/packages/datadog-plugin-apollo/src/gateway/request.js +122 -0
- package/packages/datadog-plugin-apollo/src/gateway/validate.js +23 -0
- package/packages/datadog-plugin-apollo/src/index.js +43 -0
- package/packages/datadog-plugin-avsc/src/index.js +11 -0
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +176 -0
- package/packages/datadog-plugin-aws-sdk/src/base.js +335 -0
- package/packages/datadog-plugin-aws-sdk/src/index.js +26 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +16 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/tracing.js +31 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +487 -0
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +19 -0
- package/packages/datadog-plugin-aws-sdk/src/services/default.js +7 -0
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +197 -0
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +53 -0
- package/packages/datadog-plugin-aws-sdk/src/services/index.js +16 -0
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +214 -0
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +67 -0
- package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +19 -0
- package/packages/datadog-plugin-aws-sdk/src/services/s3.js +55 -0
- package/packages/datadog-plugin-aws-sdk/src/services/sfn.js +7 -0
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +125 -0
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +298 -0
- package/packages/datadog-plugin-aws-sdk/src/services/states.js +7 -0
- package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +64 -0
- package/packages/datadog-plugin-aws-sdk/src/util.js +151 -0
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +49 -0
- package/packages/datadog-plugin-azure-event-hubs/src/index.js +15 -0
- package/packages/datadog-plugin-azure-event-hubs/src/producer.js +96 -0
- package/packages/datadog-plugin-azure-functions/src/index.js +171 -0
- package/packages/datadog-plugin-azure-service-bus/src/index.js +15 -0
- package/packages/datadog-plugin-azure-service-bus/src/producer.js +97 -0
- package/packages/datadog-plugin-bullmq/src/consumer.js +82 -0
- package/packages/datadog-plugin-bullmq/src/index.js +18 -0
- package/packages/datadog-plugin-bullmq/src/producer.js +207 -0
- package/packages/datadog-plugin-bunyan/src/index.js +8 -0
- package/packages/datadog-plugin-cassandra-driver/src/index.js +47 -0
- package/packages/datadog-plugin-child_process/src/index.js +111 -0
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +127 -0
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/batch-consumer.js +9 -0
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/consumer.js +9 -0
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/index.js +25 -0
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/producer.js +9 -0
- package/packages/datadog-plugin-connect/src/index.js +17 -0
- package/packages/datadog-plugin-couchbase/src/index.js +94 -0
- package/packages/datadog-plugin-cucumber/src/index.js +461 -0
- package/packages/datadog-plugin-cypress/src/after-run.js +5 -0
- package/packages/datadog-plugin-cypress/src/after-spec.js +5 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +1089 -0
- package/packages/datadog-plugin-cypress/src/index.js +11 -0
- package/packages/datadog-plugin-cypress/src/plugin.js +57 -0
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +297 -0
- package/packages/datadog-plugin-cypress/src/support.js +303 -0
- package/packages/datadog-plugin-dd-trace-api/src/index.js +117 -0
- package/packages/datadog-plugin-dns/src/index.js +23 -0
- package/packages/datadog-plugin-dns/src/lookup.js +45 -0
- package/packages/datadog-plugin-dns/src/lookup_service.js +28 -0
- package/packages/datadog-plugin-dns/src/resolve.js +27 -0
- package/packages/datadog-plugin-dns/src/reverse.js +25 -0
- package/packages/datadog-plugin-elasticsearch/src/index.js +49 -0
- package/packages/datadog-plugin-express/src/code_origin.js +47 -0
- package/packages/datadog-plugin-express/src/index.js +17 -0
- package/packages/datadog-plugin-express/src/tracing.js +17 -0
- package/packages/datadog-plugin-fastify/src/code_origin.js +41 -0
- package/packages/datadog-plugin-fastify/src/index.js +17 -0
- package/packages/datadog-plugin-fastify/src/tracing.js +34 -0
- package/packages/datadog-plugin-fetch/src/index.js +40 -0
- package/packages/datadog-plugin-find-my-way/src/index.js +18 -0
- package/packages/datadog-plugin-fs/src/index.js +52 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +39 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +212 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +19 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +191 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +217 -0
- package/packages/datadog-plugin-google-cloud-vertexai/src/index.js +17 -0
- package/packages/datadog-plugin-google-cloud-vertexai/src/tracing.js +49 -0
- package/packages/datadog-plugin-google-cloud-vertexai/src/utils.js +21 -0
- package/packages/datadog-plugin-google-genai/src/index.js +17 -0
- package/packages/datadog-plugin-google-genai/src/tracing.js +41 -0
- package/packages/datadog-plugin-graphql/src/execute.js +88 -0
- package/packages/datadog-plugin-graphql/src/index.js +72 -0
- package/packages/datadog-plugin-graphql/src/parse.js +35 -0
- package/packages/datadog-plugin-graphql/src/resolve.js +191 -0
- package/packages/datadog-plugin-graphql/src/tools/index.js +6 -0
- package/packages/datadog-plugin-graphql/src/tools/signature.js +9 -0
- package/packages/datadog-plugin-graphql/src/tools/transforms.js +108 -0
- package/packages/datadog-plugin-graphql/src/utils.js +49 -0
- package/packages/datadog-plugin-graphql/src/validate.js +40 -0
- package/packages/datadog-plugin-grpc/src/client.js +129 -0
- package/packages/datadog-plugin-grpc/src/index.js +17 -0
- package/packages/datadog-plugin-grpc/src/server.js +112 -0
- package/packages/datadog-plugin-grpc/src/util.js +66 -0
- package/packages/datadog-plugin-hapi/src/index.js +39 -0
- package/packages/datadog-plugin-hono/src/index.js +26 -0
- package/packages/datadog-plugin-http/src/client.js +244 -0
- package/packages/datadog-plugin-http/src/index.js +37 -0
- package/packages/datadog-plugin-http/src/server.js +92 -0
- package/packages/datadog-plugin-http2/src/client.js +217 -0
- package/packages/datadog-plugin-http2/src/index.js +17 -0
- package/packages/datadog-plugin-http2/src/server.js +73 -0
- package/packages/datadog-plugin-ioredis/src/index.js +9 -0
- package/packages/datadog-plugin-iovalkey/src/index.js +16 -0
- package/packages/datadog-plugin-jest/src/index.js +558 -0
- package/packages/datadog-plugin-jest/src/util.js +176 -0
- package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +28 -0
- package/packages/datadog-plugin-kafkajs/src/consumer.js +128 -0
- package/packages/datadog-plugin-kafkajs/src/index.js +19 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +129 -0
- package/packages/datadog-plugin-kafkajs/src/utils.js +27 -0
- package/packages/datadog-plugin-koa/src/index.js +22 -0
- package/packages/datadog-plugin-langchain/src/handlers/default.js +11 -0
- package/packages/datadog-plugin-langchain/src/handlers/embedding.js +18 -0
- package/packages/datadog-plugin-langchain/src/handlers/language_models.js +18 -0
- package/packages/datadog-plugin-langchain/src/index.js +26 -0
- package/packages/datadog-plugin-langchain/src/tokens.js +35 -0
- package/packages/datadog-plugin-langchain/src/tracing.js +155 -0
- package/packages/datadog-plugin-mariadb/src/index.js +21 -0
- package/packages/datadog-plugin-memcached/src/index.js +54 -0
- package/packages/datadog-plugin-microgateway-core/src/index.js +26 -0
- package/packages/datadog-plugin-mocha/src/index.js +480 -0
- package/packages/datadog-plugin-moleculer/src/client.js +42 -0
- package/packages/datadog-plugin-moleculer/src/index.js +19 -0
- package/packages/datadog-plugin-moleculer/src/server.js +30 -0
- package/packages/datadog-plugin-moleculer/src/util.js +21 -0
- package/packages/datadog-plugin-mongodb-core/src/index.js +215 -0
- package/packages/datadog-plugin-mongoose/src/index.js +20 -0
- package/packages/datadog-plugin-mysql/src/index.js +42 -0
- package/packages/datadog-plugin-mysql2/src/index.js +25 -0
- package/packages/datadog-plugin-net/src/index.js +23 -0
- package/packages/datadog-plugin-net/src/ipc.js +23 -0
- package/packages/datadog-plugin-net/src/tcp.js +53 -0
- package/packages/datadog-plugin-next/src/index.js +155 -0
- package/packages/datadog-plugin-nyc/src/index.js +95 -0
- package/packages/datadog-plugin-openai/src/index.js +17 -0
- package/packages/datadog-plugin-openai/src/services.js +48 -0
- package/packages/datadog-plugin-openai/src/stream-helpers.js +159 -0
- package/packages/datadog-plugin-openai/src/token-estimator.js +20 -0
- package/packages/datadog-plugin-openai/src/tracing.js +723 -0
- package/packages/datadog-plugin-opensearch/src/index.js +9 -0
- package/packages/datadog-plugin-oracledb/src/connection-parser.js +37 -0
- package/packages/datadog-plugin-oracledb/src/index.js +44 -0
- package/packages/datadog-plugin-pg/src/index.js +41 -0
- package/packages/datadog-plugin-pino/src/index.js +9 -0
- package/packages/datadog-plugin-playwright/src/index.js +497 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +118 -0
- package/packages/datadog-plugin-prisma/src/index.js +144 -0
- package/packages/datadog-plugin-protobufjs/src/index.js +12 -0
- package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +181 -0
- package/packages/datadog-plugin-redis/src/index.js +95 -0
- package/packages/datadog-plugin-restify/src/index.js +29 -0
- package/packages/datadog-plugin-rhea/src/consumer.js +68 -0
- package/packages/datadog-plugin-rhea/src/index.js +17 -0
- package/packages/datadog-plugin-rhea/src/producer.js +54 -0
- package/packages/datadog-plugin-router/src/index.js +170 -0
- package/packages/datadog-plugin-selenium/src/index.js +66 -0
- package/packages/datadog-plugin-sharedb/src/index.js +68 -0
- package/packages/datadog-plugin-tedious/src/index.js +36 -0
- package/packages/datadog-plugin-undici/src/index.js +313 -0
- package/packages/datadog-plugin-vitest/src/index.js +444 -0
- package/packages/datadog-plugin-web/src/index.js +18 -0
- package/packages/datadog-plugin-winston/src/index.js +8 -0
- package/packages/datadog-plugin-ws/src/close.js +121 -0
- package/packages/datadog-plugin-ws/src/index.js +30 -0
- package/packages/datadog-plugin-ws/src/producer.js +99 -0
- package/packages/datadog-plugin-ws/src/receiver.js +110 -0
- package/packages/datadog-plugin-ws/src/server.js +106 -0
- package/packages/datadog-plugin-ws/src/util.js +139 -0
- package/packages/datadog-shimmer/index.js +3 -0
- package/packages/datadog-shimmer/src/shimmer.js +279 -0
- package/packages/dd-trace/index.js +36 -0
- package/packages/dd-trace/src/agent/info.js +57 -0
- package/packages/dd-trace/src/agent/url.js +28 -0
- package/packages/dd-trace/src/aiguard/client.js +25 -0
- package/packages/dd-trace/src/aiguard/noop.js +9 -0
- package/packages/dd-trace/src/aiguard/sdk.js +223 -0
- package/packages/dd-trace/src/aiguard/tags.js +14 -0
- package/packages/dd-trace/src/analytics_sampler.js +15 -0
- package/packages/dd-trace/src/appsec/activation.js +29 -0
- package/packages/dd-trace/src/appsec/addresses.js +51 -0
- package/packages/dd-trace/src/appsec/api_security_sampler.js +117 -0
- package/packages/dd-trace/src/appsec/blocked_templates.js +14 -0
- package/packages/dd-trace/src/appsec/blocking.js +196 -0
- package/packages/dd-trace/src/appsec/channels.js +50 -0
- package/packages/dd-trace/src/appsec/downstream_requests.js +302 -0
- package/packages/dd-trace/src/appsec/graphql.js +166 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/analyzers.js +24 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/code-injection-analyzer.js +36 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js +15 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +62 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-base-analyzer.js +72 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-analyzer.js +18 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +11 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-rule-type.js +6 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-analyzer.js +15 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +741 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hsts-header-missing-analyzer.js +44 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/index.js +23 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/injection-analyzer.js +42 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/insecure-cookie-analyzer.js +12 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js +22 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/missing-header-analyzer.js +82 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/no-httponly-cookie-analyzer.js +12 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/no-samesite-cookie-analyzer.js +12 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +192 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +108 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/set-cookies-header-interceptor.js +58 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js +102 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +37 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/stored-injection-analyzer.js +11 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/template-injection-analyzer.js +18 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/untrusted-deserialization-analyzer.js +16 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js +64 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js +181 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js +31 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js +64 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-randomness-analyzer.js +19 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/xcontenttype-header-missing-analyzer.js +19 -0
- package/packages/dd-trace/src/appsec/iast/context/context-plugin.js +89 -0
- package/packages/dd-trace/src/appsec/iast/context/kafka-ctx-plugin.js +14 -0
- package/packages/dd-trace/src/appsec/iast/iast-context.js +75 -0
- package/packages/dd-trace/src/appsec/iast/iast-plugin.js +230 -0
- package/packages/dd-trace/src/appsec/iast/index.js +126 -0
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +209 -0
- package/packages/dd-trace/src/appsec/iast/path-line.js +116 -0
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +179 -0
- package/packages/dd-trace/src/appsec/iast/security-controls/parser.js +128 -0
- package/packages/dd-trace/src/appsec/iast/tags.js +7 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/constants.js +6 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js +24 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/filter.js +16 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +36 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +88 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js +108 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +293 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugins/kafka.js +46 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +76 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-telemetry.js +13 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +266 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/secure-marks-generator.js +13 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/secure-marks.js +30 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/source-types.js +15 -0
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +258 -0
- package/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js +113 -0
- package/packages/dd-trace/src/appsec/iast/telemetry/index.js +41 -0
- package/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js +112 -0
- package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +54 -0
- package/packages/dd-trace/src/appsec/iast/telemetry/verbosity.js +41 -0
- package/packages/dd-trace/src/appsec/iast/utils.js +24 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/constants.js +7 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/range-utils.js +36 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/command-sensitive-analyzer.js +22 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/hardcoded-password-analyzer.js +13 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/json-sensitive-analyzer.js +12 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/ldap-sensitive-analyzer.js +28 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +112 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/tainted-range-based-sensitive-analyzer.js +25 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/url-sensitive-analyzer.js +40 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +294 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +126 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +168 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities.js +24 -0
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +169 -0
- package/packages/dd-trace/src/appsec/index.js +560 -0
- package/packages/dd-trace/src/appsec/rasp/command_injection.js +56 -0
- package/packages/dd-trace/src/appsec/rasp/fs-plugin.js +103 -0
- package/packages/dd-trace/src/appsec/rasp/index.js +140 -0
- package/packages/dd-trace/src/appsec/rasp/lfi.js +129 -0
- package/packages/dd-trace/src/appsec/rasp/sql_injection.js +108 -0
- package/packages/dd-trace/src/appsec/rasp/ssrf.js +102 -0
- package/packages/dd-trace/src/appsec/rasp/utils.js +85 -0
- package/packages/dd-trace/src/appsec/rc-products.js +10 -0
- package/packages/dd-trace/src/appsec/recommended.json +10731 -0
- package/packages/dd-trace/src/appsec/remote_config.js +177 -0
- package/packages/dd-trace/src/appsec/reporter.js +599 -0
- package/packages/dd-trace/src/appsec/rule_manager.js +168 -0
- package/packages/dd-trace/src/appsec/sdk/index.js +63 -0
- package/packages/dd-trace/src/appsec/sdk/noop.js +27 -0
- package/packages/dd-trace/src/appsec/sdk/set_user.js +44 -0
- package/packages/dd-trace/src/appsec/sdk/track_event.js +230 -0
- package/packages/dd-trace/src/appsec/sdk/user_blocking.js +60 -0
- package/packages/dd-trace/src/appsec/sdk/utils.js +29 -0
- package/packages/dd-trace/src/appsec/stack_trace.js +117 -0
- package/packages/dd-trace/src/appsec/telemetry/common.js +28 -0
- package/packages/dd-trace/src/appsec/telemetry/index.js +184 -0
- package/packages/dd-trace/src/appsec/telemetry/rasp.js +103 -0
- package/packages/dd-trace/src/appsec/telemetry/user.js +32 -0
- package/packages/dd-trace/src/appsec/telemetry/waf.js +143 -0
- package/packages/dd-trace/src/appsec/user_tracking.js +190 -0
- package/packages/dd-trace/src/appsec/waf/diagnostics.js +15 -0
- package/packages/dd-trace/src/appsec/waf/index.js +149 -0
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +188 -0
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +98 -0
- package/packages/dd-trace/src/azure_metadata.js +137 -0
- package/packages/dd-trace/src/baggage.js +72 -0
- package/packages/dd-trace/src/ci-visibility/coverage-report-discovery.js +82 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +159 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +156 -0
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +111 -0
- package/packages/dd-trace/src/ci-visibility/encode/json-encoder.js +27 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +104 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +78 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +56 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +52 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +83 -0
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +420 -0
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +317 -0
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +114 -0
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/writer.js +76 -0
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +120 -0
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +54 -0
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +156 -0
- package/packages/dd-trace/src/ci-visibility/requests/request.js +236 -0
- package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +107 -0
- package/packages/dd-trace/src/ci-visibility/telemetry.js +204 -0
- package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +63 -0
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +121 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +61 -0
- package/packages/dd-trace/src/config/defaults.js +174 -0
- package/packages/dd-trace/src/config/git_properties.js +120 -0
- package/packages/dd-trace/src/config/helper.js +214 -0
- package/packages/dd-trace/src/config/index.js +1676 -0
- package/packages/dd-trace/src/config/remote_config.js +203 -0
- package/packages/dd-trace/src/config/stable.js +93 -0
- package/packages/dd-trace/src/config/supported-configurations.json +4136 -0
- package/packages/dd-trace/src/constants.js +61 -0
- package/packages/dd-trace/src/crashtracking/crashtracker.js +120 -0
- package/packages/dd-trace/src/crashtracking/index.js +15 -0
- package/packages/dd-trace/src/crashtracking/noop.js +11 -0
- package/packages/dd-trace/src/datastreams/checkpointer.js +80 -0
- package/packages/dd-trace/src/datastreams/context.js +20 -0
- package/packages/dd-trace/src/datastreams/encoding.js +99 -0
- package/packages/dd-trace/src/datastreams/fnv.js +25 -0
- package/packages/dd-trace/src/datastreams/index.js +129 -0
- package/packages/dd-trace/src/datastreams/manager.js +36 -0
- package/packages/dd-trace/src/datastreams/pathway.js +187 -0
- package/packages/dd-trace/src/datastreams/processor.js +494 -0
- package/packages/dd-trace/src/datastreams/schemas/schema.js +10 -0
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +140 -0
- package/packages/dd-trace/src/datastreams/schemas/schema_sampler.js +27 -0
- package/packages/dd-trace/src/datastreams/size.js +53 -0
- package/packages/dd-trace/src/datastreams/writer.js +70 -0
- package/packages/dd-trace/src/debugger/config.js +18 -0
- package/packages/dd-trace/src/debugger/constants.js +7 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +320 -0
- package/packages/dd-trace/src/debugger/devtools_client/condition.js +294 -0
- package/packages/dd-trace/src/debugger/devtools_client/config.js +23 -0
- package/packages/dd-trace/src/debugger/devtools_client/defaults.js +7 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +336 -0
- package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +27 -0
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +41 -0
- package/packages/dd-trace/src/debugger/devtools_client/log.js +30 -0
- package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +106 -0
- package/packages/dd-trace/src/debugger/devtools_client/send.js +138 -0
- package/packages/dd-trace/src/debugger/devtools_client/session.js +17 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +336 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/constants.js +25 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +215 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +349 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js +112 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +8 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +404 -0
- package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +72 -0
- package/packages/dd-trace/src/debugger/devtools_client/state.js +238 -0
- package/packages/dd-trace/src/debugger/devtools_client/status.js +123 -0
- package/packages/dd-trace/src/debugger/index.js +259 -0
- package/packages/dd-trace/src/dogstatsd.js +412 -0
- package/packages/dd-trace/src/encode/0.4.js +425 -0
- package/packages/dd-trace/src/encode/0.5.js +77 -0
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +361 -0
- package/packages/dd-trace/src/encode/agentless-json.js +200 -0
- package/packages/dd-trace/src/encode/coverage-ci-visibility.js +131 -0
- package/packages/dd-trace/src/encode/span-stats.js +136 -0
- package/packages/dd-trace/src/encode/tags-processors.js +91 -0
- package/packages/dd-trace/src/exporter.js +32 -0
- package/packages/dd-trace/src/exporters/agent/index.js +65 -0
- package/packages/dd-trace/src/exporters/agent/writer.js +110 -0
- package/packages/dd-trace/src/exporters/agentless/index.js +132 -0
- package/packages/dd-trace/src/exporters/agentless/writer.js +201 -0
- package/packages/dd-trace/src/exporters/common/agents.js +42 -0
- package/packages/dd-trace/src/exporters/common/buffering-exporter.js +62 -0
- package/packages/dd-trace/src/exporters/common/docker.js +52 -0
- package/packages/dd-trace/src/exporters/common/form-data.js +59 -0
- package/packages/dd-trace/src/exporters/common/request.js +190 -0
- package/packages/dd-trace/src/exporters/common/url-to-http-options-polyfill.js +31 -0
- package/packages/dd-trace/src/exporters/common/util.js +13 -0
- package/packages/dd-trace/src/exporters/common/writer.js +49 -0
- package/packages/dd-trace/src/exporters/log/index.js +52 -0
- package/packages/dd-trace/src/exporters/span-stats/index.js +20 -0
- package/packages/dd-trace/src/exporters/span-stats/writer.js +54 -0
- package/packages/dd-trace/src/external-logger/src/index.js +139 -0
- package/packages/dd-trace/src/flare/file.js +40 -0
- package/packages/dd-trace/src/flare/index.js +101 -0
- package/packages/dd-trace/src/git_metadata_tagger.js +19 -0
- package/packages/dd-trace/src/guardrails/index.js +76 -0
- package/packages/dd-trace/src/guardrails/log.js +32 -0
- package/packages/dd-trace/src/guardrails/telemetry.js +92 -0
- package/packages/dd-trace/src/guardrails/util.js +8 -0
- package/packages/dd-trace/src/heap_snapshots.js +58 -0
- package/packages/dd-trace/src/histogram.js +35 -0
- package/packages/dd-trace/src/id.js +247 -0
- package/packages/dd-trace/src/iitm.js +15 -0
- package/packages/dd-trace/src/index.js +15 -0
- package/packages/dd-trace/src/lambda/context.js +27 -0
- package/packages/dd-trace/src/lambda/handler.js +87 -0
- package/packages/dd-trace/src/lambda/index.js +17 -0
- package/packages/dd-trace/src/lambda/runtime/errors.js +20 -0
- package/packages/dd-trace/src/lambda/runtime/patch.js +77 -0
- package/packages/dd-trace/src/lambda/runtime/ritm.js +133 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +55 -0
- package/packages/dd-trace/src/llmobs/constants/text.js +6 -0
- package/packages/dd-trace/src/llmobs/constants/writers.js +17 -0
- package/packages/dd-trace/src/llmobs/index.js +149 -0
- package/packages/dd-trace/src/llmobs/noop.js +88 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/index.js +399 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +218 -0
- package/packages/dd-trace/src/llmobs/plugins/anthropic.js +288 -0
- package/packages/dd-trace/src/llmobs/plugins/base.js +96 -0
- package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +137 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/index.js +104 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +486 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +20 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +111 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +42 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +106 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/llm.js +32 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/tool.js +15 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +36 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +214 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +16 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +501 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +126 -0
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +195 -0
- package/packages/dd-trace/src/llmobs/sdk.js +578 -0
- package/packages/dd-trace/src/llmobs/span_processor.js +311 -0
- package/packages/dd-trace/src/llmobs/storage.js +6 -0
- package/packages/dd-trace/src/llmobs/tagger.js +648 -0
- package/packages/dd-trace/src/llmobs/telemetry.js +174 -0
- package/packages/dd-trace/src/llmobs/util.js +182 -0
- package/packages/dd-trace/src/llmobs/writers/base.js +242 -0
- package/packages/dd-trace/src/llmobs/writers/evaluations.js +32 -0
- package/packages/dd-trace/src/llmobs/writers/spans.js +69 -0
- package/packages/dd-trace/src/llmobs/writers/util.js +54 -0
- package/packages/dd-trace/src/log/channels.js +78 -0
- package/packages/dd-trace/src/log/index.js +157 -0
- package/packages/dd-trace/src/log/log.js +76 -0
- package/packages/dd-trace/src/log/utils.js +16 -0
- package/packages/dd-trace/src/log/writer.js +72 -0
- package/packages/dd-trace/src/msgpack/chunk.js +69 -0
- package/packages/dd-trace/src/msgpack/encoder.js +308 -0
- package/packages/dd-trace/src/msgpack/index.js +6 -0
- package/packages/dd-trace/src/noop/dogstatsd.js +19 -0
- package/packages/dd-trace/src/noop/proxy.js +106 -0
- package/packages/dd-trace/src/noop/scope.js +19 -0
- package/packages/dd-trace/src/noop/span.js +50 -0
- package/packages/dd-trace/src/noop/span_context.js +16 -0
- package/packages/dd-trace/src/noop/tracer.js +47 -0
- package/packages/dd-trace/src/openfeature/constants/constants.js +51 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +47 -0
- package/packages/dd-trace/src/openfeature/index.js +77 -0
- package/packages/dd-trace/src/openfeature/noop.js +101 -0
- package/packages/dd-trace/src/openfeature/remote_config.js +31 -0
- package/packages/dd-trace/src/openfeature/writers/base.js +174 -0
- package/packages/dd-trace/src/openfeature/writers/exposures.js +173 -0
- package/packages/dd-trace/src/openfeature/writers/util.js +38 -0
- package/packages/dd-trace/src/opentelemetry/context_manager.js +91 -0
- package/packages/dd-trace/src/opentelemetry/logs/batch_log_processor.js +100 -0
- package/packages/dd-trace/src/opentelemetry/logs/index.js +87 -0
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +83 -0
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +126 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +55 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +245 -0
- package/packages/dd-trace/src/opentelemetry/metrics/constants.js +34 -0
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +81 -0
- package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +225 -0
- package/packages/dd-trace/src/opentelemetry/metrics/meter.js +171 -0
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +54 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +62 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +251 -0
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +557 -0
- package/packages/dd-trace/src/opentelemetry/otlp/common.proto +116 -0
- package/packages/dd-trace/src/opentelemetry/otlp/logs.proto +226 -0
- package/packages/dd-trace/src/opentelemetry/otlp/logs_service.proto +78 -0
- package/packages/dd-trace/src/opentelemetry/otlp/metrics.proto +720 -0
- package/packages/dd-trace/src/opentelemetry/otlp/metrics_service.proto +78 -0
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +168 -0
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +181 -0
- package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +66 -0
- package/packages/dd-trace/src/opentelemetry/otlp/resource.proto +45 -0
- package/packages/dd-trace/src/opentelemetry/sampler.js +18 -0
- package/packages/dd-trace/src/opentelemetry/span.js +317 -0
- package/packages/dd-trace/src/opentelemetry/span_context.js +44 -0
- package/packages/dd-trace/src/opentelemetry/span_processor.js +50 -0
- package/packages/dd-trace/src/opentelemetry/tracer.js +226 -0
- package/packages/dd-trace/src/opentelemetry/tracer_provider.js +80 -0
- package/packages/dd-trace/src/opentracing/propagation/binary.js +11 -0
- package/packages/dd-trace/src/opentracing/propagation/http.js +7 -0
- package/packages/dd-trace/src/opentracing/propagation/log.js +54 -0
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +818 -0
- package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +47 -0
- package/packages/dd-trace/src/opentracing/propagation/tracestate.js +103 -0
- package/packages/dd-trace/src/opentracing/span.js +412 -0
- package/packages/dd-trace/src/opentracing/span_context.js +75 -0
- package/packages/dd-trace/src/opentracing/tracer.js +145 -0
- package/packages/dd-trace/src/payload-tagging/config/aws.json +106 -0
- package/packages/dd-trace/src/payload-tagging/config/index.js +44 -0
- package/packages/dd-trace/src/payload-tagging/index.js +110 -0
- package/packages/dd-trace/src/payload-tagging/tagging.js +94 -0
- package/packages/dd-trace/src/pkg.js +44 -0
- package/packages/dd-trace/src/plugin_manager.js +219 -0
- package/packages/dd-trace/src/plugins/apollo.js +59 -0
- package/packages/dd-trace/src/plugins/cache.js +16 -0
- package/packages/dd-trace/src/plugins/ci_plugin.js +786 -0
- package/packages/dd-trace/src/plugins/client.js +11 -0
- package/packages/dd-trace/src/plugins/composite.js +29 -0
- package/packages/dd-trace/src/plugins/consumer.js +21 -0
- package/packages/dd-trace/src/plugins/database.js +123 -0
- package/packages/dd-trace/src/plugins/inbound.js +11 -0
- package/packages/dd-trace/src/plugins/index.js +117 -0
- package/packages/dd-trace/src/plugins/log_plugin.js +54 -0
- package/packages/dd-trace/src/plugins/outbound.js +159 -0
- package/packages/dd-trace/src/plugins/plugin.js +195 -0
- package/packages/dd-trace/src/plugins/producer.js +27 -0
- package/packages/dd-trace/src/plugins/schema.js +35 -0
- package/packages/dd-trace/src/plugins/server.js +11 -0
- package/packages/dd-trace/src/plugins/storage.js +23 -0
- package/packages/dd-trace/src/plugins/structured_log_plugin.js +9 -0
- package/packages/dd-trace/src/plugins/tracing.js +222 -0
- package/packages/dd-trace/src/plugins/util/ci.js +843 -0
- package/packages/dd-trace/src/plugins/util/env.js +31 -0
- package/packages/dd-trace/src/plugins/util/git-cache.js +129 -0
- package/packages/dd-trace/src/plugins/util/git.js +613 -0
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +157 -0
- package/packages/dd-trace/src/plugins/util/ip_extractor.js +139 -0
- package/packages/dd-trace/src/plugins/util/llm.js +54 -0
- package/packages/dd-trace/src/plugins/util/stacktrace.js +244 -0
- package/packages/dd-trace/src/plugins/util/tags.js +81 -0
- package/packages/dd-trace/src/plugins/util/test.js +1202 -0
- package/packages/dd-trace/src/plugins/util/url.js +146 -0
- package/packages/dd-trace/src/plugins/util/urlfilter.js +32 -0
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +91 -0
- package/packages/dd-trace/src/plugins/util/web.js +631 -0
- package/packages/dd-trace/src/priority_sampler.js +374 -0
- package/packages/dd-trace/src/process-tags/index.js +83 -0
- package/packages/dd-trace/src/profiler.js +17 -0
- package/packages/dd-trace/src/profiling/config.js +473 -0
- package/packages/dd-trace/src/profiling/constants.js +15 -0
- package/packages/dd-trace/src/profiling/exporter_cli.js +74 -0
- package/packages/dd-trace/src/profiling/exporters/agent.js +199 -0
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +91 -0
- package/packages/dd-trace/src/profiling/exporters/file.js +35 -0
- package/packages/dd-trace/src/profiling/index.js +20 -0
- package/packages/dd-trace/src/profiling/libuv-size.js +49 -0
- package/packages/dd-trace/src/profiling/loggers/console.js +41 -0
- package/packages/dd-trace/src/profiling/profiler.js +430 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns.js +11 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookup.js +16 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookupservice.js +16 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_resolve.js +24 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_reverse.js +16 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/event.js +66 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/fs.js +45 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/net.js +20 -0
- package/packages/dd-trace/src/profiling/profilers/events.js +466 -0
- package/packages/dd-trace/src/profiling/profilers/poisson.js +105 -0
- package/packages/dd-trace/src/profiling/profilers/shared.js +55 -0
- package/packages/dd-trace/src/profiling/profilers/space.js +77 -0
- package/packages/dd-trace/src/profiling/profilers/wall.js +434 -0
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +84 -0
- package/packages/dd-trace/src/profiling/tagger.js +40 -0
- package/packages/dd-trace/src/profiling/webspan-utils.js +25 -0
- package/packages/dd-trace/src/propagation-hash/index.js +145 -0
- package/packages/dd-trace/src/proxy.js +351 -0
- package/packages/dd-trace/src/random_sampler.js +40 -0
- package/packages/dd-trace/src/rate_limiter.js +82 -0
- package/packages/dd-trace/src/remote_config/apply_states.js +7 -0
- package/packages/dd-trace/src/remote_config/capabilities.js +47 -0
- package/packages/dd-trace/src/remote_config/index.js +574 -0
- package/packages/dd-trace/src/remote_config/scheduler.js +30 -0
- package/packages/dd-trace/src/require-package-json.js +33 -0
- package/packages/dd-trace/src/ritm.js +211 -0
- package/packages/dd-trace/src/runtime_metrics/index.js +34 -0
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +373 -0
- package/packages/dd-trace/src/sampler.js +63 -0
- package/packages/dd-trace/src/sampling_rule.js +267 -0
- package/packages/dd-trace/src/scope.js +63 -0
- package/packages/dd-trace/src/serverless.js +52 -0
- package/packages/dd-trace/src/service-naming/extra-services.js +24 -0
- package/packages/dd-trace/src/service-naming/index.js +75 -0
- package/packages/dd-trace/src/service-naming/schemas/definition.js +19 -0
- package/packages/dd-trace/src/service-naming/schemas/util.js +25 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/graphql.js +14 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/index.js +11 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +102 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/serverless.js +18 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +118 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/web.js +92 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/websocket.js +30 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/graphql.js +14 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/index.js +11 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +90 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/serverless.js +18 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +86 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/web.js +92 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/websocket.js +30 -0
- package/packages/dd-trace/src/span_format.js +264 -0
- package/packages/dd-trace/src/span_processor.js +171 -0
- package/packages/dd-trace/src/span_sampler.js +58 -0
- package/packages/dd-trace/src/span_stats.js +227 -0
- package/packages/dd-trace/src/spanleak.js +97 -0
- package/packages/dd-trace/src/standalone/index.js +70 -0
- package/packages/dd-trace/src/standalone/product.js +36 -0
- package/packages/dd-trace/src/standalone/tracesource.js +36 -0
- package/packages/dd-trace/src/standalone/tracesource_priority_sampler.js +59 -0
- package/packages/dd-trace/src/startup-log.js +146 -0
- package/packages/dd-trace/src/tagger.js +58 -0
- package/packages/dd-trace/src/telemetry/dependencies.js +174 -0
- package/packages/dd-trace/src/telemetry/endpoints.js +212 -0
- package/packages/dd-trace/src/telemetry/index.js +26 -0
- package/packages/dd-trace/src/telemetry/logs/index.js +90 -0
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +128 -0
- package/packages/dd-trace/src/telemetry/metrics.js +288 -0
- package/packages/dd-trace/src/telemetry/send-data.js +225 -0
- package/packages/dd-trace/src/telemetry/telemetry.js +535 -0
- package/packages/dd-trace/src/tracer.js +171 -0
- package/packages/dd-trace/src/tracer_metadata.js +29 -0
- package/packages/dd-trace/src/util.js +94 -0
- package/register.js +8 -0
- package/scripts/preinstall.js +34 -0
- package/vendor/dist/@datadog/sketches-js/LICENSE +39 -0
- package/vendor/dist/@datadog/sketches-js/index.js +1 -0
- package/vendor/dist/@datadog/source-map/LICENSE +28 -0
- package/vendor/dist/@datadog/source-map/index.js +1 -0
- package/vendor/dist/@isaacs/ttlcache/LICENSE +55 -0
- package/vendor/dist/@isaacs/ttlcache/index.js +1 -0
- package/vendor/dist/@opentelemetry/core/LICENSE +201 -0
- package/vendor/dist/@opentelemetry/core/index.js +1 -0
- package/vendor/dist/@opentelemetry/resources/LICENSE +201 -0
- package/vendor/dist/@opentelemetry/resources/index.js +1 -0
- package/vendor/dist/astring/LICENSE +19 -0
- package/vendor/dist/astring/index.js +1 -0
- package/vendor/dist/crypto-randomuuid/index.js +1 -0
- package/vendor/dist/escape-string-regexp/LICENSE +9 -0
- package/vendor/dist/escape-string-regexp/index.js +1 -0
- package/vendor/dist/esquery/LICENSE +24 -0
- package/vendor/dist/esquery/index.js +1 -0
- package/vendor/dist/ignore/LICENSE +21 -0
- package/vendor/dist/ignore/index.js +1 -0
- package/vendor/dist/istanbul-lib-coverage/LICENSE +24 -0
- package/vendor/dist/istanbul-lib-coverage/index.js +1 -0
- package/vendor/dist/jest-docblock/LICENSE +21 -0
- package/vendor/dist/jest-docblock/index.js +1 -0
- package/vendor/dist/jsonpath-plus/LICENSE +22 -0
- package/vendor/dist/jsonpath-plus/index.js +1 -0
- package/vendor/dist/limiter/LICENSE +19 -0
- package/vendor/dist/limiter/index.js +1 -0
- package/vendor/dist/lodash.sortby/LICENSE +47 -0
- package/vendor/dist/lodash.sortby/index.js +1 -0
- package/vendor/dist/lru-cache/LICENSE +15 -0
- package/vendor/dist/lru-cache/index.js +1 -0
- package/vendor/dist/meriyah/LICENSE +7 -0
- package/vendor/dist/meriyah/index.js +1 -0
- package/vendor/dist/module-details-from-path/LICENSE +21 -0
- package/vendor/dist/module-details-from-path/index.js +1 -0
- package/vendor/dist/mutexify/promise/LICENSE +21 -0
- package/vendor/dist/mutexify/promise/index.js +1 -0
- package/vendor/dist/opentracing/LICENSE +201 -0
- package/vendor/dist/opentracing/binary_carrier.d.ts +11 -0
- package/vendor/dist/opentracing/constants.d.ts +61 -0
- package/vendor/dist/opentracing/examples/demo/demo.d.ts +2 -0
- package/vendor/dist/opentracing/ext/tags.d.ts +90 -0
- package/vendor/dist/opentracing/functions.d.ts +20 -0
- package/vendor/dist/opentracing/global_tracer.d.ts +14 -0
- package/vendor/dist/opentracing/index.d.ts +12 -0
- package/vendor/dist/opentracing/index.js +1 -0
- package/vendor/dist/opentracing/mock_tracer/index.d.ts +5 -0
- package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +13 -0
- package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +16 -0
- package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +50 -0
- package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +26 -0
- package/vendor/dist/opentracing/noop.d.ts +8 -0
- package/vendor/dist/opentracing/reference.d.ts +33 -0
- package/vendor/dist/opentracing/span.d.ts +147 -0
- package/vendor/dist/opentracing/span_context.d.ts +26 -0
- package/vendor/dist/opentracing/test/api_compatibility.d.ts +16 -0
- package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +3 -0
- package/vendor/dist/opentracing/test/noop_implementation.d.ts +4 -0
- package/vendor/dist/opentracing/test/opentracing_api.d.ts +3 -0
- package/vendor/dist/opentracing/test/unittest.d.ts +2 -0
- package/vendor/dist/opentracing/tracer.d.ts +127 -0
- package/vendor/dist/path-to-regexp/LICENSE +21 -0
- package/vendor/dist/path-to-regexp/index.js +1 -0
- package/vendor/dist/pprof-format/LICENSE +8 -0
- package/vendor/dist/pprof-format/index.js +1 -0
- package/vendor/dist/protobufjs/LICENSE +39 -0
- package/vendor/dist/protobufjs/index.js +1 -0
- package/vendor/dist/protobufjs/minimal/LICENSE +39 -0
- package/vendor/dist/protobufjs/minimal/index.js +1 -0
- package/vendor/dist/retry/LICENSE +21 -0
- package/vendor/dist/retry/index.js +1 -0
- package/vendor/dist/rfdc/LICENSE +15 -0
- package/vendor/dist/rfdc/index.js +1 -0
- package/vendor/dist/semifies/LICENSE +201 -0
- package/vendor/dist/semifies/index.js +1 -0
- package/vendor/dist/shell-quote/LICENSE +24 -0
- package/vendor/dist/shell-quote/index.js +1 -0
- package/vendor/dist/source-map/LICENSE +28 -0
- package/vendor/dist/source-map/index.js +1 -0
- package/vendor/dist/source-map/lib/util/LICENSE +28 -0
- package/vendor/dist/source-map/lib/util/index.js +1 -0
- package/vendor/dist/source-map/mappings.wasm +0 -0
- package/vendor/dist/tlhunter-sorted-set/LICENSE +21 -0
- package/vendor/dist/tlhunter-sorted-set/index.js +1 -0
- package/vendor/dist/ttl-set/LICENSE +21 -0
- package/vendor/dist/ttl-set/index.js +1 -0
- package/version.js +18 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,3811 @@
|
|
|
1
|
+
import { ClientRequest, IncomingMessage, OutgoingMessage, ServerResponse } from "http";
|
|
2
|
+
import { LookupFunction } from 'net';
|
|
3
|
+
import * as opentracing from "./vendor/dist/opentracing";
|
|
4
|
+
import * as otel from "@opentelemetry/api";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Tracer is the entry-point of the Datadog tracing implementation.
|
|
8
|
+
*/
|
|
9
|
+
interface Tracer extends opentracing.Tracer {
|
|
10
|
+
/**
|
|
11
|
+
* Add tracer as a named export
|
|
12
|
+
*/
|
|
13
|
+
tracer: Tracer;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* For compatibility with NodeNext + esModuleInterop: false
|
|
17
|
+
*/
|
|
18
|
+
default: Tracer;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Starts and returns a new Span representing a logical unit of work.
|
|
22
|
+
* @param {string} name The name of the operation.
|
|
23
|
+
* @param {tracer.SpanOptions} [options] Options for the newly created span.
|
|
24
|
+
* @returns {Span} A new Span object.
|
|
25
|
+
*/
|
|
26
|
+
startSpan (name: string, options?: tracer.SpanOptions): tracer.Span;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Injects the given SpanContext instance for cross-process propagation
|
|
30
|
+
* within `carrier`
|
|
31
|
+
* @param {SpanContext} spanContext The SpanContext to inject into the
|
|
32
|
+
* carrier object. As a convenience, a Span instance may be passed
|
|
33
|
+
* in instead (in which case its .context() is used for the
|
|
34
|
+
* inject()).
|
|
35
|
+
* @param {string} format The format of the carrier.
|
|
36
|
+
* @param {any} carrier The carrier object.
|
|
37
|
+
*/
|
|
38
|
+
inject (spanContext: tracer.SpanContext | tracer.Span, format: string, carrier: any): void;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns a SpanContext instance extracted from `carrier` in the given
|
|
42
|
+
* `format`.
|
|
43
|
+
* @param {string} format The format of the carrier.
|
|
44
|
+
* @param {any} carrier The carrier object.
|
|
45
|
+
* @return {SpanContext}
|
|
46
|
+
* The extracted SpanContext, or null if no such SpanContext could
|
|
47
|
+
* be found in `carrier`
|
|
48
|
+
*/
|
|
49
|
+
extract (format: string, carrier: any): tracer.SpanContext | null;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the tracer. This should be called before importing other libraries.
|
|
53
|
+
*/
|
|
54
|
+
init (options?: tracer.TracerOptions): this;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Sets the URL for the trace agent. This should only be called _after_
|
|
58
|
+
* init() is called, only in cases where the URL needs to be set after
|
|
59
|
+
* initialization.
|
|
60
|
+
*/
|
|
61
|
+
setUrl (url: string): this;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Enable and optionally configure a plugin.
|
|
65
|
+
* @param plugin The name of a built-in plugin.
|
|
66
|
+
* @param config Configuration options. Can also be `false` to disable the plugin.
|
|
67
|
+
*/
|
|
68
|
+
use<P extends keyof Plugins> (plugin: P, config?: Plugins[P] | boolean): this;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns a reference to the current scope.
|
|
72
|
+
*/
|
|
73
|
+
scope (): tracer.Scope;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Instruments a function by automatically creating a span activated on its
|
|
77
|
+
* scope.
|
|
78
|
+
*
|
|
79
|
+
* The span will automatically be finished when one of these conditions is
|
|
80
|
+
* met:
|
|
81
|
+
*
|
|
82
|
+
* * The function returns a promise, in which case the span will finish when
|
|
83
|
+
* the promise is resolved or rejected.
|
|
84
|
+
* * The function takes a callback as its second parameter, in which case the
|
|
85
|
+
* span will finish when that callback is called.
|
|
86
|
+
* * The function doesn't accept a callback and doesn't return a promise, in
|
|
87
|
+
* which case the span will finish at the end of the function execution.
|
|
88
|
+
*/
|
|
89
|
+
trace<T> (name: string, fn: (span: tracer.Span) => T): T;
|
|
90
|
+
trace<T> (name: string, fn: (span: tracer.Span, done: (error?: Error) => void) => T): T;
|
|
91
|
+
trace<T> (name: string, options: tracer.TraceOptions & tracer.SpanOptions, fn: (span?: tracer.Span, done?: (error?: Error) => void) => T): T;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Wrap a function to automatically create a span activated on its
|
|
95
|
+
* scope when it's called.
|
|
96
|
+
*
|
|
97
|
+
* The span will automatically be finished when one of these conditions is
|
|
98
|
+
* met:
|
|
99
|
+
*
|
|
100
|
+
* * The function returns a promise, in which case the span will finish when
|
|
101
|
+
* the promise is resolved or rejected.
|
|
102
|
+
* * The function takes a callback as its last parameter, in which case the
|
|
103
|
+
* span will finish when that callback is called.
|
|
104
|
+
* * The function doesn't accept a callback and doesn't return a promise, in
|
|
105
|
+
* which case the span will finish at the end of the function execution.
|
|
106
|
+
*/
|
|
107
|
+
wrap<T = (...args: any[]) => any> (name: string, fn: T): T;
|
|
108
|
+
wrap<T = (...args: any[]) => any> (name: string, options: tracer.TraceOptions & tracer.SpanOptions, fn: T): T;
|
|
109
|
+
wrap<T = (...args: any[]) => any> (name: string, options: (...args: any[]) => tracer.TraceOptions & tracer.SpanOptions, fn: T): T;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns an HTML string containing <meta> tags that should be included in
|
|
113
|
+
* the <head> of a document to enable correlating the current trace with the
|
|
114
|
+
* RUM view. Otherwise, it is not possible to associate the trace used to
|
|
115
|
+
* generate the initial HTML document with a given RUM view. The resulting
|
|
116
|
+
* HTML document should not be cached as the meta tags are time-sensitive
|
|
117
|
+
* and are associated with a specific user.
|
|
118
|
+
*
|
|
119
|
+
* Note that this feature is currently not supported by the backend and
|
|
120
|
+
* using it will have no effect.
|
|
121
|
+
*/
|
|
122
|
+
getRumData (): string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Links an authenticated user to the current trace.
|
|
126
|
+
* @param {User} user Properties of the authenticated user. Accepts custom fields.
|
|
127
|
+
* @returns {Tracer} The Tracer instance for chaining.
|
|
128
|
+
*/
|
|
129
|
+
setUser (user: tracer.User): Tracer;
|
|
130
|
+
|
|
131
|
+
appsec: tracer.Appsec;
|
|
132
|
+
|
|
133
|
+
TracerProvider: tracer.opentelemetry.TracerProvider;
|
|
134
|
+
|
|
135
|
+
dogstatsd: tracer.DogStatsD;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Data Streams manual checkpointer API.
|
|
139
|
+
*/
|
|
140
|
+
dataStreamsCheckpointer: tracer.DataStreamsCheckpointer;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* LLM Observability SDK
|
|
144
|
+
*/
|
|
145
|
+
llmobs: tracer.llmobs.LLMObs;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* OpenFeature Provider with Remote Config integration.
|
|
149
|
+
*
|
|
150
|
+
* Extends DatadogNodeServerProvider with Remote Config integration for dynamic flag configuration.
|
|
151
|
+
* Enable with DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true.
|
|
152
|
+
*
|
|
153
|
+
* @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
|
|
154
|
+
* @beta This feature is in preview and not ready for production use
|
|
155
|
+
*/
|
|
156
|
+
openfeature: tracer.OpenFeatureProvider;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* AI Guard SDK
|
|
160
|
+
*/
|
|
161
|
+
aiguard: tracer.aiguard.AIGuard;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @experimental
|
|
165
|
+
*
|
|
166
|
+
* Set a baggage item and return the new context.
|
|
167
|
+
*
|
|
168
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#set-value
|
|
169
|
+
*
|
|
170
|
+
* ----
|
|
171
|
+
*
|
|
172
|
+
* Provide same functionality as OpenTelemetry Baggage:
|
|
173
|
+
* https://opentelemetry.io/docs/concepts/signals/baggage/
|
|
174
|
+
*
|
|
175
|
+
* Since the equivalent of OTel Context is implicit in dd-trace-js,
|
|
176
|
+
* these APIs act on the currently active baggage
|
|
177
|
+
*
|
|
178
|
+
* Work with storage('baggage'), therefore do not follow the same continuity as other APIs.
|
|
179
|
+
*/
|
|
180
|
+
setBaggageItem (key: string, value: string, metadata?: object): Record<string, string>;
|
|
181
|
+
/**
|
|
182
|
+
* @experimental
|
|
183
|
+
*
|
|
184
|
+
* Returns a specific baggage item from the current context.
|
|
185
|
+
*
|
|
186
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#get-value
|
|
187
|
+
*/
|
|
188
|
+
getBaggageItem (key: string): string | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* @experimental
|
|
191
|
+
*
|
|
192
|
+
* Returns all baggage items from the current context.
|
|
193
|
+
*
|
|
194
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#get-all-values
|
|
195
|
+
*/
|
|
196
|
+
getAllBaggageItems (): Record<string, string>;
|
|
197
|
+
/**
|
|
198
|
+
* @experimental
|
|
199
|
+
*
|
|
200
|
+
* Removes a specific baggage item from the current context and returns the new context.
|
|
201
|
+
*
|
|
202
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#remove-value
|
|
203
|
+
*/
|
|
204
|
+
removeBaggageItem (key: string): Record<string, string>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @experimental
|
|
208
|
+
*
|
|
209
|
+
* Removes all baggage items from the current context and returns the new context.
|
|
210
|
+
*
|
|
211
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#remove-all-values
|
|
212
|
+
*/
|
|
213
|
+
removeAllBaggageItems (): Record<string, string>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// left out of the namespace, so it
|
|
217
|
+
// is doesn't need to be exported for Tracer
|
|
218
|
+
/** @hidden */
|
|
219
|
+
interface Plugins {
|
|
220
|
+
"aerospike": tracer.plugins.aerospike;
|
|
221
|
+
"ai": tracer.plugins.ai;
|
|
222
|
+
"amqp10": tracer.plugins.amqp10;
|
|
223
|
+
"amqplib": tracer.plugins.amqplib;
|
|
224
|
+
"anthropic": tracer.plugins.anthropic;
|
|
225
|
+
"apollo": tracer.plugins.apollo;
|
|
226
|
+
"avsc": tracer.plugins.avsc;
|
|
227
|
+
"aws-sdk": tracer.plugins.aws_sdk;
|
|
228
|
+
"azure-event-hubs": tracer.plugins.azure_event_hubs;
|
|
229
|
+
"azure-functions": tracer.plugins.azure_functions;
|
|
230
|
+
"azure-service-bus": tracer.plugins.azure_service_bus;
|
|
231
|
+
"azure-durable-functions": tracer.plugins.azure_durable_functions
|
|
232
|
+
"bullmq": tracer.plugins.bullmq;
|
|
233
|
+
"bunyan": tracer.plugins.bunyan;
|
|
234
|
+
"cassandra-driver": tracer.plugins.cassandra_driver;
|
|
235
|
+
"child_process": tracer.plugins.child_process;
|
|
236
|
+
"confluentinc-kafka-javascript": tracer.plugins.confluentinc_kafka_javascript;
|
|
237
|
+
"connect": tracer.plugins.connect;
|
|
238
|
+
"couchbase": tracer.plugins.couchbase;
|
|
239
|
+
"cucumber": tracer.plugins.cucumber;
|
|
240
|
+
"cypress": tracer.plugins.cypress;
|
|
241
|
+
"dns": tracer.plugins.dns;
|
|
242
|
+
"elasticsearch": tracer.plugins.elasticsearch;
|
|
243
|
+
"express": tracer.plugins.express;
|
|
244
|
+
"fastify": tracer.plugins.fastify;
|
|
245
|
+
"fetch": tracer.plugins.fetch;
|
|
246
|
+
"find-my-way": tracer.plugins.find_my_way;
|
|
247
|
+
"fs": tracer.plugins.fs;
|
|
248
|
+
"generic-pool": tracer.plugins.generic_pool;
|
|
249
|
+
"google-cloud-pubsub": tracer.plugins.google_cloud_pubsub;
|
|
250
|
+
"google-cloud-vertexai": tracer.plugins.google_cloud_vertexai;
|
|
251
|
+
"google-genai": tracer.plugins.google_genai;
|
|
252
|
+
"graphql": tracer.plugins.graphql;
|
|
253
|
+
"grpc": tracer.plugins.grpc;
|
|
254
|
+
"hapi": tracer.plugins.hapi;
|
|
255
|
+
"hono": tracer.plugins.hono;
|
|
256
|
+
"http": tracer.plugins.http;
|
|
257
|
+
"http2": tracer.plugins.http2;
|
|
258
|
+
"ioredis": tracer.plugins.ioredis;
|
|
259
|
+
"iovalkey": tracer.plugins.iovalkey;
|
|
260
|
+
"jest": tracer.plugins.jest;
|
|
261
|
+
"kafkajs": tracer.plugins.kafkajs;
|
|
262
|
+
"knex": tracer.plugins.knex;
|
|
263
|
+
"koa": tracer.plugins.koa;
|
|
264
|
+
"langchain": tracer.plugins.langchain;
|
|
265
|
+
"mariadb": tracer.plugins.mariadb;
|
|
266
|
+
"memcached": tracer.plugins.memcached;
|
|
267
|
+
"microgateway-core": tracer.plugins.microgateway_core;
|
|
268
|
+
"mocha": tracer.plugins.mocha;
|
|
269
|
+
"moleculer": tracer.plugins.moleculer;
|
|
270
|
+
"mongodb-core": tracer.plugins.mongodb_core;
|
|
271
|
+
"mongoose": tracer.plugins.mongoose;
|
|
272
|
+
"mysql": tracer.plugins.mysql;
|
|
273
|
+
"mysql2": tracer.plugins.mysql2;
|
|
274
|
+
"net": tracer.plugins.net;
|
|
275
|
+
"next": tracer.plugins.next;
|
|
276
|
+
"nyc": tracer.plugins.nyc;
|
|
277
|
+
"openai": tracer.plugins.openai;
|
|
278
|
+
"opensearch": tracer.plugins.opensearch;
|
|
279
|
+
"oracledb": tracer.plugins.oracledb;
|
|
280
|
+
"playwright": tracer.plugins.playwright;
|
|
281
|
+
"pg": tracer.plugins.pg;
|
|
282
|
+
"pino": tracer.plugins.pino;
|
|
283
|
+
"prisma": tracer.plugins.prisma;
|
|
284
|
+
"protobufjs": tracer.plugins.protobufjs;
|
|
285
|
+
"redis": tracer.plugins.redis;
|
|
286
|
+
"restify": tracer.plugins.restify;
|
|
287
|
+
"rhea": tracer.plugins.rhea;
|
|
288
|
+
"router": tracer.plugins.router;
|
|
289
|
+
"selenium": tracer.plugins.selenium;
|
|
290
|
+
"sharedb": tracer.plugins.sharedb;
|
|
291
|
+
"tedious": tracer.plugins.tedious;
|
|
292
|
+
"undici": tracer.plugins.undici;
|
|
293
|
+
"vitest": tracer.plugins.vitest;
|
|
294
|
+
"web": tracer.plugins.web;
|
|
295
|
+
"winston": tracer.plugins.winston;
|
|
296
|
+
"ws": tracer.plugins.ws;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare namespace tracer {
|
|
300
|
+
export type SpanOptions = Omit<opentracing.SpanOptions, 'childOf'> & {
|
|
301
|
+
/**
|
|
302
|
+
* Set childOf to 'null' to create a root span without a parent, even when a parent span
|
|
303
|
+
* exists in the current async context. If 'undefined' the parent will be inferred from the
|
|
304
|
+
* existing async context.
|
|
305
|
+
*/
|
|
306
|
+
childOf?: opentracing.Span | opentracing.SpanContext | null;
|
|
307
|
+
/**
|
|
308
|
+
* Optional name of the integration that crated this span.
|
|
309
|
+
*/
|
|
310
|
+
integrationName?: string;
|
|
311
|
+
};
|
|
312
|
+
export { Tracer };
|
|
313
|
+
|
|
314
|
+
export interface TraceOptions extends Analyzable {
|
|
315
|
+
/**
|
|
316
|
+
* The resource you are tracing. The resource name must not be longer than
|
|
317
|
+
* 5000 characters.
|
|
318
|
+
*/
|
|
319
|
+
resource?: string,
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* The service you are tracing. The service name must not be longer than
|
|
323
|
+
* 100 characters.
|
|
324
|
+
*/
|
|
325
|
+
service?: string,
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The type of request.
|
|
329
|
+
*/
|
|
330
|
+
type?: string
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* An array of span links
|
|
334
|
+
*/
|
|
335
|
+
links?: { context: SpanContext, attributes?: Object }[]
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Span represents a logical unit of work as part of a broader Trace.
|
|
340
|
+
* Examples of span might include remote procedure calls or a in-process
|
|
341
|
+
* function calls to sub-components. A Trace has a single, top-level "root"
|
|
342
|
+
* Span that in turn may have zero or more child Spans, which in turn may
|
|
343
|
+
* have children.
|
|
344
|
+
*/
|
|
345
|
+
export interface Span extends opentracing.Span {
|
|
346
|
+
context (): SpanContext;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Causally links another span to the current span
|
|
350
|
+
*
|
|
351
|
+
* @deprecated In favor of addLink(link: { context: SpanContext, attributes?: Object }).
|
|
352
|
+
* This will be removed in the next major version.
|
|
353
|
+
* @param {SpanContext} context The context of the span to link to.
|
|
354
|
+
* @param {Object} attributes An optional key value pair of arbitrary values.
|
|
355
|
+
* @returns {void}
|
|
356
|
+
*/
|
|
357
|
+
addLink (context: SpanContext, attributes?: Object): void;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Adds a single link to the span.
|
|
361
|
+
*
|
|
362
|
+
* Links added after the creation will not affect the sampling decision.
|
|
363
|
+
* It is preferred span links be added at span creation.
|
|
364
|
+
*
|
|
365
|
+
* @param link the link to add.
|
|
366
|
+
*/
|
|
367
|
+
addLink (link: { context: SpanContext, attributes?: Object }): void;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Adds multiple links to the span.
|
|
371
|
+
*
|
|
372
|
+
* Links added after the creation will not affect the sampling decision.
|
|
373
|
+
* It is preferred span links be added at span creation.
|
|
374
|
+
*
|
|
375
|
+
* @param links the links to add.
|
|
376
|
+
*/
|
|
377
|
+
addLinks (links: { context: SpanContext, attributes?: Object }[]): void;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* SpanContext represents Span state that must propagate to descendant Spans
|
|
382
|
+
* and across process boundaries.
|
|
383
|
+
*
|
|
384
|
+
* SpanContext is logically divided into two pieces: the user-level "Baggage"
|
|
385
|
+
* (see setBaggageItem and getBaggageItem) that propagates across Span
|
|
386
|
+
* boundaries and any Tracer-implementation-specific fields that are needed to
|
|
387
|
+
* identify or otherwise contextualize the associated Span instance (e.g., a
|
|
388
|
+
* <trace_id, span_id, sampled> tuple).
|
|
389
|
+
*/
|
|
390
|
+
export interface SpanContext extends opentracing.SpanContext {
|
|
391
|
+
/**
|
|
392
|
+
* Returns the string representation of the internal trace ID.
|
|
393
|
+
*/
|
|
394
|
+
toTraceId (): string;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Returns the string representation of the internal span ID.
|
|
398
|
+
*/
|
|
399
|
+
toSpanId (): string;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Returns the string representation used for DBM integration.
|
|
403
|
+
*/
|
|
404
|
+
toTraceparent (): string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Sampling rule to configure on the priority sampler.
|
|
409
|
+
*/
|
|
410
|
+
export interface SamplingRule {
|
|
411
|
+
/**
|
|
412
|
+
* Sampling rate for this rule.
|
|
413
|
+
*/
|
|
414
|
+
sampleRate: number
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Service on which to apply this rule. The rule will apply to all services if not provided.
|
|
418
|
+
*/
|
|
419
|
+
service?: string | RegExp
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Operation name on which to apply this rule. The rule will apply to all operation names if not provided.
|
|
423
|
+
*/
|
|
424
|
+
name?: string | RegExp
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Span sampling rules to ingest single spans where the enclosing trace is dropped
|
|
429
|
+
*/
|
|
430
|
+
export interface SpanSamplingRule {
|
|
431
|
+
/**
|
|
432
|
+
* Sampling rate for this rule. Will default to 1.0 (always) if not provided.
|
|
433
|
+
*/
|
|
434
|
+
sampleRate?: number
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Maximum number of spans matching a span sampling rule to be allowed per second.
|
|
438
|
+
*/
|
|
439
|
+
maxPerSecond?: number
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Service name or pattern on which to apply this rule. The rule will apply to all services if not provided.
|
|
443
|
+
*/
|
|
444
|
+
service?: string
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Operation name or pattern on which to apply this rule. The rule will apply to all operation names if not provided.
|
|
448
|
+
*/
|
|
449
|
+
name?: string
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Selection and priority order of context propagation injection and extraction mechanisms.
|
|
454
|
+
*/
|
|
455
|
+
export interface PropagationStyle {
|
|
456
|
+
/**
|
|
457
|
+
* Selection of context propagation injection mechanisms.
|
|
458
|
+
*/
|
|
459
|
+
inject: string[],
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Selection and priority order of context propagation extraction mechanisms.
|
|
463
|
+
*/
|
|
464
|
+
extract: string[]
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* List of options available to the tracer.
|
|
469
|
+
*/
|
|
470
|
+
export interface TracerOptions {
|
|
471
|
+
/**
|
|
472
|
+
* Used to disable APM Tracing when using standalone products
|
|
473
|
+
* @default true
|
|
474
|
+
* @env DD_APM_TRACING_ENABLED
|
|
475
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
476
|
+
*/
|
|
477
|
+
apmTracingEnabled?: boolean
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Whether to enable trace ID injection in log records to be able to correlate
|
|
481
|
+
* traces with logs.
|
|
482
|
+
* @default false
|
|
483
|
+
* @env DD_LOGS_INJECTION
|
|
484
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
485
|
+
*/
|
|
486
|
+
logInjection?: boolean,
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Whether to enable startup logs.
|
|
490
|
+
* @default false
|
|
491
|
+
* @env DD_TRACE_STARTUP_LOGS
|
|
492
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
493
|
+
*/
|
|
494
|
+
startupLogs?: boolean,
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* The service name to be used for this program. If not set, the service name
|
|
498
|
+
* will attempted to be inferred from package.json
|
|
499
|
+
* @env DD_SERVICE, OTEL_SERVICE_NAME
|
|
500
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
501
|
+
*/
|
|
502
|
+
service?: string;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Provide service name mappings for each plugin.
|
|
506
|
+
* @env DD_SERVICE_MAPPING
|
|
507
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
508
|
+
*/
|
|
509
|
+
serviceMapping?: { [key: string]: string };
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* The url of the trace agent that the tracer will submit to.
|
|
513
|
+
* Takes priority over hostname and port, if set.
|
|
514
|
+
* @env DD_TRACE_AGENT_URL
|
|
515
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
516
|
+
*/
|
|
517
|
+
url?: string;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* The address of the trace agent that the tracer will submit to.
|
|
521
|
+
* @default '127.0.0.1'
|
|
522
|
+
* @env DD_AGENT_HOST
|
|
523
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
524
|
+
*/
|
|
525
|
+
hostname?: string;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The port of the trace agent that the tracer will submit to.
|
|
529
|
+
* @default 8126
|
|
530
|
+
* @env DD_TRACE_AGENT_PORT
|
|
531
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
532
|
+
*/
|
|
533
|
+
port?: number | string;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Whether to enable profiling.
|
|
537
|
+
* @env DD_PROFILING_ENABLED
|
|
538
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
539
|
+
*/
|
|
540
|
+
profiling?: boolean
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Options specific for the Dogstatsd agent.
|
|
544
|
+
*/
|
|
545
|
+
dogstatsd?: {
|
|
546
|
+
/**
|
|
547
|
+
* The hostname of the Dogstatsd agent that the metrics will submitted to.
|
|
548
|
+
* @env DD_DOGSTATSD_HOST
|
|
549
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
550
|
+
*/
|
|
551
|
+
hostname?: string
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* The port of the Dogstatsd agent that the metrics will submitted to.
|
|
555
|
+
* @default 8125
|
|
556
|
+
* @env DD_DOGSTATSD_PORT
|
|
557
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
558
|
+
*/
|
|
559
|
+
port?: number
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Set an application’s environment e.g. prod, pre-prod, stage.
|
|
564
|
+
* @env DD_ENV
|
|
565
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
566
|
+
*/
|
|
567
|
+
env?: string;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* The version number of the application. If not set, the version
|
|
571
|
+
* will attempted to be inferred from package.json.
|
|
572
|
+
* @env DD_VERSION
|
|
573
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
574
|
+
*/
|
|
575
|
+
version?: string;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
|
|
579
|
+
* @env DD_TRACE_SAMPLE_RATE, OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG
|
|
580
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
581
|
+
*/
|
|
582
|
+
sampleRate?: number;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Global rate limit that is applied on the global sample rate and all rules,
|
|
586
|
+
* and controls the ingestion rate limit between the agent and the backend.
|
|
587
|
+
* Defaults to deferring the decision to the agent.
|
|
588
|
+
* @env DD_TRACE_RATE_LIMIT
|
|
589
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
590
|
+
*/
|
|
591
|
+
rateLimit?: number,
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Sampling rules to apply to priority sampling. Each rule is a JSON,
|
|
595
|
+
* consisting of `service` and `name`, which are regexes to match against
|
|
596
|
+
* a trace's `service` and `name`, and a corresponding `sampleRate`. If not
|
|
597
|
+
* specified, will defer to global sampling rate for all spans.
|
|
598
|
+
* @default []
|
|
599
|
+
* @env DD_TRACE_SAMPLING_RULES
|
|
600
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
601
|
+
*/
|
|
602
|
+
samplingRules?: SamplingRule[]
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Span sampling rules that take effect when the enclosing trace is dropped, to ingest single spans
|
|
606
|
+
* @default []
|
|
607
|
+
* @env DD_SPAN_SAMPLING_RULES, DD_SPAN_SAMPLING_RULES_FILE
|
|
608
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
609
|
+
*/
|
|
610
|
+
spanSamplingRules?: SpanSamplingRule[]
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Interval in milliseconds at which the tracer will submit traces to the agent.
|
|
614
|
+
* @default 2000
|
|
615
|
+
* @env DD_TRACE_FLUSH_INTERVAL
|
|
616
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
617
|
+
*/
|
|
618
|
+
flushInterval?: number;
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Number of spans before partially exporting a trace. This prevents keeping all the spans in memory for very large traces.
|
|
622
|
+
* @default 1000
|
|
623
|
+
* @env DD_TRACE_PARTIAL_FLUSH_MIN_SPANS
|
|
624
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
625
|
+
*/
|
|
626
|
+
flushMinSpans?: number;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Whether to enable runtime metrics, or an object specifying whether to enable specific metric types.
|
|
630
|
+
* @default false
|
|
631
|
+
*/
|
|
632
|
+
runtimeMetrics?: boolean | {
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* @env DD_RUNTIME_METRICS_ENABLED
|
|
636
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
637
|
+
*/
|
|
638
|
+
enabled?: boolean,
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* @env DD_RUNTIME_METRICS_GC_ENABLED
|
|
642
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
643
|
+
*/
|
|
644
|
+
gc?: boolean,
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* @env DD_RUNTIME_METRICS_EVENT_LOOP_ENABLED
|
|
648
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
649
|
+
*/
|
|
650
|
+
eventLoop?: boolean
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Whether to add an auto-generated `runtime-id` tag to metrics.
|
|
655
|
+
* @default false
|
|
656
|
+
* @env DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED
|
|
657
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
658
|
+
*/
|
|
659
|
+
runtimeMetricsRuntimeId?: boolean
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Custom function for DNS lookups when sending requests to the agent.
|
|
663
|
+
* @default dns.lookup()
|
|
664
|
+
*/
|
|
665
|
+
lookup?: LookupFunction
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Protocol version to use for requests to the agent. The version configured must be supported by the agent version installed or all traces will be dropped.
|
|
669
|
+
* @default 0.4
|
|
670
|
+
* @env DD_TRACE_AGENT_PROTOCOL_VERSION
|
|
671
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
672
|
+
*/
|
|
673
|
+
protocolVersion?: string
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Deprecated in favor of the global versions of the variables provided under this option
|
|
677
|
+
*
|
|
678
|
+
* @deprecated
|
|
679
|
+
* @hidden
|
|
680
|
+
*/
|
|
681
|
+
ingestion?: {
|
|
682
|
+
/**
|
|
683
|
+
* Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
|
|
684
|
+
* @env DD_TRACE_SAMPLE_RATE, OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG
|
|
685
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
686
|
+
*/
|
|
687
|
+
sampleRate?: number
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Controls the ingestion rate limit between the agent and the backend. Defaults to deferring the decision to the agent.
|
|
691
|
+
* @env DD_TRACE_RATE_LIMIT
|
|
692
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
693
|
+
*/
|
|
694
|
+
rateLimit?: number
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Experimental features can be enabled individually using key / value pairs.
|
|
699
|
+
* @default {}
|
|
700
|
+
*/
|
|
701
|
+
experimental?: {
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* @default false
|
|
705
|
+
* @env DD_TRACE_EXPERIMENTAL_B3_ENABLED
|
|
706
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
707
|
+
*/
|
|
708
|
+
b3?: boolean
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Whether to write traces to log output or agentless, rather than send to an agent
|
|
712
|
+
* @env DD_TRACE_EXPERIMENTAL_EXPORTER
|
|
713
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
714
|
+
*/
|
|
715
|
+
exporter?: 'log' | 'agent' | 'datadog'
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Whether to enable the experimental `getRumData` method.
|
|
719
|
+
* @default false
|
|
720
|
+
* @env DD_TRACE_EXPERIMENTAL_GET_RUM_DATA_ENABLED
|
|
721
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
722
|
+
*/
|
|
723
|
+
enableGetRumData?: boolean
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Configuration of the IAST. Can be a boolean as an alias to `iast.enabled`.
|
|
727
|
+
*/
|
|
728
|
+
iast?: boolean | IastOptions
|
|
729
|
+
|
|
730
|
+
appsec?: {
|
|
731
|
+
/**
|
|
732
|
+
* Configuration of Standalone ASM mode
|
|
733
|
+
* Deprecated in favor of `apmTracingEnabled`.
|
|
734
|
+
*
|
|
735
|
+
* @deprecated
|
|
736
|
+
*/
|
|
737
|
+
standalone?: {
|
|
738
|
+
/**
|
|
739
|
+
* Whether to enable Standalone ASM.
|
|
740
|
+
* @default false
|
|
741
|
+
*/
|
|
742
|
+
enabled?: boolean
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
|
|
746
|
+
aiguard?: {
|
|
747
|
+
/**
|
|
748
|
+
* Set to `true` to enable the SDK.
|
|
749
|
+
* @env DD_AI_GUARD_ENABLED
|
|
750
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
751
|
+
*/
|
|
752
|
+
enabled?: boolean,
|
|
753
|
+
/**
|
|
754
|
+
* URL of the AI Guard REST API.
|
|
755
|
+
* @env DD_AI_GUARD_ENDPOINT
|
|
756
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
757
|
+
*/
|
|
758
|
+
endpoint?: string,
|
|
759
|
+
/**
|
|
760
|
+
* Timeout used in calls to the AI Guard REST API in milliseconds (default 5000)
|
|
761
|
+
* @env DD_AI_GUARD_TIMEOUT
|
|
762
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
763
|
+
*/
|
|
764
|
+
timeout?: number,
|
|
765
|
+
/**
|
|
766
|
+
* Maximum number of conversational messages allowed to be set in the meta-struct
|
|
767
|
+
* @env DD_AI_GUARD_MAX_MESSAGES_LENGTH
|
|
768
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
769
|
+
*/
|
|
770
|
+
maxMessagesLength?: number,
|
|
771
|
+
/**
|
|
772
|
+
* Max size of the content property set in the meta-struct
|
|
773
|
+
* @env DD_AI_GUARD_MAX_CONTENT_SIZE
|
|
774
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
775
|
+
*/
|
|
776
|
+
maxContentSize?: number
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Configuration for Feature Flagging & Experimentation.
|
|
781
|
+
*
|
|
782
|
+
* @beta This feature is in preview and not ready for production use
|
|
783
|
+
*/
|
|
784
|
+
flaggingProvider?: {
|
|
785
|
+
/**
|
|
786
|
+
* Whether to enable the feature flagging provider.
|
|
787
|
+
* Requires Remote Config to be properly configured.
|
|
788
|
+
* Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED environment variable.
|
|
789
|
+
*
|
|
790
|
+
* @default false
|
|
791
|
+
* @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
|
|
792
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
793
|
+
*/
|
|
794
|
+
enabled?: boolean
|
|
795
|
+
/**
|
|
796
|
+
* Timeout in milliseconds for OpenFeature provider initialization.
|
|
797
|
+
* If configuration is not received within this time, initialization fails.
|
|
798
|
+
* Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS environment variable.
|
|
799
|
+
*
|
|
800
|
+
* @default 30000
|
|
801
|
+
* @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS
|
|
802
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
803
|
+
*/
|
|
804
|
+
initializationTimeoutMs?: number
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Whether to load all built-in plugins.
|
|
810
|
+
* @default true
|
|
811
|
+
*/
|
|
812
|
+
plugins?: boolean;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Custom logger to be used by the tracer (if debug = true),
|
|
816
|
+
* should support error(), warn(), info(), and debug() methods
|
|
817
|
+
* see https://datadog.github.io/dd-trace-js/#custom-logging
|
|
818
|
+
*/
|
|
819
|
+
logger?: {
|
|
820
|
+
error: (err: Error | string) => void;
|
|
821
|
+
warn: (message: string) => void;
|
|
822
|
+
info: (message: string) => void;
|
|
823
|
+
debug: (message: string) => void;
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Global tags that should be assigned to every span.
|
|
828
|
+
* @env DD_TAGS, OTEL_RESOURCE_ATTRIBUTES
|
|
829
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
830
|
+
*/
|
|
831
|
+
tags?: { [key: string]: any };
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Whether to report the hostname of the service host. This is used when the agent is deployed on a different host and cannot determine the hostname automatically.
|
|
835
|
+
* @default false
|
|
836
|
+
* @env DD_TRACE_REPORT_HOSTNAME
|
|
837
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
838
|
+
*/
|
|
839
|
+
reportHostname?: boolean
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* A string representing the minimum tracer log level to use when debug logging is enabled
|
|
843
|
+
* @default 'debug'
|
|
844
|
+
* @env DD_TRACE_LOG_LEVEL, OTEL_LOG_LEVEL
|
|
845
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
846
|
+
*/
|
|
847
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error'
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Enables DBM to APM link using tag injection.
|
|
851
|
+
* @default 'disabled'
|
|
852
|
+
* @env DD_DBM_PROPAGATION_MODE
|
|
853
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
854
|
+
*/
|
|
855
|
+
dbmPropagationMode?: 'disabled' | 'service' | 'full'
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Whether to enable Data Streams Monitoring.
|
|
859
|
+
* Can also be enabled via the DD_DATA_STREAMS_ENABLED environment variable.
|
|
860
|
+
* When not provided, the value of DD_DATA_STREAMS_ENABLED is used.
|
|
861
|
+
* @default false
|
|
862
|
+
* @env DD_DATA_STREAMS_ENABLED
|
|
863
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
864
|
+
*/
|
|
865
|
+
dsmEnabled?: boolean
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Configuration for Database Monitoring (DBM).
|
|
869
|
+
*/
|
|
870
|
+
dbm?: {
|
|
871
|
+
/**
|
|
872
|
+
* Controls whether to inject the SQL base hash (propagation hash) in DBM SQL comments.
|
|
873
|
+
* This option requires DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=true to take effect.
|
|
874
|
+
* The propagation hash enables correlation between traces and database operations.
|
|
875
|
+
* @default false
|
|
876
|
+
* @env DD_DBM_INJECT_SQL_BASEHASH
|
|
877
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
878
|
+
*/
|
|
879
|
+
injectSqlBaseHash?: boolean
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Configuration of the AppSec protection. Can be a boolean as an alias to `appsec.enabled`.
|
|
884
|
+
*/
|
|
885
|
+
appsec?: boolean | {
|
|
886
|
+
/**
|
|
887
|
+
* Whether to enable AppSec.
|
|
888
|
+
* @default false
|
|
889
|
+
* @env DD_APPSEC_ENABLED
|
|
890
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
891
|
+
*/
|
|
892
|
+
enabled?: boolean,
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Specifies a path to a custom rules file.
|
|
896
|
+
* @env DD_APPSEC_RULES
|
|
897
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
898
|
+
*/
|
|
899
|
+
rules?: string,
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Controls the maximum amount of traces sampled by AppSec attacks, per second.
|
|
903
|
+
* @default 100
|
|
904
|
+
* @env DD_APPSEC_TRACE_RATE_LIMIT
|
|
905
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
906
|
+
*/
|
|
907
|
+
rateLimit?: number,
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Controls the maximum amount of time in microseconds the WAF is allowed to run synchronously for.
|
|
911
|
+
* @default 5000
|
|
912
|
+
* @env DD_APPSEC_WAF_TIMEOUT
|
|
913
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
914
|
+
*/
|
|
915
|
+
wafTimeout?: number,
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Specifies a regex that will redact sensitive data by its key in attack reports.
|
|
919
|
+
* @env DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP
|
|
920
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
921
|
+
*/
|
|
922
|
+
obfuscatorKeyRegex?: string,
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Specifies a regex that will redact sensitive data by its value in attack reports.
|
|
926
|
+
* @env DD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP
|
|
927
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
928
|
+
*/
|
|
929
|
+
obfuscatorValueRegex?: string,
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Specifies a path to a custom blocking template html file.
|
|
933
|
+
* @env DD_APPSEC_HTTP_BLOCKED_TEMPLATE_HTML
|
|
934
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
935
|
+
*/
|
|
936
|
+
blockedTemplateHtml?: string,
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Specifies a path to a custom blocking template json file.
|
|
940
|
+
* @env DD_APPSEC_HTTP_BLOCKED_TEMPLATE_JSON
|
|
941
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
942
|
+
*/
|
|
943
|
+
blockedTemplateJson?: string,
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Specifies a path to a custom blocking template json file for graphql requests
|
|
947
|
+
* @env DD_APPSEC_GRAPHQL_BLOCKED_TEMPLATE_JSON
|
|
948
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
949
|
+
*/
|
|
950
|
+
blockedTemplateGraphql?: string,
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Controls the automated user event tracking configuration
|
|
954
|
+
*/
|
|
955
|
+
eventTracking?: {
|
|
956
|
+
/**
|
|
957
|
+
* Controls the automated user tracking mode for user IDs and logins collections. Possible values:
|
|
958
|
+
* * 'anonymous': will hash user IDs and user logins before collecting them
|
|
959
|
+
* * 'anon': alias for 'anonymous'
|
|
960
|
+
* * 'safe': deprecated alias for 'anonymous'
|
|
961
|
+
*
|
|
962
|
+
* * 'identification': will collect user IDs and logins without redaction
|
|
963
|
+
* * 'ident': alias for 'identification'
|
|
964
|
+
* * 'extended': deprecated alias for 'identification'
|
|
965
|
+
*
|
|
966
|
+
* * 'disabled': will not collect user IDs and logins
|
|
967
|
+
*
|
|
968
|
+
* Unknown values will be considered as 'disabled'
|
|
969
|
+
* @default 'identification'
|
|
970
|
+
* @env DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE
|
|
971
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
972
|
+
*/
|
|
973
|
+
mode?:
|
|
974
|
+
'anonymous' | 'anon' | 'safe' |
|
|
975
|
+
'identification' | 'ident' | 'extended' |
|
|
976
|
+
'disabled'
|
|
977
|
+
},
|
|
978
|
+
/**
|
|
979
|
+
* Configuration for Api Security
|
|
980
|
+
*/
|
|
981
|
+
apiSecurity?: {
|
|
982
|
+
/** Whether to enable Api Security.
|
|
983
|
+
* @default true
|
|
984
|
+
* @env DD_API_SECURITY_ENABLED
|
|
985
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
986
|
+
*/
|
|
987
|
+
enabled?: boolean,
|
|
988
|
+
|
|
989
|
+
/** Whether to enable endpoint collection for API Security.
|
|
990
|
+
* @default true
|
|
991
|
+
* @env DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED
|
|
992
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
993
|
+
*/
|
|
994
|
+
endpointCollectionEnabled?: boolean,
|
|
995
|
+
|
|
996
|
+
/** Maximum number of endpoints that can be serialized per message.
|
|
997
|
+
* @default 300
|
|
998
|
+
* @env DD_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT
|
|
999
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1000
|
+
*/
|
|
1001
|
+
endpointCollectionMessageLimit?: number,
|
|
1002
|
+
},
|
|
1003
|
+
/**
|
|
1004
|
+
* Configuration for RASP
|
|
1005
|
+
*/
|
|
1006
|
+
rasp?: {
|
|
1007
|
+
/** Whether to enable RASP.
|
|
1008
|
+
* @default false
|
|
1009
|
+
* @env DD_APPSEC_RASP_ENABLED
|
|
1010
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1011
|
+
*/
|
|
1012
|
+
enabled?: boolean,
|
|
1013
|
+
|
|
1014
|
+
/** Whether to enable request body collection on RASP event
|
|
1015
|
+
* @default false
|
|
1016
|
+
*
|
|
1017
|
+
* @deprecated Use UI and Remote Configuration to enable extended data collection
|
|
1018
|
+
* @env DD_APPSEC_RASP_COLLECT_REQUEST_BODY
|
|
1019
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1020
|
+
*/
|
|
1021
|
+
bodyCollection?: boolean
|
|
1022
|
+
},
|
|
1023
|
+
/**
|
|
1024
|
+
* Configuration for stack trace reporting
|
|
1025
|
+
*/
|
|
1026
|
+
stackTrace?: {
|
|
1027
|
+
/** Whether to enable stack trace reporting.
|
|
1028
|
+
* @default true
|
|
1029
|
+
* @env DD_APPSEC_STACK_TRACE_ENABLED
|
|
1030
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1031
|
+
*/
|
|
1032
|
+
enabled?: boolean,
|
|
1033
|
+
|
|
1034
|
+
/** Specifies the maximum number of stack traces to be reported.
|
|
1035
|
+
* @default 2
|
|
1036
|
+
* @env DD_APPSEC_MAX_STACK_TRACES
|
|
1037
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1038
|
+
*/
|
|
1039
|
+
maxStackTraces?: number,
|
|
1040
|
+
|
|
1041
|
+
/** Specifies the maximum depth of a stack trace to be reported.
|
|
1042
|
+
* @default 32
|
|
1043
|
+
* @env DD_APPSEC_MAX_STACK_TRACE_DEPTH
|
|
1044
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1045
|
+
*/
|
|
1046
|
+
maxDepth?: number,
|
|
1047
|
+
},
|
|
1048
|
+
/**
|
|
1049
|
+
* Configuration for extended headers collection tied to security events
|
|
1050
|
+
*
|
|
1051
|
+
* @deprecated Use UI and Remote Configuration to enable extended data collection
|
|
1052
|
+
*/
|
|
1053
|
+
extendedHeadersCollection?: {
|
|
1054
|
+
/** Whether to enable extended headers collection
|
|
1055
|
+
* @default false
|
|
1056
|
+
*
|
|
1057
|
+
* @deprecated Use UI and Remote Configuration to enable extended data collection
|
|
1058
|
+
* @env DD_APPSEC_COLLECT_ALL_HEADERS
|
|
1059
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1060
|
+
*/
|
|
1061
|
+
enabled: boolean,
|
|
1062
|
+
|
|
1063
|
+
/** Whether to redact collected headers
|
|
1064
|
+
* @default true
|
|
1065
|
+
*
|
|
1066
|
+
* @deprecated Use UI and Remote Configuration to enable extended data collection
|
|
1067
|
+
* @env DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED
|
|
1068
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1069
|
+
*/
|
|
1070
|
+
redaction: boolean,
|
|
1071
|
+
|
|
1072
|
+
/** Specifies the maximum number of headers collected.
|
|
1073
|
+
* @default 50
|
|
1074
|
+
*
|
|
1075
|
+
* @deprecated Use UI and Remote Configuration to enable extended data collection
|
|
1076
|
+
* @env DD_APPSEC_MAX_COLLECTED_HEADERS
|
|
1077
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1078
|
+
*/
|
|
1079
|
+
maxHeaders: number,
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Configuration for Code Origin for Spans.
|
|
1085
|
+
*/
|
|
1086
|
+
codeOriginForSpans?: {
|
|
1087
|
+
/**
|
|
1088
|
+
* Whether to enable Code Origin for Spans.
|
|
1089
|
+
* @default true
|
|
1090
|
+
* @env DD_CODE_ORIGIN_FOR_SPANS_ENABLED
|
|
1091
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1092
|
+
*/
|
|
1093
|
+
enabled?: boolean
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Configuration of the IAST. Can be a boolean as an alias to `iast.enabled`.
|
|
1098
|
+
*/
|
|
1099
|
+
iast?: boolean | IastOptions
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Configuration of ASM Remote Configuration
|
|
1103
|
+
*/
|
|
1104
|
+
remoteConfig?: {
|
|
1105
|
+
/**
|
|
1106
|
+
* Specifies the remote configuration polling interval in seconds
|
|
1107
|
+
* @default 5
|
|
1108
|
+
* @env DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS
|
|
1109
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1110
|
+
*/
|
|
1111
|
+
pollInterval?: number,
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Whether to enable client IP collection from relevant IP headers
|
|
1116
|
+
* @default false
|
|
1117
|
+
* @env DD_TRACE_CLIENT_IP_ENABLED
|
|
1118
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1119
|
+
*/
|
|
1120
|
+
clientIpEnabled?: boolean
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Custom header name to source the http.client_ip tag from.
|
|
1124
|
+
* @env DD_TRACE_CLIENT_IP_HEADER
|
|
1125
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1126
|
+
*/
|
|
1127
|
+
clientIpHeader?: string,
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* The selection and priority order of context propagation injection and extraction mechanisms.
|
|
1131
|
+
* @env DD_TRACE_PROPAGATION_STYLE, DD_TRACE_PROPAGATION_STYLE_INJECT, DD_TRACE_PROPAGATION_STYLE_EXTRACT
|
|
1132
|
+
* Also configurable via OTEL_PROPAGATORS when DD-specific propagation vars are not set.
|
|
1133
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1134
|
+
*/
|
|
1135
|
+
tracePropagationStyle?: string[] | PropagationStyle
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Cloud payload report as tags
|
|
1139
|
+
*/
|
|
1140
|
+
cloudPayloadTagging?: {
|
|
1141
|
+
/**
|
|
1142
|
+
* Additional JSONPath queries to replace with `redacted` in request payloads
|
|
1143
|
+
* Undefined or invalid JSONPath queries disable the feature for requests.
|
|
1144
|
+
* @env DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
|
|
1145
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1146
|
+
*/
|
|
1147
|
+
request?: string,
|
|
1148
|
+
/**
|
|
1149
|
+
* Additional JSONPath queries to replace with `redacted` in response payloads
|
|
1150
|
+
* Undefined or invalid JSONPath queries disable the feature for responses.
|
|
1151
|
+
* @env DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
|
|
1152
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1153
|
+
*/
|
|
1154
|
+
response?: string,
|
|
1155
|
+
/**
|
|
1156
|
+
* Maximum depth of payload traversal for tags
|
|
1157
|
+
* @env DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH
|
|
1158
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1159
|
+
*/
|
|
1160
|
+
maxDepth?: number
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Configuration enabling LLM Observability. Enablement is superseded by the DD_LLMOBS_ENABLED environment variable.
|
|
1165
|
+
* @env DD_LLMOBS_ENABLED
|
|
1166
|
+
* The environment variable listed above takes precedence over programmatic configuration.
|
|
1167
|
+
*/
|
|
1168
|
+
llmobs?: llmobs.LLMObsEnableOptions
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Configuration for Dynamic Instrumentation (Live Debugging).
|
|
1172
|
+
*/
|
|
1173
|
+
dynamicInstrumentation?: {
|
|
1174
|
+
/**
|
|
1175
|
+
* Whether to enable Dynamic Instrumentation.
|
|
1176
|
+
* @default false
|
|
1177
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_ENABLED
|
|
1178
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1179
|
+
*/
|
|
1180
|
+
enabled?: boolean
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Path to a custom probes configuration file.
|
|
1184
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_PROBE_FILE
|
|
1185
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1186
|
+
*/
|
|
1187
|
+
probeFile?: string
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Timeout in milliseconds for capturing variable values.
|
|
1191
|
+
* @default 15
|
|
1192
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS
|
|
1193
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1194
|
+
*/
|
|
1195
|
+
captureTimeoutMs?: number
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Interval in seconds between uploads of probe data.
|
|
1199
|
+
* @default 1
|
|
1200
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS
|
|
1201
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1202
|
+
*/
|
|
1203
|
+
uploadIntervalSeconds?: number
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* List of identifier names to redact in captured data.
|
|
1207
|
+
* These are added to the built-in default list, which always applies.
|
|
1208
|
+
* See {@link https://github.com/DataDog/dd-trace-js/blob/master/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js | redaction.js}
|
|
1209
|
+
* for the default identifiers.
|
|
1210
|
+
* To avoid redacting some of those built-in identifiers, use
|
|
1211
|
+
* {@link redactionExcludedIdentifiers}.
|
|
1212
|
+
* @default []
|
|
1213
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS
|
|
1214
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1215
|
+
*/
|
|
1216
|
+
redactedIdentifiers?: string[]
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* List of identifier names to exclude from redaction.
|
|
1220
|
+
* Use this to avoid redacting some of the built-in identifiers (see
|
|
1221
|
+
* {@link redactedIdentifiers}).
|
|
1222
|
+
* @default []
|
|
1223
|
+
* @env DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS
|
|
1224
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
1225
|
+
*/
|
|
1226
|
+
redactionExcludedIdentifiers?: string[]
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* User object that can be passed to `tracer.setUser()`.
|
|
1232
|
+
*/
|
|
1233
|
+
export interface User {
|
|
1234
|
+
/**
|
|
1235
|
+
* Unique identifier of the user.
|
|
1236
|
+
* Mandatory.
|
|
1237
|
+
*/
|
|
1238
|
+
id: string,
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Email of the user.
|
|
1242
|
+
*/
|
|
1243
|
+
email?: string,
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* User-friendly name of the user.
|
|
1247
|
+
*/
|
|
1248
|
+
name?: string,
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Session ID of the user.
|
|
1252
|
+
*/
|
|
1253
|
+
session_id?: string,
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Role the user is making the request under.
|
|
1257
|
+
*/
|
|
1258
|
+
role?: string,
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Scopes or granted authorizations the user currently possesses.
|
|
1262
|
+
* The value could come from the scope associated with an OAuth2
|
|
1263
|
+
* Access Token or an attribute value in a SAML 2 Assertion.
|
|
1264
|
+
*/
|
|
1265
|
+
scope?: string,
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Custom fields to attach to the user (RBAC, Oauth, etc...).
|
|
1269
|
+
*/
|
|
1270
|
+
[key: string]: string | undefined
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
export interface DogStatsD {
|
|
1274
|
+
/**
|
|
1275
|
+
* Increments a metric by the specified value, optionally specifying tags.
|
|
1276
|
+
* @param stat The dot-separated metric name.
|
|
1277
|
+
* @param value The amount to increment the stat by.
|
|
1278
|
+
* @param tags Tags to pass along, such as `{ foo: 'bar' }`. Values are combined with config.tags.
|
|
1279
|
+
*/
|
|
1280
|
+
increment(stat: string, value?: number, tags?: Record<string, string|number> | string[]): void
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Decrements a metric by the specified value, optionally specifying tags.
|
|
1284
|
+
* @param stat The dot-separated metric name.
|
|
1285
|
+
* @param value The amount to decrement the stat by.
|
|
1286
|
+
* @param tags Tags to pass along, such as `{ foo: 'bar' }`. Values are combined with config.tags.
|
|
1287
|
+
*/
|
|
1288
|
+
decrement(stat: string, value?: number, tags?: Record<string, string|number> | string[]): void
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Sets a distribution value, optionally specifying tags.
|
|
1292
|
+
* @param stat The dot-separated metric name.
|
|
1293
|
+
* @param value The amount to increment the stat by.
|
|
1294
|
+
* @param tags Tags to pass along, such as `{ foo: 'bar' }`. Values are combined with config.tags.
|
|
1295
|
+
*/
|
|
1296
|
+
distribution(stat: string, value?: number, tags?: Record<string, string|number> | string[]): void
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Sets a gauge value, optionally specifying tags.
|
|
1300
|
+
* @param stat The dot-separated metric name.
|
|
1301
|
+
* @param value The amount to increment the stat by.
|
|
1302
|
+
* @param tags Tags to pass along, such as `{ foo: 'bar' }`. Values are combined with config.tags.
|
|
1303
|
+
*/
|
|
1304
|
+
gauge(stat: string, value?: number, tags?: Record<string, string|number> | string[]): void
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Sets a histogram value, optionally specifying tags.
|
|
1308
|
+
* @param stat The dot-separated metric name.
|
|
1309
|
+
* @param value The amount to increment the stat by.
|
|
1310
|
+
* @param tags Tags to pass along, such as `{ foo: 'bar' }`. Values are combined with config.tags.
|
|
1311
|
+
*/
|
|
1312
|
+
histogram(stat: string, value?: number, tags?: Record<string, string|number> | string[]): void
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* Forces any unsent metrics to be sent
|
|
1316
|
+
*
|
|
1317
|
+
* @beta This method is experimental and could be removed in future versions.
|
|
1318
|
+
*/
|
|
1319
|
+
flush(): void
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Manual Data Streams Monitoring checkpointer API.
|
|
1324
|
+
*/
|
|
1325
|
+
export interface DataStreamsCheckpointer {
|
|
1326
|
+
/**
|
|
1327
|
+
* Sets a produce checkpoint and injects the DSM context into the provided carrier.
|
|
1328
|
+
* @param type The streaming technology (e.g., kafka, kinesis, sns).
|
|
1329
|
+
* @param target The target of data (topic, exchange, stream name).
|
|
1330
|
+
* @param carrier The carrier object to inject DSM context into.
|
|
1331
|
+
*/
|
|
1332
|
+
setProduceCheckpoint (type: string, target: string, carrier: any): void;
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Sets a consume checkpoint and extracts DSM context from the provided carrier.
|
|
1336
|
+
* @param type The streaming technology (e.g., kafka, kinesis, sns).
|
|
1337
|
+
* @param source The source of data (topic, exchange, stream name).
|
|
1338
|
+
* @param carrier The carrier object to extract DSM context from.
|
|
1339
|
+
* @param manualCheckpoint Whether this checkpoint was manually set. Defaults to true.
|
|
1340
|
+
* @returns The DSM context associated with the current pathway.
|
|
1341
|
+
*/
|
|
1342
|
+
setConsumeCheckpoint (type: string, source: string, carrier: any, manualCheckpoint?: boolean): any;
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Records a transaction ID at a named checkpoint without pathway propagation.
|
|
1346
|
+
* Tags the active span (or the provided span) with dsm.transaction.id and dsm.transaction.checkpoint.
|
|
1347
|
+
* @param transactionId The unique transaction identifier (truncated to 255 UTF-8 bytes).
|
|
1348
|
+
* @param checkpointName The logical checkpoint name (stable 1-byte ID per process lifetime).
|
|
1349
|
+
* @param span The span to tag. Defaults to the currently active span.
|
|
1350
|
+
*/
|
|
1351
|
+
trackTransaction(transactionId: string, checkpointName: string, span?: Span | null): void;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
export interface EventTrackingV2 {
|
|
1355
|
+
/**
|
|
1356
|
+
* Links a successful login event to the current trace. Will link the passed user to the current trace with Appsec.setUser() internally.
|
|
1357
|
+
* @param {string} login The login key (username, email...) used by the user to authenticate.
|
|
1358
|
+
* @param {User} user Properties of the authenticated user. Accepts custom fields. Can be null.
|
|
1359
|
+
* @param {any} metadata Custom fields to link to the login success event.
|
|
1360
|
+
*/
|
|
1361
|
+
trackUserLoginSuccess(login: string, user?: User | null, metadata?: any): void;
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Links a successful login event to the current trace. Will link the passed user to the current trace with Appsec.setUser() internally.
|
|
1365
|
+
* @param {string} login The login key (username, email...) used by the user to authenticate.
|
|
1366
|
+
* @param {string} userId Identifier of the authenticated user.
|
|
1367
|
+
* @param {any} metadata Custom fields to link to the login success event.
|
|
1368
|
+
*/
|
|
1369
|
+
trackUserLoginSuccess(login: string, userId: string, metadata?: any): void;
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* Links a failed login event to the current trace.
|
|
1373
|
+
* @param {string} login The login key (username, email...) used by the user to authenticate.
|
|
1374
|
+
* @param {boolean} exists If the user exists.
|
|
1375
|
+
* @param {any} metadata Custom fields to link to the login failure event.
|
|
1376
|
+
*/
|
|
1377
|
+
trackUserLoginFailure(login: string, exists: boolean, metadata?: any): void;
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Links a failed login event to the current trace.
|
|
1381
|
+
* @param {string} login The login key (username, email...) used by the user to authenticate.
|
|
1382
|
+
* @param {any} metadata Custom fields to link to the login failure event.
|
|
1383
|
+
*/
|
|
1384
|
+
trackUserLoginFailure(login: string, metadata?: any): void;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export interface Appsec {
|
|
1388
|
+
/**
|
|
1389
|
+
* Links a successful login event to the current trace. Will link the passed user to the current trace with Appsec.setUser() internally.
|
|
1390
|
+
* @param {User} user Properties of the authenticated user. Accepts custom fields.
|
|
1391
|
+
* @param {[key: string]: string} metadata Custom fields to link to the login success event.
|
|
1392
|
+
*
|
|
1393
|
+
* @beta This method is in beta and could change in future versions.
|
|
1394
|
+
*
|
|
1395
|
+
* @deprecated In favor of eventTrackingV2.trackUserLoginSuccess
|
|
1396
|
+
*/
|
|
1397
|
+
trackUserLoginSuccessEvent(user: User, metadata?: { [key: string]: string }): void
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Links a failed login event to the current trace.
|
|
1401
|
+
* @param {string} userId The user id of the attempted login.
|
|
1402
|
+
* @param {boolean} exists If the user id exists.
|
|
1403
|
+
* @param {[key: string]: string} metadata Custom fields to link to the login failure event.
|
|
1404
|
+
*
|
|
1405
|
+
* @beta This method is in beta and could change in future versions.
|
|
1406
|
+
*
|
|
1407
|
+
* @deprecated In favor of eventTrackingV2.trackUserLoginFailure
|
|
1408
|
+
*/
|
|
1409
|
+
trackUserLoginFailureEvent(userId: string, exists: boolean, metadata?: { [key: string]: string }): void
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Links a custom event to the current trace.
|
|
1413
|
+
* @param {string} eventName The name of the event.
|
|
1414
|
+
* @param {[key: string]: string} metadata Custom fields to link to the event.
|
|
1415
|
+
*
|
|
1416
|
+
* @beta This method is in beta and could change in future versions.
|
|
1417
|
+
*/
|
|
1418
|
+
trackCustomEvent(eventName: string, metadata?: { [key: string]: string }): void
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* Checks if the passed user should be blocked according to AppSec rules.
|
|
1422
|
+
* If no user is linked to the current trace, will link the passed user to it.
|
|
1423
|
+
* @param {User} user Properties of the authenticated user. Accepts custom fields.
|
|
1424
|
+
* @return {boolean} Indicates whether the user should be blocked.
|
|
1425
|
+
*
|
|
1426
|
+
* @beta This method is in beta and could change in the future
|
|
1427
|
+
*/
|
|
1428
|
+
isUserBlocked(user: User): boolean
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Sends a "blocked" template response based on the request accept header and ends the response.
|
|
1432
|
+
* **You should stop processing the request after calling this function!**
|
|
1433
|
+
* @param {IncomingMessage} req Can be passed to force which request to act on. Optional.
|
|
1434
|
+
* @param {OutgoingMessage} res Can be passed to force which response to act on. Optional.
|
|
1435
|
+
* @return {boolean} Indicates if the action was successful.
|
|
1436
|
+
*
|
|
1437
|
+
* @beta This method is in beta and could change in the future
|
|
1438
|
+
*/
|
|
1439
|
+
blockRequest(req?: IncomingMessage, res?: OutgoingMessage): boolean
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Links an authenticated user to the current trace.
|
|
1443
|
+
* @param {User} user Properties of the authenticated user. Accepts custom fields.
|
|
1444
|
+
*
|
|
1445
|
+
* @beta This method is in beta and could change in the future
|
|
1446
|
+
*/
|
|
1447
|
+
setUser(user: User): void
|
|
1448
|
+
|
|
1449
|
+
eventTrackingV2: EventTrackingV2
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* Flagging Provider (OpenFeature-compatible).
|
|
1454
|
+
*
|
|
1455
|
+
* Wraps @datadog/openfeature-node-server with Remote Config integration for dynamic flag configuration.
|
|
1456
|
+
* Implements the OpenFeature Provider interface for flag evaluation.
|
|
1457
|
+
*
|
|
1458
|
+
* @beta This feature is in preview and not ready for production use
|
|
1459
|
+
*/
|
|
1460
|
+
export interface OpenFeatureProvider {
|
|
1461
|
+
/**
|
|
1462
|
+
* Metadata about this provider.
|
|
1463
|
+
*/
|
|
1464
|
+
metadata: { name: string; [key: string]: any };
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Resolves a boolean flag value.
|
|
1468
|
+
*
|
|
1469
|
+
* @param flagKey The key of the flag to evaluate
|
|
1470
|
+
* @param defaultValue The default value to return if evaluation fails
|
|
1471
|
+
* @param context Evaluation context (e.g., user attributes)
|
|
1472
|
+
* @param logger Optional logger instance
|
|
1473
|
+
* @returns Promise resolving to evaluation result with value and reason
|
|
1474
|
+
*/
|
|
1475
|
+
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: object, logger: object): Promise<{ value: boolean; reason?: string; [key: string]: any }>;
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Resolves a string flag value.
|
|
1479
|
+
*
|
|
1480
|
+
* @param flagKey The key of the flag to evaluate
|
|
1481
|
+
* @param defaultValue The default value to return if evaluation fails
|
|
1482
|
+
* @param context Evaluation context (e.g., user attributes)
|
|
1483
|
+
* @param logger Optional logger instance
|
|
1484
|
+
* @returns Promise resolving to evaluation result with value and reason
|
|
1485
|
+
*/
|
|
1486
|
+
resolveStringEvaluation(flagKey: string, defaultValue: string, context: object, logger: object): Promise<{ value: string; reason?: string; [key: string]: any }>;
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Resolves a number flag value.
|
|
1490
|
+
*
|
|
1491
|
+
* @param flagKey The key of the flag to evaluate
|
|
1492
|
+
* @param defaultValue The default value to return if evaluation fails
|
|
1493
|
+
* @param context Evaluation context (e.g., user attributes)
|
|
1494
|
+
* @param logger Optional logger instance
|
|
1495
|
+
* @returns Promise resolving to evaluation result with value and reason
|
|
1496
|
+
*/
|
|
1497
|
+
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: object, logger: object): Promise<{ value: number; reason?: string; [key: string]: any }>;
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Resolves an object flag value.
|
|
1501
|
+
*
|
|
1502
|
+
* @param flagKey The key of the flag to evaluate
|
|
1503
|
+
* @param defaultValue The default value to return if evaluation fails
|
|
1504
|
+
* @param context Evaluation context (e.g., user attributes)
|
|
1505
|
+
* @param logger Optional logger instance
|
|
1506
|
+
* @returns Promise resolving to evaluation result with value and reason
|
|
1507
|
+
*/
|
|
1508
|
+
resolveObjectEvaluation<T = any>(flagKey: string, defaultValue: T, context: object, logger: object): Promise<{ value: T; reason?: string; [key: string]: any }>;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
export namespace aiguard {
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Represents a tool call made by an AI assistant in an agentic workflow.
|
|
1515
|
+
*/
|
|
1516
|
+
export interface ToolCall {
|
|
1517
|
+
/**
|
|
1518
|
+
* Unique identifier for this specific tool call instance used to correlate the call with its response.
|
|
1519
|
+
*/
|
|
1520
|
+
id: string;
|
|
1521
|
+
/**
|
|
1522
|
+
* Details about the function being invoked.
|
|
1523
|
+
*/
|
|
1524
|
+
function: {
|
|
1525
|
+
/**
|
|
1526
|
+
* The name of the tool/function to be called.
|
|
1527
|
+
*/
|
|
1528
|
+
name: string;
|
|
1529
|
+
/**
|
|
1530
|
+
* String containing the arguments to pass to the tool.
|
|
1531
|
+
*/
|
|
1532
|
+
arguments: string;
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* A standard conversational message exchanged with a Large Language Model (LLM).
|
|
1538
|
+
*/
|
|
1539
|
+
export interface TextMessage {
|
|
1540
|
+
/**
|
|
1541
|
+
* The role of the message sender in the conversation (e.g.: 'system', 'user', 'assistant').
|
|
1542
|
+
*/
|
|
1543
|
+
role: string;
|
|
1544
|
+
/**
|
|
1545
|
+
* The textual content of the message.
|
|
1546
|
+
*/
|
|
1547
|
+
content: string;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* A message from an AI assistant containing only textual content.
|
|
1552
|
+
*/
|
|
1553
|
+
export interface AssistantTextMessage {
|
|
1554
|
+
/**
|
|
1555
|
+
* The role identifier, always set to 'assistant'
|
|
1556
|
+
*/
|
|
1557
|
+
role: "assistant";
|
|
1558
|
+
/**
|
|
1559
|
+
* The textual response content from the assistant.
|
|
1560
|
+
*/
|
|
1561
|
+
content: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* Explicitly excluded when content is present to maintain type safety.
|
|
1564
|
+
*/
|
|
1565
|
+
tool_calls?: never;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/**
|
|
1569
|
+
* A message from an AI assistant that initiates one or more tool calls.
|
|
1570
|
+
*/
|
|
1571
|
+
export interface AssistantToolCallMessage {
|
|
1572
|
+
/**
|
|
1573
|
+
* The role identifier, always set to 'assistant'
|
|
1574
|
+
*/
|
|
1575
|
+
role: "assistant";
|
|
1576
|
+
/**
|
|
1577
|
+
* Array of tool calls that the assistant wants to execute.
|
|
1578
|
+
*/
|
|
1579
|
+
tool_calls: ToolCall[];
|
|
1580
|
+
/**
|
|
1581
|
+
* Explicitly excluded when tool calls are present to maintain type safety.
|
|
1582
|
+
*/
|
|
1583
|
+
content?: never;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* A message containing the result of a tool invocation.
|
|
1588
|
+
*/
|
|
1589
|
+
export interface ToolMessage {
|
|
1590
|
+
/**
|
|
1591
|
+
* The role identifier, always set to 'tool' for tool execution results.
|
|
1592
|
+
*/
|
|
1593
|
+
role: "tool";
|
|
1594
|
+
/**
|
|
1595
|
+
* The unique identifier linking this result to the original tool call.
|
|
1596
|
+
* Must correspond to a ToolCall.id from a previous AssistantToolCallMessage.
|
|
1597
|
+
*/
|
|
1598
|
+
tool_call_id: string;
|
|
1599
|
+
/**
|
|
1600
|
+
* The output returned by the tool execution.
|
|
1601
|
+
*/
|
|
1602
|
+
content: string;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
export type Message =
|
|
1606
|
+
| TextMessage
|
|
1607
|
+
| AssistantTextMessage
|
|
1608
|
+
| AssistantToolCallMessage
|
|
1609
|
+
| ToolMessage;
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* The result returned by AI Guard after evaluating a conversation.
|
|
1613
|
+
*/
|
|
1614
|
+
export interface Evaluation {
|
|
1615
|
+
/**
|
|
1616
|
+
* The security action determined by AI Guard:
|
|
1617
|
+
* - 'ALLOW': The conversation is safe to proceed
|
|
1618
|
+
* - 'DENY': The current conversation exchange should be blocked
|
|
1619
|
+
* - 'ABORT': The full workflow should be terminated immediately
|
|
1620
|
+
*/
|
|
1621
|
+
action: 'ALLOW' | 'DENY' | 'ABORT';
|
|
1622
|
+
/**
|
|
1623
|
+
* Human-readable explanation for why this action was chosen.
|
|
1624
|
+
*/
|
|
1625
|
+
reason: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* List of tags associated with the evaluation (e.g. indirect-prompt-injection)
|
|
1628
|
+
*/
|
|
1629
|
+
tags: string[];
|
|
1630
|
+
/**
|
|
1631
|
+
* Sensitive Data Scanner findings from the evaluation.
|
|
1632
|
+
*/
|
|
1633
|
+
sds: Object[];
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* Error thrown when AI Guard evaluation determines that a conversation should be blocked
|
|
1638
|
+
* and the client is configured to enforce blocking mode.
|
|
1639
|
+
*/
|
|
1640
|
+
export interface AIGuardAbortError extends Error {
|
|
1641
|
+
/**
|
|
1642
|
+
* Human-readable explanation from AI Guard describing why the conversation was blocked.
|
|
1643
|
+
*/
|
|
1644
|
+
reason: string;
|
|
1645
|
+
/**
|
|
1646
|
+
* List of tags associated with the evaluation (e.g. indirect-prompt-injection)
|
|
1647
|
+
*/
|
|
1648
|
+
tags: string[];
|
|
1649
|
+
/**
|
|
1650
|
+
* Sensitive Data Scanner findings from the evaluation.
|
|
1651
|
+
*/
|
|
1652
|
+
sds: Object[];
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* Error thrown when the AI Guard SDK encounters communication failures or API errors while attempting to
|
|
1657
|
+
* evaluate conversations.
|
|
1658
|
+
*/
|
|
1659
|
+
export interface AIGuardClientError extends Error {
|
|
1660
|
+
/**
|
|
1661
|
+
* Detailed error information returned by the AI Guard API, formatted according to the JSON:API error
|
|
1662
|
+
* specification.
|
|
1663
|
+
*/
|
|
1664
|
+
errors?: unknown[];
|
|
1665
|
+
/**
|
|
1666
|
+
* The underlying error that caused the communication failure, such as network timeouts, connection refused,
|
|
1667
|
+
* or JSON parsing errors.
|
|
1668
|
+
*/
|
|
1669
|
+
cause?: Error;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* AI Guard security client for evaluating AI conversations.
|
|
1674
|
+
*/
|
|
1675
|
+
export interface AIGuard {
|
|
1676
|
+
/**
|
|
1677
|
+
* Evaluates a conversation thread.
|
|
1678
|
+
*
|
|
1679
|
+
* @param messages - Array of conversation messages
|
|
1680
|
+
* @param opts - Optional configuration object:
|
|
1681
|
+
* - `block`: When true, throws an exception if evaluation result is not 'ALLOW'
|
|
1682
|
+
* and the AI Guard service has blocking mode enabled (default: false).
|
|
1683
|
+
* @returns Promise resolving to an Evaluation with the security decision and reasoning.
|
|
1684
|
+
* The promise rejects with AIGuardAbortError when `opts.block` is true and the evaluation result would block the request.
|
|
1685
|
+
* The promise rejects with AIGuardClientError when communication with the AI Guard service fails.
|
|
1686
|
+
*/
|
|
1687
|
+
evaluate (messages: Message[], opts?: { block?: boolean }): Promise<Evaluation>;
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/** @hidden */
|
|
1692
|
+
type anyObject = {
|
|
1693
|
+
[key: string]: any;
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
/** @hidden */
|
|
1697
|
+
interface TransportRequestParams {
|
|
1698
|
+
method: string;
|
|
1699
|
+
path: string;
|
|
1700
|
+
body?: anyObject;
|
|
1701
|
+
bulkBody?: anyObject;
|
|
1702
|
+
querystring?: anyObject;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* The Datadog Scope Manager. This is used for context propagation.
|
|
1707
|
+
*/
|
|
1708
|
+
export interface Scope {
|
|
1709
|
+
/**
|
|
1710
|
+
* Get the current active span or null if there is none.
|
|
1711
|
+
*
|
|
1712
|
+
* @returns {Span} The active span.
|
|
1713
|
+
*/
|
|
1714
|
+
active (): Span | null;
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* Activate a span in the scope of a function.
|
|
1718
|
+
*
|
|
1719
|
+
* @param {Span} span The span to activate.
|
|
1720
|
+
* @param {Function} fn Function that will have the span activated on its scope.
|
|
1721
|
+
* @returns The return value of the provided function.
|
|
1722
|
+
*/
|
|
1723
|
+
activate<T> (span: Span, fn: ((...args: any[]) => T)): T;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* Binds a target to the provided span, or the active span if omitted.
|
|
1727
|
+
*
|
|
1728
|
+
* @param {Function|Promise} fn Target that will have the span activated on its scope.
|
|
1729
|
+
* @param {Span} [span=scope.active()] The span to activate.
|
|
1730
|
+
* @returns The bound target.
|
|
1731
|
+
*/
|
|
1732
|
+
bind<T extends (...args: any[]) => void> (fn: T, span?: Span | null): T;
|
|
1733
|
+
bind<V, T extends (...args: any[]) => V> (fn: T, span?: Span | null): T;
|
|
1734
|
+
bind<T> (fn: Promise<T>, span?: Span | null): Promise<T>;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/** @hidden */
|
|
1738
|
+
interface Analyzable {
|
|
1739
|
+
/**
|
|
1740
|
+
* Whether to measure the span. Can also be set to a key-value pair with span
|
|
1741
|
+
* names as keys and booleans as values for more granular control.
|
|
1742
|
+
*/
|
|
1743
|
+
measured?: boolean | { [key: string]: boolean };
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
export namespace plugins {
|
|
1747
|
+
/** @hidden */
|
|
1748
|
+
interface Integration {
|
|
1749
|
+
/**
|
|
1750
|
+
* The service name to be used for this plugin.
|
|
1751
|
+
*/
|
|
1752
|
+
service?: string | any;
|
|
1753
|
+
|
|
1754
|
+
/** Whether to enable the plugin.
|
|
1755
|
+
* @default true
|
|
1756
|
+
*/
|
|
1757
|
+
enabled?: boolean;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/** @hidden */
|
|
1761
|
+
interface Instrumentation extends Integration, Analyzable {}
|
|
1762
|
+
|
|
1763
|
+
/** @hidden */
|
|
1764
|
+
interface Http extends Instrumentation {
|
|
1765
|
+
/**
|
|
1766
|
+
* List of URLs/paths that should be instrumented.
|
|
1767
|
+
*
|
|
1768
|
+
* Note that when used for an http client the entry represents a full
|
|
1769
|
+
* outbound URL (`https://example.org/api/foo`) but when used as a
|
|
1770
|
+
* server the entry represents an inbound path (`/api/foo`).
|
|
1771
|
+
*
|
|
1772
|
+
* @default /^.*$/
|
|
1773
|
+
*/
|
|
1774
|
+
allowlist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* Deprecated in favor of `allowlist`.
|
|
1778
|
+
*
|
|
1779
|
+
* @deprecated
|
|
1780
|
+
* @hidden
|
|
1781
|
+
*/
|
|
1782
|
+
whitelist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* List of URLs/paths that should not be instrumented. Takes precedence over
|
|
1786
|
+
* allowlist if a URL matches an entry in both.
|
|
1787
|
+
*
|
|
1788
|
+
* Note that when used for an http client the entry represents a full
|
|
1789
|
+
* outbound URL (`https://example.org/api/foo`) but when used as a
|
|
1790
|
+
* server the entry represents an inbound path (`/api/foo`).
|
|
1791
|
+
*
|
|
1792
|
+
* @default []
|
|
1793
|
+
*/
|
|
1794
|
+
blocklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Deprecated in favor of `blocklist`.
|
|
1798
|
+
*
|
|
1799
|
+
* @deprecated
|
|
1800
|
+
* @hidden
|
|
1801
|
+
*/
|
|
1802
|
+
blacklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Custom filter function used to decide whether a URL/path is allowed.
|
|
1806
|
+
* When provided, this takes precedence over allowlist/blocklist configuration.
|
|
1807
|
+
* If not provided, allowlist/blocklist logic will be used instead.
|
|
1808
|
+
*
|
|
1809
|
+
* @param urlOrPath - The URL or path to filter
|
|
1810
|
+
* @returns true to instrument the request, false to skip it
|
|
1811
|
+
*/
|
|
1812
|
+
filter?: (urlOrPath: string) => boolean;
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* An array of headers to include in the span metadata.
|
|
1816
|
+
*
|
|
1817
|
+
* @default []
|
|
1818
|
+
*/
|
|
1819
|
+
headers?: string[];
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Callback function to determine if there was an error. It should take a
|
|
1823
|
+
* status code as its only parameter and return `true` for success or `false`
|
|
1824
|
+
* for errors.
|
|
1825
|
+
*
|
|
1826
|
+
* @default code => code < 500
|
|
1827
|
+
*/
|
|
1828
|
+
validateStatus?: (code: number) => boolean;
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* Enable injection of tracing headers into requests signed with AWS IAM headers.
|
|
1832
|
+
* Disable this if you get AWS signature errors (HTTP 403).
|
|
1833
|
+
*
|
|
1834
|
+
* @default false
|
|
1835
|
+
*/
|
|
1836
|
+
enablePropagationWithAmazonHeaders?: boolean;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
/** @hidden */
|
|
1840
|
+
interface HttpServer extends Http {
|
|
1841
|
+
/**
|
|
1842
|
+
* Callback function to determine if there was an error. It should take a
|
|
1843
|
+
* status code as its only parameter and return `true` for success or `false`
|
|
1844
|
+
* for errors.
|
|
1845
|
+
*
|
|
1846
|
+
* @default code => code < 500
|
|
1847
|
+
*/
|
|
1848
|
+
validateStatus?: (code: number) => boolean;
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Hooks to run before spans are finished.
|
|
1852
|
+
*/
|
|
1853
|
+
hooks?: {
|
|
1854
|
+
/**
|
|
1855
|
+
* Hook to execute just before the request span finishes.
|
|
1856
|
+
*/
|
|
1857
|
+
request?: (span?: Span, req?: IncomingMessage, res?: ServerResponse) => any;
|
|
1858
|
+
};
|
|
1859
|
+
|
|
1860
|
+
/**
|
|
1861
|
+
* Whether to enable instrumentation of <plugin>.middleware spans
|
|
1862
|
+
*
|
|
1863
|
+
* @default true
|
|
1864
|
+
*/
|
|
1865
|
+
middleware?: boolean;
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* Whether (or how) to obfuscate querystring values in `http.url`.
|
|
1869
|
+
*
|
|
1870
|
+
* - `true`: obfuscate all values
|
|
1871
|
+
* - `false`: disable obfuscation
|
|
1872
|
+
* - `string`: regex string used to obfuscate matching values (empty string disables)
|
|
1873
|
+
* - `RegExp`: regex used to obfuscate matching values
|
|
1874
|
+
*/
|
|
1875
|
+
queryStringObfuscation?: boolean | string | RegExp;
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* Whether to enable resource renaming when the framework route is unavailable.
|
|
1879
|
+
*/
|
|
1880
|
+
resourceRenamingEnabled?: boolean;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
/** @hidden */
|
|
1884
|
+
interface HttpClient extends Http {
|
|
1885
|
+
/**
|
|
1886
|
+
* Use the remote endpoint host as the service name instead of the default.
|
|
1887
|
+
*
|
|
1888
|
+
* @default false
|
|
1889
|
+
*/
|
|
1890
|
+
splitByDomain?: boolean;
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* Callback function to determine if there was an error. It should take a
|
|
1894
|
+
* status code as its only parameter and return `true` for success or `false`
|
|
1895
|
+
* for errors.
|
|
1896
|
+
*
|
|
1897
|
+
* @default code => code < 400 || code >= 500
|
|
1898
|
+
*/
|
|
1899
|
+
validateStatus?: (code: number) => boolean;
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* Hooks to run before spans are finished.
|
|
1903
|
+
*/
|
|
1904
|
+
hooks?: {
|
|
1905
|
+
/**
|
|
1906
|
+
* Hook to execute just before the request span finishes.
|
|
1907
|
+
*/
|
|
1908
|
+
request?: (span?: Span, req?: ClientRequest, res?: IncomingMessage) => any;
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* List of urls to which propagation headers should not be injected
|
|
1913
|
+
*/
|
|
1914
|
+
propagationBlocklist?: string | RegExp | ((url: string) => boolean) | (string | RegExp | ((url: string) => boolean))[];
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
/** @hidden */
|
|
1918
|
+
interface Http2Client extends Http {
|
|
1919
|
+
/**
|
|
1920
|
+
* Use the remote endpoint host as the service name instead of the default.
|
|
1921
|
+
*
|
|
1922
|
+
* @default false
|
|
1923
|
+
*/
|
|
1924
|
+
splitByDomain?: boolean;
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Callback function to determine if there was an error. It should take a
|
|
1928
|
+
* status code as its only parameter and return `true` for success or `false`
|
|
1929
|
+
* for errors.
|
|
1930
|
+
*
|
|
1931
|
+
* @default code => code < 400 || code >= 500
|
|
1932
|
+
*/
|
|
1933
|
+
validateStatus?: (code: number) => boolean;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/** @hidden */
|
|
1937
|
+
interface Http2Server extends Http {
|
|
1938
|
+
/**
|
|
1939
|
+
* Callback function to determine if there was an error. It should take a
|
|
1940
|
+
* status code as its only parameter and return `true` for success or `false`
|
|
1941
|
+
* for errors.
|
|
1942
|
+
*
|
|
1943
|
+
* @default code => code < 500
|
|
1944
|
+
*/
|
|
1945
|
+
validateStatus?: (code: number) => boolean;
|
|
1946
|
+
/**
|
|
1947
|
+
* Whether (or how) to obfuscate querystring values in `http.url`.
|
|
1948
|
+
*
|
|
1949
|
+
* - `true`: obfuscate all values
|
|
1950
|
+
* - `false`: disable obfuscation
|
|
1951
|
+
* - `string`: regex string used to obfuscate matching values (empty string disables)
|
|
1952
|
+
* - `RegExp`: regex used to obfuscate matching values
|
|
1953
|
+
*/
|
|
1954
|
+
queryStringObfuscation?: boolean | string | RegExp;
|
|
1955
|
+
|
|
1956
|
+
/**
|
|
1957
|
+
* Whether to enable resource renaming when the framework route is unavailable.
|
|
1958
|
+
*/
|
|
1959
|
+
resourceRenamingEnabled?: boolean;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
/** @hidden */
|
|
1963
|
+
interface Grpc extends Instrumentation {
|
|
1964
|
+
/**
|
|
1965
|
+
* An array of metadata entries to record. Can also be a callback that returns
|
|
1966
|
+
* the key/value pairs to record. For example, using
|
|
1967
|
+
* `variables => variables` would record all variables.
|
|
1968
|
+
*/
|
|
1969
|
+
metadata?: string[] | ((variables: { [key: string]: any }) => { [key: string]: any });
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/** @hidden */
|
|
1973
|
+
interface Moleculer extends Instrumentation {
|
|
1974
|
+
/**
|
|
1975
|
+
* Whether to include context meta as tags.
|
|
1976
|
+
*
|
|
1977
|
+
* @default false
|
|
1978
|
+
*/
|
|
1979
|
+
meta?: boolean;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
/** @hidden */
|
|
1983
|
+
interface Prisma extends Instrumentation {}
|
|
1984
|
+
|
|
1985
|
+
/** @hidden */
|
|
1986
|
+
interface PrismaClient extends Prisma {}
|
|
1987
|
+
|
|
1988
|
+
/** @hidden */
|
|
1989
|
+
interface PrismaEngine extends Prisma {}
|
|
1990
|
+
|
|
1991
|
+
/**
|
|
1992
|
+
* This plugin automatically instruments the
|
|
1993
|
+
* [aerospike](https://github.com/aerospike/aerospike-client-nodejs) for module versions >= v3.16.2.
|
|
1994
|
+
*/
|
|
1995
|
+
interface aerospike extends Instrumentation {}
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* This plugin automatically instruments the
|
|
1999
|
+
* [Vercel AI SDK](https://ai-sdk.dev/docs/introduction) module.
|
|
2000
|
+
*/
|
|
2001
|
+
interface ai extends Instrumentation {}
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* This plugin automatically instruments the
|
|
2005
|
+
* [amqp10](https://github.com/noodlefrenzy/node-amqp10) module.
|
|
2006
|
+
*/
|
|
2007
|
+
interface amqp10 extends Instrumentation {}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* This plugin automatically instruments the
|
|
2011
|
+
* [amqplib](https://github.com/squaremo/amqp.node) module.
|
|
2012
|
+
*/
|
|
2013
|
+
interface amqplib extends Instrumentation {}
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* This plugin automatically instruments the
|
|
2017
|
+
* [anthropic](https://www.npmjs.com/package/@anthropic-ai/sdk) module.
|
|
2018
|
+
*/
|
|
2019
|
+
interface anthropic extends Instrumentation {}
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* Currently this plugin automatically instruments
|
|
2023
|
+
* [@apollo/gateway](https://github.com/apollographql/federation) for module versions >= v2.3.0.
|
|
2024
|
+
* This module uses graphql operations to service requests & thus generates graphql spans.
|
|
2025
|
+
* We recommend disabling the graphql plugin if you only want to trace @apollo/gateway
|
|
2026
|
+
*/
|
|
2027
|
+
interface apollo extends Instrumentation {
|
|
2028
|
+
/**
|
|
2029
|
+
* Whether to include the source of the operation within the query as a tag
|
|
2030
|
+
* on every span. This may contain sensitive information and should only be
|
|
2031
|
+
* enabled if sensitive data is always sent as variables and not in the
|
|
2032
|
+
* query text.
|
|
2033
|
+
*
|
|
2034
|
+
* @default false
|
|
2035
|
+
*/
|
|
2036
|
+
source?: boolean;
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* Whether to enable signature calculation for the resource name. This can
|
|
2040
|
+
* be disabled if your apollo/gateway operations always have a name. Note that when
|
|
2041
|
+
* disabled all queries will need to be named for this to work properly.
|
|
2042
|
+
*
|
|
2043
|
+
* @default true
|
|
2044
|
+
*/
|
|
2045
|
+
signature?: boolean;
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* An object of optional callbacks to be executed during the respective
|
|
2049
|
+
* phase of an Apollo Gateway operation. Undefined callbacks default to a
|
|
2050
|
+
* noop function.
|
|
2051
|
+
*
|
|
2052
|
+
* @default {}
|
|
2053
|
+
*/
|
|
2054
|
+
hooks?: {
|
|
2055
|
+
request?: (span?: Span, ctx?: any) => void;
|
|
2056
|
+
validate?: (span?: Span, ctx?: any) => void;
|
|
2057
|
+
plan?: (span?: Span, ctx?: any) => void;
|
|
2058
|
+
execute?: (span?: Span, ctx?: any) => void;
|
|
2059
|
+
fetch?: (span?: Span, ctx?: any) => void;
|
|
2060
|
+
postprocessing?: (span?: Span, ctx?: any) => void;
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* This plugin automatically patches the [avsc](https://github.com/mtth/avsc) module
|
|
2066
|
+
* to collect avro message schemas when Datastreams Monitoring is enabled.
|
|
2067
|
+
*/
|
|
2068
|
+
interface avsc extends Integration {}
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* This plugin automatically instruments the
|
|
2072
|
+
* [aws-sdk](https://github.com/aws/aws-sdk-js) module.
|
|
2073
|
+
*/
|
|
2074
|
+
interface aws_sdk extends Instrumentation {
|
|
2075
|
+
/**
|
|
2076
|
+
* Whether to inject all messages during batch AWS SQS, Kinesis, and SNS send operations. Normal
|
|
2077
|
+
* behavior is to inject the first message in batch send operations.
|
|
2078
|
+
* @default false
|
|
2079
|
+
*/
|
|
2080
|
+
batchPropagationEnabled?: boolean;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Hooks to run before spans are finished.
|
|
2084
|
+
*/
|
|
2085
|
+
hooks?: {
|
|
2086
|
+
/**
|
|
2087
|
+
* Hook to execute just before the aws span finishes.
|
|
2088
|
+
*/
|
|
2089
|
+
request?: (span?: Span, response?: anyObject) => any;
|
|
2090
|
+
};
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Configuration for individual services to enable/disable them. Message
|
|
2094
|
+
* queue services can also configure the producer and consumer individually
|
|
2095
|
+
* by passing an object with a `producer` and `consumer` properties. The
|
|
2096
|
+
* list of valid service keys is in the service-specific section of
|
|
2097
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html
|
|
2098
|
+
*/
|
|
2099
|
+
[key: string]: boolean | Object | undefined;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
/**
|
|
2103
|
+
* This plugin automatically instruments the
|
|
2104
|
+
* @azure/event-hubs module
|
|
2105
|
+
*/
|
|
2106
|
+
interface azure_event_hubs extends Integration {}
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* This plugin automatically instruments the
|
|
2110
|
+
* @azure/functions module.
|
|
2111
|
+
*/
|
|
2112
|
+
interface azure_functions extends Instrumentation {
|
|
2113
|
+
/**
|
|
2114
|
+
* Whether to enable resource renaming when the framework route is unavailable.
|
|
2115
|
+
*/
|
|
2116
|
+
resourceRenamingEnabled?: boolean;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
/**
|
|
2120
|
+
* This plugin automatically instruments the
|
|
2121
|
+
* @azure/service-bus module
|
|
2122
|
+
*/
|
|
2123
|
+
interface azure_service_bus extends Integration {}
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* This plugin automatically instruments the
|
|
2127
|
+
* durable-functions module
|
|
2128
|
+
*/
|
|
2129
|
+
interface azure_durable_functions extends Integration {}
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* This plugin patches the [bunyan](https://github.com/trentm/node-bunyan)
|
|
2133
|
+
* to automatically inject trace identifiers in log records when the
|
|
2134
|
+
* [logInjection](interfaces/traceroptions.html#logInjection) option is enabled
|
|
2135
|
+
* on the tracer.
|
|
2136
|
+
*/
|
|
2137
|
+
/**
|
|
2138
|
+
* This plugin automatically instruments the
|
|
2139
|
+
* [bullmq](https://github.com/npmjs/package/bullmq) message queue library.
|
|
2140
|
+
*/
|
|
2141
|
+
interface bullmq extends Instrumentation {}
|
|
2142
|
+
|
|
2143
|
+
interface bunyan extends Integration {}
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* This plugin automatically instruments the
|
|
2147
|
+
* [cassandra-driver](https://github.com/datastax/nodejs-driver) module.
|
|
2148
|
+
*/
|
|
2149
|
+
interface cassandra_driver extends Instrumentation {}
|
|
2150
|
+
|
|
2151
|
+
/**
|
|
2152
|
+
* This plugin automatically instruments the
|
|
2153
|
+
* [child_process](https://nodejs.org/api/child_process.html) module.
|
|
2154
|
+
*/
|
|
2155
|
+
interface child_process extends Instrumentation {}
|
|
2156
|
+
|
|
2157
|
+
/**
|
|
2158
|
+
* This plugin automatically instruments the
|
|
2159
|
+
* [confluentinc-kafka-javascript](https://github.com/confluentinc/confluent-kafka-js) module.
|
|
2160
|
+
*/
|
|
2161
|
+
interface confluentinc_kafka_javascript extends Instrumentation {}
|
|
2162
|
+
|
|
2163
|
+
/**
|
|
2164
|
+
* This plugin automatically instruments the
|
|
2165
|
+
* [connect](https://github.com/senchalabs/connect) module.
|
|
2166
|
+
*/
|
|
2167
|
+
interface connect extends HttpServer {}
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* This plugin automatically instruments the
|
|
2171
|
+
* [couchbase](https://www.npmjs.com/package/couchbase) module.
|
|
2172
|
+
*/
|
|
2173
|
+
interface couchbase extends Instrumentation {}
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* This plugin automatically instruments the
|
|
2177
|
+
* [cucumber](https://www.npmjs.com/package/@cucumber/cucumber) module.
|
|
2178
|
+
*/
|
|
2179
|
+
interface cucumber extends Integration {}
|
|
2180
|
+
|
|
2181
|
+
/**
|
|
2182
|
+
* This plugin automatically instruments the
|
|
2183
|
+
* [cypress](https://github.com/cypress-io/cypress) module.
|
|
2184
|
+
*/
|
|
2185
|
+
interface cypress extends Integration {}
|
|
2186
|
+
|
|
2187
|
+
/**
|
|
2188
|
+
* This plugin automatically instruments the
|
|
2189
|
+
* [dns](https://nodejs.org/api/dns.html) module.
|
|
2190
|
+
*/
|
|
2191
|
+
interface dns extends Instrumentation {}
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* This plugin automatically instruments the
|
|
2195
|
+
* [elasticsearch](https://github.com/elastic/elasticsearch-js) module.
|
|
2196
|
+
*/
|
|
2197
|
+
interface elasticsearch extends Instrumentation {
|
|
2198
|
+
/**
|
|
2199
|
+
* Hooks to run before spans are finished.
|
|
2200
|
+
*/
|
|
2201
|
+
hooks?: {
|
|
2202
|
+
/**
|
|
2203
|
+
* Hook to execute just before the query span finishes.
|
|
2204
|
+
*/
|
|
2205
|
+
query?: (span?: Span, params?: TransportRequestParams) => any;
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* This plugin automatically instruments the
|
|
2211
|
+
* [express](http://expressjs.com/) module.
|
|
2212
|
+
*/
|
|
2213
|
+
interface express extends HttpServer {}
|
|
2214
|
+
|
|
2215
|
+
/**
|
|
2216
|
+
* This plugin automatically instruments the
|
|
2217
|
+
* [fastify](https://www.fastify.io/) module.
|
|
2218
|
+
*/
|
|
2219
|
+
interface fastify extends HttpServer {}
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* This plugin automatically instruments the
|
|
2223
|
+
* [fetch](https://nodejs.org/api/globals.html#fetch) global.
|
|
2224
|
+
*/
|
|
2225
|
+
interface fetch extends HttpClient {}
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* This plugin patches the [find-my-way](https://github.com/delvedor/find-my-way) router.
|
|
2229
|
+
*/
|
|
2230
|
+
interface find_my_way extends Integration {}
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* This plugin automatically instruments Node.js core fs operations.
|
|
2234
|
+
*/
|
|
2235
|
+
interface fs extends Instrumentation {}
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* This plugin patches the [generic-pool](https://github.com/coopernurse/node-pool)
|
|
2239
|
+
* module to bind the callbacks the the caller context.
|
|
2240
|
+
*/
|
|
2241
|
+
interface generic_pool extends Integration {}
|
|
2242
|
+
|
|
2243
|
+
/**
|
|
2244
|
+
* This plugin automatically instruments the
|
|
2245
|
+
* [@google-cloud/pubsub](https://github.com/googleapis/nodejs-pubsub) module.
|
|
2246
|
+
*/
|
|
2247
|
+
interface google_cloud_pubsub extends Integration {}
|
|
2248
|
+
|
|
2249
|
+
/**
|
|
2250
|
+
* This plugin automatically instruments the
|
|
2251
|
+
* [@google-cloud/vertexai](https://github.com/googleapis/nodejs-vertexai) module.
|
|
2252
|
+
*/
|
|
2253
|
+
interface google_cloud_vertexai extends Integration {}
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* This plugin automatically instruments the
|
|
2257
|
+
* [@google-genai](https://github.com/googleapis/js-genai) module.
|
|
2258
|
+
*/
|
|
2259
|
+
interface google_genai extends Integration {}
|
|
2260
|
+
|
|
2261
|
+
/** @hidden */
|
|
2262
|
+
interface ExecutionArgs {
|
|
2263
|
+
schema: any,
|
|
2264
|
+
document: any,
|
|
2265
|
+
rootValue?: any,
|
|
2266
|
+
contextValue?: any,
|
|
2267
|
+
variableValues?: any,
|
|
2268
|
+
operationName?: string,
|
|
2269
|
+
fieldResolver?: any,
|
|
2270
|
+
typeResolver?: any,
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
/**
|
|
2274
|
+
* This plugin automatically instruments the
|
|
2275
|
+
* [graphql](https://github.com/graphql/graphql-js) module.
|
|
2276
|
+
*
|
|
2277
|
+
* The `graphql` integration uses the operation name as the span resource name.
|
|
2278
|
+
* If no operation name is set, the resource name will always be just `query`,
|
|
2279
|
+
* `mutation` or `subscription`.
|
|
2280
|
+
*
|
|
2281
|
+
* For example:
|
|
2282
|
+
*
|
|
2283
|
+
* ```graphql
|
|
2284
|
+
* # good, the resource name will be `query HelloWorld`
|
|
2285
|
+
* query HelloWorld {
|
|
2286
|
+
* hello
|
|
2287
|
+
* world
|
|
2288
|
+
* }
|
|
2289
|
+
*
|
|
2290
|
+
* # bad, the resource name will be `query`
|
|
2291
|
+
* {
|
|
2292
|
+
* hello
|
|
2293
|
+
* world
|
|
2294
|
+
* }
|
|
2295
|
+
* ```
|
|
2296
|
+
*/
|
|
2297
|
+
interface graphql extends Instrumentation {
|
|
2298
|
+
/**
|
|
2299
|
+
* The maximum depth of fields/resolvers to instrument. Set to `0` to only
|
|
2300
|
+
* instrument the operation or to `-1` to instrument all fields/resolvers.
|
|
2301
|
+
*
|
|
2302
|
+
* @default -1
|
|
2303
|
+
*/
|
|
2304
|
+
depth?: number;
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* Whether to include the source of the operation within the query as a tag
|
|
2308
|
+
* on every span. This may contain sensitive information and should only be
|
|
2309
|
+
* enabled if sensitive data is always sent as variables and not in the
|
|
2310
|
+
* query text.
|
|
2311
|
+
*
|
|
2312
|
+
* @default false
|
|
2313
|
+
*/
|
|
2314
|
+
source?: boolean;
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* An array of variable names to record. Can also be a callback that returns
|
|
2318
|
+
* the key/value pairs to record. For example, using
|
|
2319
|
+
* `variables => variables` would record all variables.
|
|
2320
|
+
*/
|
|
2321
|
+
variables?: string[] | ((variables: { [key: string]: any }) => { [key: string]: any });
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* Whether to collapse list items into a single element. (i.e. single
|
|
2325
|
+
* `users.*.name` span instead of `users.0.name`, `users.1.name`, etc)
|
|
2326
|
+
*
|
|
2327
|
+
* @default true
|
|
2328
|
+
*/
|
|
2329
|
+
collapse?: boolean;
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* Whether to enable signature calculation for the resource name. This can
|
|
2333
|
+
* be disabled if your GraphQL operations always have a name. Note that when
|
|
2334
|
+
* disabled all queries will need to be named for this to work properly.
|
|
2335
|
+
*
|
|
2336
|
+
* @default true
|
|
2337
|
+
*/
|
|
2338
|
+
signature?: boolean;
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* An object of optional callbacks to be executed during the respective
|
|
2342
|
+
* phase of a GraphQL operation. Undefined callbacks default to a noop
|
|
2343
|
+
* function.
|
|
2344
|
+
*
|
|
2345
|
+
* @default {}
|
|
2346
|
+
*/
|
|
2347
|
+
hooks?: {
|
|
2348
|
+
execute?: (span?: Span, args?: ExecutionArgs, res?: any) => void;
|
|
2349
|
+
validate?: (span?: Span, document?: any, errors?: any) => void;
|
|
2350
|
+
parse?: (span?: Span, source?: any, document?: any) => void;
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* This plugin automatically instruments the
|
|
2356
|
+
* [grpc](https://github.com/grpc/grpc-node) module.
|
|
2357
|
+
*/
|
|
2358
|
+
interface grpc extends Grpc {
|
|
2359
|
+
/**
|
|
2360
|
+
* Configuration for gRPC clients.
|
|
2361
|
+
*/
|
|
2362
|
+
client?: Grpc,
|
|
2363
|
+
|
|
2364
|
+
/**
|
|
2365
|
+
* Configuration for gRPC servers.
|
|
2366
|
+
*/
|
|
2367
|
+
server?: Grpc
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* This plugin automatically instruments the
|
|
2372
|
+
* [hapi](https://hapijs.com/) module.
|
|
2373
|
+
*/
|
|
2374
|
+
interface hapi extends HttpServer {}
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* This plugin automatically instruments the
|
|
2378
|
+
* [hono](https://hono.dev/) module.
|
|
2379
|
+
*/
|
|
2380
|
+
interface hono extends HttpServer {}
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* This plugin automatically instruments the
|
|
2384
|
+
* [http](https://nodejs.org/api/http.html) module.
|
|
2385
|
+
*
|
|
2386
|
+
* By default any option set at the root will apply to both clients and
|
|
2387
|
+
* servers. To configure only one or the other, use the `client` and `server`
|
|
2388
|
+
* options.
|
|
2389
|
+
*/
|
|
2390
|
+
interface http extends HttpClient, HttpServer {
|
|
2391
|
+
/**
|
|
2392
|
+
* Configuration for HTTP clients.
|
|
2393
|
+
*/
|
|
2394
|
+
client?: HttpClient | boolean,
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* Configuration for HTTP servers.
|
|
2398
|
+
*/
|
|
2399
|
+
server?: HttpServer | boolean
|
|
2400
|
+
|
|
2401
|
+
/**
|
|
2402
|
+
* Hooks to run before spans are finished.
|
|
2403
|
+
*/
|
|
2404
|
+
hooks?: {
|
|
2405
|
+
/**
|
|
2406
|
+
* Hook to execute just before the request span finishes.
|
|
2407
|
+
*/
|
|
2408
|
+
request?: (
|
|
2409
|
+
span?: Span,
|
|
2410
|
+
req?: IncomingMessage | ClientRequest,
|
|
2411
|
+
res?: ServerResponse | IncomingMessage
|
|
2412
|
+
) => any;
|
|
2413
|
+
};
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
/**
|
|
2417
|
+
* This plugin automatically instruments the
|
|
2418
|
+
* [http2](https://nodejs.org/api/http2.html) module.
|
|
2419
|
+
*
|
|
2420
|
+
* By default any option set at the root will apply to both clients and
|
|
2421
|
+
* servers. To configure only one or the other, use the `client` and `server`
|
|
2422
|
+
* options.
|
|
2423
|
+
*/
|
|
2424
|
+
interface http2 extends Http2Client, Http2Server {
|
|
2425
|
+
/**
|
|
2426
|
+
* Configuration for HTTP clients.
|
|
2427
|
+
*/
|
|
2428
|
+
client?: Http2Client | boolean,
|
|
2429
|
+
|
|
2430
|
+
/**
|
|
2431
|
+
* Configuration for HTTP servers.
|
|
2432
|
+
*/
|
|
2433
|
+
server?: Http2Server | boolean
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* This plugin automatically instruments the
|
|
2438
|
+
* [ioredis](https://github.com/luin/ioredis) module.
|
|
2439
|
+
*/
|
|
2440
|
+
interface ioredis extends Instrumentation {
|
|
2441
|
+
/**
|
|
2442
|
+
* List of commands that should be instrumented. Commands must be in
|
|
2443
|
+
* lowercase for example 'xread'.
|
|
2444
|
+
*
|
|
2445
|
+
* @default /^.*$/
|
|
2446
|
+
*/
|
|
2447
|
+
allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* Deprecated in favor of `allowlist`.
|
|
2451
|
+
*
|
|
2452
|
+
* @deprecated
|
|
2453
|
+
* @hidden
|
|
2454
|
+
*/
|
|
2455
|
+
whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2456
|
+
|
|
2457
|
+
/**
|
|
2458
|
+
* List of commands that should not be instrumented. Takes precedence over
|
|
2459
|
+
* allowlist if a command matches an entry in both. Commands must be in
|
|
2460
|
+
* lowercase for example 'xread'.
|
|
2461
|
+
*
|
|
2462
|
+
* @default []
|
|
2463
|
+
*/
|
|
2464
|
+
blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2465
|
+
|
|
2466
|
+
/**
|
|
2467
|
+
* Deprecated in favor of `blocklist`.
|
|
2468
|
+
*
|
|
2469
|
+
* @deprecated
|
|
2470
|
+
* @hidden
|
|
2471
|
+
*/
|
|
2472
|
+
blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Custom filter function used to decide whether a Redis command should be instrumented.
|
|
2476
|
+
* When provided, this takes precedence over allowlist/blocklist configuration.
|
|
2477
|
+
* If not provided, allowlist/blocklist logic will be used instead.
|
|
2478
|
+
*
|
|
2479
|
+
* @param command - The Redis command name to filter
|
|
2480
|
+
* @returns true to instrument the command, false to skip it
|
|
2481
|
+
*/
|
|
2482
|
+
filter?: (command: string) => boolean;
|
|
2483
|
+
|
|
2484
|
+
/**
|
|
2485
|
+
* Whether to use a different service name for each Redis instance based
|
|
2486
|
+
* on the configured connection name of the client.
|
|
2487
|
+
*
|
|
2488
|
+
* @default false
|
|
2489
|
+
*/
|
|
2490
|
+
splitByInstance?: boolean;
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
/**
|
|
2494
|
+
* This plugin automatically instruments the
|
|
2495
|
+
* [iovalkey](https://github.com/valkey-io/iovalkey) module.
|
|
2496
|
+
*/
|
|
2497
|
+
interface iovalkey extends Instrumentation {
|
|
2498
|
+
/**
|
|
2499
|
+
* List of commands that should be instrumented. Commands must be in
|
|
2500
|
+
* lowercase for example 'xread'.
|
|
2501
|
+
*
|
|
2502
|
+
* @default /^.*$/
|
|
2503
|
+
*/
|
|
2504
|
+
allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* Deprecated in favor of `allowlist`.
|
|
2508
|
+
*
|
|
2509
|
+
* @deprecated
|
|
2510
|
+
* @hidden
|
|
2511
|
+
*/
|
|
2512
|
+
whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* List of commands that should not be instrumented. Takes precedence over
|
|
2516
|
+
* allowlist if a command matches an entry in both. Commands must be in
|
|
2517
|
+
* lowercase for example 'xread'.
|
|
2518
|
+
*
|
|
2519
|
+
* @default []
|
|
2520
|
+
*/
|
|
2521
|
+
blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2522
|
+
|
|
2523
|
+
/**
|
|
2524
|
+
* Deprecated in favor of `blocklist`.
|
|
2525
|
+
*
|
|
2526
|
+
* @deprecated
|
|
2527
|
+
* @hidden
|
|
2528
|
+
*/
|
|
2529
|
+
blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* Custom filter function used to decide whether a Valkey command should be instrumented.
|
|
2533
|
+
* When provided, this takes precedence over allowlist/blocklist configuration.
|
|
2534
|
+
* If not provided, allowlist/blocklist logic will be used instead.
|
|
2535
|
+
*
|
|
2536
|
+
* @param command - The Valkey command name to filter
|
|
2537
|
+
* @returns true to instrument the command, false to skip it
|
|
2538
|
+
*/
|
|
2539
|
+
filter?: (command: string) => boolean;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Whether to use a different service name for each Redis instance based
|
|
2543
|
+
* on the configured connection name of the client.
|
|
2544
|
+
*
|
|
2545
|
+
* @default false
|
|
2546
|
+
*/
|
|
2547
|
+
splitByInstance?: boolean;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
/**
|
|
2551
|
+
* This plugin automatically instruments the
|
|
2552
|
+
* [jest](https://github.com/jestjs/jest) module.
|
|
2553
|
+
*/
|
|
2554
|
+
interface jest extends Integration {}
|
|
2555
|
+
|
|
2556
|
+
/**
|
|
2557
|
+
* This plugin patches the [knex](https://knexjs.org/)
|
|
2558
|
+
* module to bind the promise callback the the caller context.
|
|
2559
|
+
*/
|
|
2560
|
+
interface knex extends Integration {}
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* This plugin automatically instruments the
|
|
2564
|
+
* [koa](https://koajs.com/) module.
|
|
2565
|
+
*/
|
|
2566
|
+
interface koa extends HttpServer {}
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* This plugin automatically instruments the
|
|
2570
|
+
* [kafkajs](https://kafka.js.org/) module.
|
|
2571
|
+
*/
|
|
2572
|
+
interface kafkajs extends Instrumentation {}
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* This plugin automatically instruments the
|
|
2576
|
+
* [langchain](https://js.langchain.com/) module
|
|
2577
|
+
*/
|
|
2578
|
+
interface langchain extends Instrumentation {}
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* This plugin automatically instruments the
|
|
2582
|
+
* [ldapjs](https://github.com/ldapjs/node-ldapjs/) module.
|
|
2583
|
+
*/
|
|
2584
|
+
interface ldapjs extends Instrumentation {}
|
|
2585
|
+
|
|
2586
|
+
/**
|
|
2587
|
+
* This plugin automatically instruments the
|
|
2588
|
+
* [mariadb](https://github.com/mariadb-corporation/mariadb-connector-nodejs) module.
|
|
2589
|
+
*/
|
|
2590
|
+
interface mariadb extends mysql {}
|
|
2591
|
+
|
|
2592
|
+
/**
|
|
2593
|
+
* This plugin automatically instruments the
|
|
2594
|
+
* [memcached](https://github.com/3rd-Eden/memcached) module.
|
|
2595
|
+
*/
|
|
2596
|
+
interface memcached extends Instrumentation {}
|
|
2597
|
+
|
|
2598
|
+
/**
|
|
2599
|
+
* This plugin automatically instruments the
|
|
2600
|
+
* [microgateway-core](https://github.com/apigee/microgateway-core) module.
|
|
2601
|
+
*/
|
|
2602
|
+
interface microgateway_core extends HttpServer {}
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* This plugin automatically instruments the
|
|
2606
|
+
* [mocha](https://mochajs.org/) module.
|
|
2607
|
+
*/
|
|
2608
|
+
interface mocha extends Integration {}
|
|
2609
|
+
|
|
2610
|
+
/**
|
|
2611
|
+
* This plugin automatically instruments the
|
|
2612
|
+
* [moleculer](https://moleculer.services/) module.
|
|
2613
|
+
*/
|
|
2614
|
+
interface moleculer extends Moleculer {
|
|
2615
|
+
/**
|
|
2616
|
+
* Configuration for Moleculer clients. Set to false to disable client
|
|
2617
|
+
* instrumentation.
|
|
2618
|
+
*/
|
|
2619
|
+
client?: boolean | Moleculer;
|
|
2620
|
+
|
|
2621
|
+
/**
|
|
2622
|
+
* Configuration for Moleculer servers. Set to false to disable server
|
|
2623
|
+
* instrumentation.
|
|
2624
|
+
*/
|
|
2625
|
+
server?: boolean | Moleculer;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
/**
|
|
2629
|
+
* This plugin automatically instruments the
|
|
2630
|
+
* [mongodb-core](https://github.com/mongodb-js/mongodb-core) module.
|
|
2631
|
+
*/
|
|
2632
|
+
interface mongodb_core extends Instrumentation {
|
|
2633
|
+
/**
|
|
2634
|
+
* Whether to enable mongo heartbeats spans.
|
|
2635
|
+
*
|
|
2636
|
+
* @default true
|
|
2637
|
+
*/
|
|
2638
|
+
heartbeatEnabled?: boolean;
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* Whether to include the query contents in the resource name.
|
|
2642
|
+
*/
|
|
2643
|
+
queryInResourceName?: boolean;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
/**
|
|
2647
|
+
* This plugin automatically instruments the
|
|
2648
|
+
* [mongoose](https://mongoosejs.com/) module.
|
|
2649
|
+
*/
|
|
2650
|
+
interface mongoose extends Instrumentation {}
|
|
2651
|
+
|
|
2652
|
+
/**
|
|
2653
|
+
* This plugin automatically instruments the
|
|
2654
|
+
* [mysql](https://github.com/mysqljs/mysql) module.
|
|
2655
|
+
*/
|
|
2656
|
+
interface mysql extends Instrumentation {
|
|
2657
|
+
service?: string | ((params: any) => string);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
/**
|
|
2661
|
+
* This plugin automatically instruments the
|
|
2662
|
+
* [mysql2](https://github.com/sidorares/node-mysql2) module.
|
|
2663
|
+
*/
|
|
2664
|
+
interface mysql2 extends mysql {}
|
|
2665
|
+
|
|
2666
|
+
/**
|
|
2667
|
+
* This plugin automatically instruments the
|
|
2668
|
+
* [net](https://nodejs.org/api/net.html) module.
|
|
2669
|
+
*/
|
|
2670
|
+
interface net extends Instrumentation {}
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* This plugin automatically instruments the
|
|
2674
|
+
* [next](https://nextjs.org/) module.
|
|
2675
|
+
*/
|
|
2676
|
+
interface next extends Instrumentation {
|
|
2677
|
+
/**
|
|
2678
|
+
* Hooks to run before spans are finished.
|
|
2679
|
+
*/
|
|
2680
|
+
hooks?: {
|
|
2681
|
+
/**
|
|
2682
|
+
* Hook to execute just before the request span finishes.
|
|
2683
|
+
*/
|
|
2684
|
+
request?: (span?: Span, req?: IncomingMessage, res?: ServerResponse) => any;
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
/**
|
|
2689
|
+
* This plugin integrates with [nyc](https://github.com/istanbuljs/nyc) for CI visibility.
|
|
2690
|
+
*/
|
|
2691
|
+
interface nyc extends Integration {}
|
|
2692
|
+
|
|
2693
|
+
/**
|
|
2694
|
+
* This plugin automatically instruments the
|
|
2695
|
+
* [openai](https://platform.openai.com/docs/api-reference?lang=node.js) module.
|
|
2696
|
+
*
|
|
2697
|
+
* Note that for logs to work you'll need to set the `DD_API_KEY` environment variable.
|
|
2698
|
+
* @env DD_API_KEY
|
|
2699
|
+
* You'll also need to adjust any firewall settings to allow the tracer to communicate
|
|
2700
|
+
* with `http-intake.logs.datadoghq.com`.
|
|
2701
|
+
*
|
|
2702
|
+
* Note that for metrics to work you'll need to enable
|
|
2703
|
+
* [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent#setup)
|
|
2704
|
+
* in the agent.
|
|
2705
|
+
*/
|
|
2706
|
+
interface openai extends Instrumentation {}
|
|
2707
|
+
|
|
2708
|
+
/**
|
|
2709
|
+
* This plugin automatically instruments the
|
|
2710
|
+
* [opensearch](https://github.com/opensearch-project/opensearch-js) module.
|
|
2711
|
+
*/
|
|
2712
|
+
interface opensearch extends elasticsearch {}
|
|
2713
|
+
|
|
2714
|
+
/**
|
|
2715
|
+
* This plugin automatically instruments the
|
|
2716
|
+
* [oracledb](https://github.com/oracle/node-oracledb) module.
|
|
2717
|
+
*/
|
|
2718
|
+
interface oracledb extends Instrumentation {
|
|
2719
|
+
/**
|
|
2720
|
+
* 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.
|
|
2721
|
+
*/
|
|
2722
|
+
service?: string | ((params: any) => string);
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* This plugin automatically instruments the
|
|
2727
|
+
* [playwright](https://github.com/microsoft/playwright) module.
|
|
2728
|
+
*/
|
|
2729
|
+
interface playwright extends Integration {}
|
|
2730
|
+
|
|
2731
|
+
/**
|
|
2732
|
+
* This plugin automatically instruments the
|
|
2733
|
+
* [pg](https://node-postgres.com/) module.
|
|
2734
|
+
*/
|
|
2735
|
+
interface pg extends Instrumentation {
|
|
2736
|
+
/**
|
|
2737
|
+
* 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.
|
|
2738
|
+
*/
|
|
2739
|
+
service?: string | ((params: any) => string);
|
|
2740
|
+
/**
|
|
2741
|
+
* The database monitoring propagation mode to be used for this plugin.
|
|
2742
|
+
*/
|
|
2743
|
+
dbmPropagationMode?: string;
|
|
2744
|
+
/**
|
|
2745
|
+
* Appends the SQL comment propagation to the query string. Prepends the comment if `false`. For long query strings, the appended propagation comment might be truncated, causing loss of correlation between the query and trace.
|
|
2746
|
+
*/
|
|
2747
|
+
appendComment?: boolean;
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
/**
|
|
2751
|
+
* This plugin patches the [pino](http://getpino.io)
|
|
2752
|
+
* to automatically inject trace identifiers in log records when the
|
|
2753
|
+
* [logInjection](interfaces/traceroptions.html#logInjection) option is enabled
|
|
2754
|
+
* on the tracer.
|
|
2755
|
+
*/
|
|
2756
|
+
interface pino extends Integration {}
|
|
2757
|
+
|
|
2758
|
+
/**
|
|
2759
|
+
* This plugin automatically instruments the
|
|
2760
|
+
* [@prisma/client](https://www.prisma.io/docs/orm/prisma-client) module.
|
|
2761
|
+
*/
|
|
2762
|
+
interface prisma extends PrismaClient, PrismaEngine {
|
|
2763
|
+
/**
|
|
2764
|
+
* Configuration for prisma client.
|
|
2765
|
+
*/
|
|
2766
|
+
client?: PrismaClient | boolean,
|
|
2767
|
+
|
|
2768
|
+
/**
|
|
2769
|
+
* Configuration for Prisma engine.
|
|
2770
|
+
*/
|
|
2771
|
+
engine?: PrismaEngine | boolean
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
/**
|
|
2775
|
+
* This plugin automatically patches the [protobufjs](https://protobufjs.github.io/protobuf.js/)
|
|
2776
|
+
* to collect protobuf message schemas when Datastreams Monitoring is enabled.
|
|
2777
|
+
*/
|
|
2778
|
+
interface protobufjs extends Integration {}
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* This plugin automatically instruments the
|
|
2782
|
+
* [redis](https://github.com/NodeRedis/node_redis) module.
|
|
2783
|
+
*/
|
|
2784
|
+
interface redis extends Instrumentation {
|
|
2785
|
+
/**
|
|
2786
|
+
* List of commands that should be instrumented.
|
|
2787
|
+
*
|
|
2788
|
+
* @default /^.*$/
|
|
2789
|
+
*/
|
|
2790
|
+
allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2791
|
+
|
|
2792
|
+
/**
|
|
2793
|
+
* Deprecated in favor of `allowlist`.
|
|
2794
|
+
*
|
|
2795
|
+
* deprecated
|
|
2796
|
+
* @hidden
|
|
2797
|
+
*/
|
|
2798
|
+
whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2799
|
+
|
|
2800
|
+
/**
|
|
2801
|
+
* List of commands that should not be instrumented. Takes precedence over
|
|
2802
|
+
* allowlist if a command matches an entry in both.
|
|
2803
|
+
*
|
|
2804
|
+
* @default []
|
|
2805
|
+
*/
|
|
2806
|
+
blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2807
|
+
|
|
2808
|
+
/**
|
|
2809
|
+
* Deprecated in favor of `blocklist`.
|
|
2810
|
+
*
|
|
2811
|
+
* @deprecated
|
|
2812
|
+
* @hidden
|
|
2813
|
+
*/
|
|
2814
|
+
blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* Custom filter function used to decide whether a Redis command should be instrumented.
|
|
2818
|
+
* When provided, this takes precedence over allowlist/blocklist configuration.
|
|
2819
|
+
* If not provided, allowlist/blocklist logic will be used instead.
|
|
2820
|
+
*
|
|
2821
|
+
* @param command - The Redis command name to filter
|
|
2822
|
+
* @returns true to instrument the command, false to skip it
|
|
2823
|
+
*/
|
|
2824
|
+
filter?: (command: string) => boolean;
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
/**
|
|
2828
|
+
* This plugin automatically instruments the
|
|
2829
|
+
* [restify](http://restify.com/) module.
|
|
2830
|
+
*/
|
|
2831
|
+
interface restify extends HttpServer {}
|
|
2832
|
+
|
|
2833
|
+
/**
|
|
2834
|
+
* This plugin automatically instruments the
|
|
2835
|
+
* [rhea](https://github.com/amqp/rhea) module.
|
|
2836
|
+
*/
|
|
2837
|
+
interface rhea extends Instrumentation {}
|
|
2838
|
+
|
|
2839
|
+
/**
|
|
2840
|
+
* This plugin automatically instruments the
|
|
2841
|
+
* [router](https://github.com/pillarjs/router) module.
|
|
2842
|
+
*/
|
|
2843
|
+
interface router extends Integration {}
|
|
2844
|
+
|
|
2845
|
+
/**
|
|
2846
|
+
* This plugin automatically instruments the
|
|
2847
|
+
* [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver) module.
|
|
2848
|
+
*/
|
|
2849
|
+
interface selenium extends Integration {}
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* This plugin automatically instruments the
|
|
2853
|
+
* [sharedb](https://github.com/share/sharedb) module.
|
|
2854
|
+
*/
|
|
2855
|
+
interface sharedb extends Integration {
|
|
2856
|
+
/**
|
|
2857
|
+
* Hooks to run before spans are finished.
|
|
2858
|
+
*/
|
|
2859
|
+
hooks?: {
|
|
2860
|
+
/**
|
|
2861
|
+
* Hook to execute just when the span is created.
|
|
2862
|
+
*/
|
|
2863
|
+
receive?: (span?: Span, request?: any) => any;
|
|
2864
|
+
|
|
2865
|
+
/**
|
|
2866
|
+
* Hook to execute just when the span is finished.
|
|
2867
|
+
*/
|
|
2868
|
+
reply?: (span?: Span, request?: any, response?: any) => any;
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
/**
|
|
2873
|
+
* This plugin automatically instruments the
|
|
2874
|
+
* [tedious](https://github.com/tediousjs/tedious/) module.
|
|
2875
|
+
*/
|
|
2876
|
+
interface tedious extends Instrumentation {}
|
|
2877
|
+
|
|
2878
|
+
/**
|
|
2879
|
+
* This plugin automatically instruments the
|
|
2880
|
+
* [undici](https://github.com/nodejs/undici) module.
|
|
2881
|
+
*/
|
|
2882
|
+
interface undici extends HttpClient {}
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* This plugin automatically instruments the
|
|
2886
|
+
* [vitest](https://github.com/vitest-dev/vitest) module.
|
|
2887
|
+
*/
|
|
2888
|
+
interface vitest extends Integration {}
|
|
2889
|
+
|
|
2890
|
+
/**
|
|
2891
|
+
* This plugin implements shared web request instrumentation helpers.
|
|
2892
|
+
*/
|
|
2893
|
+
interface web extends HttpServer {}
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* This plugin patches the [winston](https://github.com/winstonjs/winston)
|
|
2897
|
+
* to automatically inject trace identifiers in log records when the
|
|
2898
|
+
* [logInjection](interfaces/traceroptions.html#logInjection) option is enabled
|
|
2899
|
+
* on the tracer.
|
|
2900
|
+
*/
|
|
2901
|
+
interface winston extends Integration {}
|
|
2902
|
+
|
|
2903
|
+
/**
|
|
2904
|
+
* This plugin automatically instruments the
|
|
2905
|
+
* [ws](https://github.com/websockets/ws) module.
|
|
2906
|
+
*/
|
|
2907
|
+
interface ws extends Instrumentation {
|
|
2908
|
+
/**
|
|
2909
|
+
* Controls whether websocket messages should be traced.
|
|
2910
|
+
* This is also configurable via `DD_TRACE_WEBSOCKET_MESSAGES_ENABLED`.
|
|
2911
|
+
* @env DD_TRACE_WEBSOCKET_MESSAGES_ENABLED
|
|
2912
|
+
*/
|
|
2913
|
+
traceWebsocketMessagesEnabled?: boolean;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
export namespace opentelemetry {
|
|
2918
|
+
/**
|
|
2919
|
+
* A registry for creating named {@link Tracer}s.
|
|
2920
|
+
*/
|
|
2921
|
+
export interface TracerProvider extends otel.TracerProvider {
|
|
2922
|
+
/**
|
|
2923
|
+
* Construct a new TracerProvider to register with @opentelemetry/api
|
|
2924
|
+
*
|
|
2925
|
+
* @param config Configuration object for the TracerProvider
|
|
2926
|
+
* @returns TracerProvider A TracerProvider instance
|
|
2927
|
+
*/
|
|
2928
|
+
new(config?: Record<string, unknown>): TracerProvider;
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Returns a Tracer, creating one if one with the given name and version is
|
|
2932
|
+
* not already created.
|
|
2933
|
+
*
|
|
2934
|
+
* @param name The name of the tracer or instrumentation library.
|
|
2935
|
+
* @param version The version of the tracer or instrumentation library.
|
|
2936
|
+
* @param options The options of the tracer or instrumentation library.
|
|
2937
|
+
* @returns Tracer A Tracer with the given name and version
|
|
2938
|
+
*/
|
|
2939
|
+
getTracer(name: string, version?: string, options?: any): Tracer;
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Register this tracer provider with @opentelemetry/api
|
|
2943
|
+
*/
|
|
2944
|
+
register(): void;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
/**
|
|
2948
|
+
* Tracer provides an interface for creating {@link Span}s.
|
|
2949
|
+
*/
|
|
2950
|
+
export interface Tracer extends otel.Tracer {
|
|
2951
|
+
/**
|
|
2952
|
+
* Starts a new {@link Span}. Start the span without setting it on context.
|
|
2953
|
+
*
|
|
2954
|
+
* This method do NOT modify the current Context.
|
|
2955
|
+
*
|
|
2956
|
+
* @param name The name of the span
|
|
2957
|
+
* @param [options] SpanOptions used for span creation
|
|
2958
|
+
* @param [context] Context to use to extract parent
|
|
2959
|
+
* @returns Span The newly created span
|
|
2960
|
+
* @example
|
|
2961
|
+
* const span = tracer.startSpan('op');
|
|
2962
|
+
* span.setAttribute('key', 'value');
|
|
2963
|
+
* span.end();
|
|
2964
|
+
*/
|
|
2965
|
+
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
|
2966
|
+
|
|
2967
|
+
/**
|
|
2968
|
+
* Starts a new {@link Span} and calls the given function passing it the
|
|
2969
|
+
* created span as first argument.
|
|
2970
|
+
* Additionally the new span gets set in context and this context is activated
|
|
2971
|
+
* for the duration of the function call.
|
|
2972
|
+
*
|
|
2973
|
+
* @param name The name of the span
|
|
2974
|
+
* @param [options] SpanOptions used for span creation
|
|
2975
|
+
* @param [context] Context to use to extract parent
|
|
2976
|
+
* @param fn function called in the context of the span and receives the newly created span as an argument
|
|
2977
|
+
* @returns return value of fn
|
|
2978
|
+
* @example
|
|
2979
|
+
* const something = tracer.startActiveSpan('op', span => {
|
|
2980
|
+
* try {
|
|
2981
|
+
* do some work
|
|
2982
|
+
* span.setStatus({code: SpanStatusCode.OK});
|
|
2983
|
+
* return something;
|
|
2984
|
+
* } catch (err) {
|
|
2985
|
+
* span.setStatus({
|
|
2986
|
+
* code: SpanStatusCode.ERROR,
|
|
2987
|
+
* message: err.message,
|
|
2988
|
+
* });
|
|
2989
|
+
* throw err;
|
|
2990
|
+
* } finally {
|
|
2991
|
+
* span.end();
|
|
2992
|
+
* }
|
|
2993
|
+
* });
|
|
2994
|
+
*
|
|
2995
|
+
* @example
|
|
2996
|
+
* const span = tracer.startActiveSpan('op', span => {
|
|
2997
|
+
* try {
|
|
2998
|
+
* do some work
|
|
2999
|
+
* return span;
|
|
3000
|
+
* } catch (err) {
|
|
3001
|
+
* span.setStatus({
|
|
3002
|
+
* code: SpanStatusCode.ERROR,
|
|
3003
|
+
* message: err.message,
|
|
3004
|
+
* });
|
|
3005
|
+
* throw err;
|
|
3006
|
+
* }
|
|
3007
|
+
* });
|
|
3008
|
+
* do some more work
|
|
3009
|
+
* span.end();
|
|
3010
|
+
*/
|
|
3011
|
+
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: otel.Context, fn: F): ReturnType<F>;
|
|
3012
|
+
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
|
|
3013
|
+
startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
/**
|
|
3017
|
+
* An interface that represents a span. A span represents a single operation
|
|
3018
|
+
* within a trace. Examples of span might include remote procedure calls or a
|
|
3019
|
+
* in-process function calls to sub-components. A Trace has a single, top-level
|
|
3020
|
+
* "root" Span that in turn may have zero or more child Spans, which in turn
|
|
3021
|
+
* may have children.
|
|
3022
|
+
*
|
|
3023
|
+
* Spans are created by the {@link Tracer.startSpan} method.
|
|
3024
|
+
*/
|
|
3025
|
+
export interface Span extends otel.Span {
|
|
3026
|
+
/**
|
|
3027
|
+
* Returns the {@link SpanContext} object associated with this Span.
|
|
3028
|
+
*
|
|
3029
|
+
* Get an immutable, serializable identifier for this span that can be used
|
|
3030
|
+
* to create new child spans. Returned SpanContext is usable even after the
|
|
3031
|
+
* span ends.
|
|
3032
|
+
*
|
|
3033
|
+
* @returns the SpanContext object associated with this Span.
|
|
3034
|
+
*/
|
|
3035
|
+
spanContext(): SpanContext;
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* Sets an attribute to the span.
|
|
3039
|
+
*
|
|
3040
|
+
* Sets a single Attribute with the key and value passed as arguments.
|
|
3041
|
+
*
|
|
3042
|
+
* @param key the key for this attribute.
|
|
3043
|
+
* @param value the value for this attribute. Setting a value null or
|
|
3044
|
+
* undefined is invalid and will result in undefined behavior.
|
|
3045
|
+
*/
|
|
3046
|
+
setAttribute(key: string, value: SpanAttributeValue): this;
|
|
3047
|
+
|
|
3048
|
+
/**
|
|
3049
|
+
* Sets attributes to the span.
|
|
3050
|
+
*
|
|
3051
|
+
* @param attributes the attributes that will be added.
|
|
3052
|
+
* null or undefined attribute values
|
|
3053
|
+
* are invalid and will result in undefined behavior.
|
|
3054
|
+
*/
|
|
3055
|
+
setAttributes(attributes: SpanAttributes): this;
|
|
3056
|
+
|
|
3057
|
+
/**
|
|
3058
|
+
* Adds an event to the Span.
|
|
3059
|
+
*
|
|
3060
|
+
* @param name the name of the event.
|
|
3061
|
+
* @param [attributesOrStartTime] the attributes that will be added; these are
|
|
3062
|
+
* associated with this event. Can be also a start time
|
|
3063
|
+
* if type is {@link TimeInput} and 3rd param is undefined
|
|
3064
|
+
* @param [startTime] start time of the event.
|
|
3065
|
+
*/
|
|
3066
|
+
addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this;
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* Sets a status to the span. If used, this will override the default Span
|
|
3070
|
+
* status. Default is {@link otel.SpanStatusCode.UNSET}. SetStatus overrides the value
|
|
3071
|
+
* of previous calls to SetStatus on the Span.
|
|
3072
|
+
*
|
|
3073
|
+
* @param status the SpanStatus to set.
|
|
3074
|
+
*/
|
|
3075
|
+
setStatus(status: SpanStatus): this;
|
|
3076
|
+
|
|
3077
|
+
/**
|
|
3078
|
+
* Updates the Span name.
|
|
3079
|
+
*
|
|
3080
|
+
* This will override the name provided via {@link Tracer.startSpan}.
|
|
3081
|
+
*
|
|
3082
|
+
* Upon this update, any sampling behavior based on Span name will depend on
|
|
3083
|
+
* the implementation.
|
|
3084
|
+
*
|
|
3085
|
+
* @param name the Span name.
|
|
3086
|
+
*/
|
|
3087
|
+
updateName(name: string): this;
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* Marks the end of Span execution.
|
|
3091
|
+
*
|
|
3092
|
+
* Call to End of a Span MUST not have any effects on child spans. Those may
|
|
3093
|
+
* still be running and can be ended later.
|
|
3094
|
+
*
|
|
3095
|
+
* Do not return `this`. The Span generally should not be used after it
|
|
3096
|
+
* is ended so chaining is not desired in this context.
|
|
3097
|
+
*
|
|
3098
|
+
* @param [endTime] the time to set as Span's end time. If not provided,
|
|
3099
|
+
* use the current time as the span's end time.
|
|
3100
|
+
*/
|
|
3101
|
+
end(endTime?: TimeInput): void;
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* Returns the flag whether this span will be recorded.
|
|
3105
|
+
*
|
|
3106
|
+
* @returns true if this Span is active and recording information like events
|
|
3107
|
+
* with the `AddEvent` operation and attributes using `setAttributes`.
|
|
3108
|
+
*/
|
|
3109
|
+
isRecording(): boolean;
|
|
3110
|
+
|
|
3111
|
+
/**
|
|
3112
|
+
* Sets exception as a span event
|
|
3113
|
+
* @param exception the exception the only accepted values are string or Error
|
|
3114
|
+
* @param [time] the time to set as Span's event time. If not provided,
|
|
3115
|
+
* use the current time.
|
|
3116
|
+
*/
|
|
3117
|
+
recordException(exception: Exception, time?: TimeInput): void;
|
|
3118
|
+
|
|
3119
|
+
/**
|
|
3120
|
+
* Causally links another span to the current span
|
|
3121
|
+
*
|
|
3122
|
+
* @deprecated In favor of addLink(link: otel.Link). This will be removed in the next major version.
|
|
3123
|
+
* @param {otel.SpanContext} context The context of the span to link to.
|
|
3124
|
+
* @param {SpanAttributes} attributes An optional key value pair of arbitrary values.
|
|
3125
|
+
* @returns {void}
|
|
3126
|
+
*/
|
|
3127
|
+
addLink(context: otel.SpanContext, attributes?: SpanAttributes): void;
|
|
3128
|
+
|
|
3129
|
+
/**
|
|
3130
|
+
* Adds a single link to the span.
|
|
3131
|
+
*
|
|
3132
|
+
* Links added after the creation will not affect the sampling decision.
|
|
3133
|
+
* It is preferred span links be added at span creation.
|
|
3134
|
+
*
|
|
3135
|
+
* @param link the link to add.
|
|
3136
|
+
*/
|
|
3137
|
+
addLink(link: otel.Link): this;
|
|
3138
|
+
|
|
3139
|
+
/**
|
|
3140
|
+
* Adds multiple links to the span.
|
|
3141
|
+
*
|
|
3142
|
+
* Links added after the creation will not affect the sampling decision.
|
|
3143
|
+
* It is preferred span links be added at span creation.
|
|
3144
|
+
*
|
|
3145
|
+
* @param links the links to add.
|
|
3146
|
+
*/
|
|
3147
|
+
addLinks(links: otel.Link[]): this;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* A SpanContext represents the portion of a {@link Span} which must be
|
|
3152
|
+
* serialized and propagated along side of a {@link otel.Baggage}.
|
|
3153
|
+
*/
|
|
3154
|
+
export interface SpanContext extends otel.SpanContext {
|
|
3155
|
+
/**
|
|
3156
|
+
* The ID of the trace that this span belongs to. It is worldwide unique
|
|
3157
|
+
* with practically sufficient probability by being made as 16 randomly
|
|
3158
|
+
* generated bytes, encoded as a 32 lowercase hex characters corresponding to
|
|
3159
|
+
* 128 bits.
|
|
3160
|
+
*/
|
|
3161
|
+
traceId: string;
|
|
3162
|
+
|
|
3163
|
+
/**
|
|
3164
|
+
* The ID of the Span. It is globally unique with practically sufficient
|
|
3165
|
+
* probability by being made as 8 randomly generated bytes, encoded as a 16
|
|
3166
|
+
* lowercase hex characters corresponding to 64 bits.
|
|
3167
|
+
*/
|
|
3168
|
+
spanId: string;
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* Only true if the SpanContext was propagated from a remote parent.
|
|
3172
|
+
*/
|
|
3173
|
+
isRemote?: boolean;
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* Trace flags to propagate.
|
|
3177
|
+
*
|
|
3178
|
+
* It is represented as 1 byte (bitmap). Bit to represent whether trace is
|
|
3179
|
+
* sampled or not. When set, the least significant bit documents that the
|
|
3180
|
+
* caller may have recorded trace data. A caller who does not record trace
|
|
3181
|
+
* data out-of-band leaves this flag unset.
|
|
3182
|
+
*
|
|
3183
|
+
* see {@link otel.TraceFlags} for valid flag values.
|
|
3184
|
+
*/
|
|
3185
|
+
traceFlags: number;
|
|
3186
|
+
|
|
3187
|
+
/**
|
|
3188
|
+
* Tracing-system-specific info to propagate.
|
|
3189
|
+
*
|
|
3190
|
+
* The tracestate field value is a `list` as defined below. The `list` is a
|
|
3191
|
+
* series of `list-members` separated by commas `,`, and a list-member is a
|
|
3192
|
+
* key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
|
|
3193
|
+
* surrounding `list-members` are ignored. There can be a maximum of 32
|
|
3194
|
+
* `list-members` in a `list`.
|
|
3195
|
+
* More Info: https://www.w3.org/TR/trace-context/#tracestate-field
|
|
3196
|
+
*
|
|
3197
|
+
* Examples:
|
|
3198
|
+
* Single tracing system (generic format):
|
|
3199
|
+
* tracestate: rojo=00f067aa0ba902b7
|
|
3200
|
+
* Multiple tracing systems (with different formatting):
|
|
3201
|
+
* tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE
|
|
3202
|
+
*/
|
|
3203
|
+
traceState?: TraceState;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
export type Context = otel.Context;
|
|
3207
|
+
export type Exception = otel.Exception;
|
|
3208
|
+
export type SpanAttributes = otel.SpanAttributes;
|
|
3209
|
+
export type SpanAttributeValue = otel.SpanAttributeValue;
|
|
3210
|
+
export type SpanOptions = otel.SpanOptions;
|
|
3211
|
+
export type SpanStatus = otel.SpanStatus;
|
|
3212
|
+
export type TimeInput = otel.TimeInput;
|
|
3213
|
+
export type TraceState = otel.TraceState;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
/**
|
|
3217
|
+
* Iast configuration used in `tracer` and `tracer.experimental` options
|
|
3218
|
+
*/
|
|
3219
|
+
interface IastOptions {
|
|
3220
|
+
/**
|
|
3221
|
+
* Whether to enable IAST.
|
|
3222
|
+
* @default false
|
|
3223
|
+
* @env DD_IAST_ENABLED
|
|
3224
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3225
|
+
*/
|
|
3226
|
+
enabled?: boolean,
|
|
3227
|
+
|
|
3228
|
+
/**
|
|
3229
|
+
* Controls the percentage of requests that iast will analyze
|
|
3230
|
+
* @default 30
|
|
3231
|
+
* @env DD_IAST_REQUEST_SAMPLING
|
|
3232
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3233
|
+
*/
|
|
3234
|
+
requestSampling?: number,
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Controls how many request can be analyzing code vulnerabilities at the same time
|
|
3238
|
+
* @default 2
|
|
3239
|
+
* @env DD_IAST_MAX_CONCURRENT_REQUESTS
|
|
3240
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3241
|
+
*/
|
|
3242
|
+
maxConcurrentRequests?: number,
|
|
3243
|
+
|
|
3244
|
+
/**
|
|
3245
|
+
* Controls how many code vulnerabilities can be detected in the same request
|
|
3246
|
+
* @default 2
|
|
3247
|
+
* @env DD_IAST_MAX_CONTEXT_OPERATIONS
|
|
3248
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3249
|
+
*/
|
|
3250
|
+
maxContextOperations?: number,
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* Defines the pattern to ignore cookie names in the vulnerability hash calculation
|
|
3254
|
+
* @default ".{32,}"
|
|
3255
|
+
* @deprecated This property has no effect because hash calculation algorithm has been updated for cookie vulnerabilities
|
|
3256
|
+
*/
|
|
3257
|
+
cookieFilterPattern?: string,
|
|
3258
|
+
|
|
3259
|
+
/**
|
|
3260
|
+
* Defines the number of rows to taint in data coming from databases
|
|
3261
|
+
* @default 1
|
|
3262
|
+
* @env DD_IAST_DB_ROWS_TO_TAINT
|
|
3263
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3264
|
+
*/
|
|
3265
|
+
dbRowsToTaint?: number,
|
|
3266
|
+
|
|
3267
|
+
/**
|
|
3268
|
+
* Whether to enable vulnerability deduplication
|
|
3269
|
+
* @env DD_IAST_DEDUPLICATION_ENABLED
|
|
3270
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3271
|
+
*/
|
|
3272
|
+
deduplicationEnabled?: boolean,
|
|
3273
|
+
|
|
3274
|
+
/**
|
|
3275
|
+
* Whether to enable vulnerability redaction
|
|
3276
|
+
* @default true
|
|
3277
|
+
* @env DD_IAST_REDACTION_ENABLED
|
|
3278
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3279
|
+
*/
|
|
3280
|
+
redactionEnabled?: boolean,
|
|
3281
|
+
|
|
3282
|
+
/**
|
|
3283
|
+
* Specifies a regex that will redact sensitive source names in vulnerability reports.
|
|
3284
|
+
* @env DD_IAST_REDACTION_NAME_PATTERN
|
|
3285
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3286
|
+
*/
|
|
3287
|
+
redactionNamePattern?: string,
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* Specifies a regex that will redact sensitive source values in vulnerability reports.
|
|
3291
|
+
* @env DD_IAST_REDACTION_VALUE_PATTERN
|
|
3292
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3293
|
+
*/
|
|
3294
|
+
redactionValuePattern?: string,
|
|
3295
|
+
|
|
3296
|
+
/**
|
|
3297
|
+
* Allows to enable security controls. This option is not supported when
|
|
3298
|
+
* using ESM.
|
|
3299
|
+
* @deprecated Please use the DD_IAST_SECURITY_CONTROLS_CONFIGURATION
|
|
3300
|
+
* environment variable instead.
|
|
3301
|
+
* @env DD_IAST_SECURITY_CONTROLS_CONFIGURATION
|
|
3302
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3303
|
+
*/
|
|
3304
|
+
securityControlsConfiguration?: string,
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* Specifies the verbosity of the sent telemetry. Default 'INFORMATION'
|
|
3308
|
+
* @env DD_IAST_TELEMETRY_VERBOSITY
|
|
3309
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3310
|
+
*/
|
|
3311
|
+
telemetryVerbosity?: string,
|
|
3312
|
+
|
|
3313
|
+
/**
|
|
3314
|
+
* Configuration for stack trace reporting
|
|
3315
|
+
*/
|
|
3316
|
+
stackTrace?: {
|
|
3317
|
+
/** Whether to enable stack trace reporting.
|
|
3318
|
+
* @default true
|
|
3319
|
+
* @env DD_IAST_STACK_TRACE_ENABLED
|
|
3320
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3321
|
+
*/
|
|
3322
|
+
enabled?: boolean,
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
export namespace llmobs {
|
|
3327
|
+
export interface LLMObs {
|
|
3328
|
+
|
|
3329
|
+
/**
|
|
3330
|
+
* Whether or not LLM Observability is enabled.
|
|
3331
|
+
*/
|
|
3332
|
+
enabled: boolean,
|
|
3333
|
+
|
|
3334
|
+
/**
|
|
3335
|
+
* Enable LLM Observability tracing.
|
|
3336
|
+
*/
|
|
3337
|
+
enable (options: LLMObsEnableOptions): void,
|
|
3338
|
+
|
|
3339
|
+
/**
|
|
3340
|
+
* Disable LLM Observability tracing.
|
|
3341
|
+
*/
|
|
3342
|
+
disable (): void,
|
|
3343
|
+
|
|
3344
|
+
/**
|
|
3345
|
+
* Instruments a function by automatically creating a span activated on its
|
|
3346
|
+
* scope.
|
|
3347
|
+
*
|
|
3348
|
+
* The span will automatically be finished when one of these conditions is
|
|
3349
|
+
* met:
|
|
3350
|
+
*
|
|
3351
|
+
* * The function returns a promise, in which case the span will finish when
|
|
3352
|
+
* the promise is resolved or rejected.
|
|
3353
|
+
* * The function takes a callback as its second parameter, in which case the
|
|
3354
|
+
* span will finish when that callback is called.
|
|
3355
|
+
* * The function doesn't accept a callback and doesn't return a promise, in
|
|
3356
|
+
* which case the span will finish at the end of the function execution.
|
|
3357
|
+
* @param fn The function to instrument.
|
|
3358
|
+
* @param options Optional LLM Observability span options.
|
|
3359
|
+
* @returns The return value of the function.
|
|
3360
|
+
*/
|
|
3361
|
+
trace<T> (options: LLMObsNamedSpanOptions, fn: (span: tracer.Span, done: (error?: Error) => void) => T): T
|
|
3362
|
+
|
|
3363
|
+
/**
|
|
3364
|
+
* Wrap a function to automatically create a span activated on its
|
|
3365
|
+
* scope when it's called.
|
|
3366
|
+
*
|
|
3367
|
+
* The span will automatically be finished when one of these conditions is
|
|
3368
|
+
* met:
|
|
3369
|
+
*
|
|
3370
|
+
* * The function returns a promise, in which case the span will finish when
|
|
3371
|
+
* the promise is resolved or rejected.
|
|
3372
|
+
* * The function takes a callback as its last parameter, in which case the
|
|
3373
|
+
* span will finish when that callback is called.
|
|
3374
|
+
* * The function doesn't accept a callback and doesn't return a promise, in
|
|
3375
|
+
* which case the span will finish at the end of the function execution.
|
|
3376
|
+
* @param fn The function to instrument.
|
|
3377
|
+
* @param options Optional LLM Observability span options.
|
|
3378
|
+
* @returns A new function that wraps the provided function with span creation.
|
|
3379
|
+
*/
|
|
3380
|
+
wrap<T = (...args: any[]) => any> (options: LLMObsNamelessSpanOptions, fn: T): T
|
|
3381
|
+
|
|
3382
|
+
/**
|
|
3383
|
+
* Decorate a function in a javascript runtime that supports function decorators.
|
|
3384
|
+
* Note that this is **not** supported in the Node.js runtime, but is in TypeScript.
|
|
3385
|
+
*
|
|
3386
|
+
* In TypeScript, this decorator is only supported in contexts where general TypeScript
|
|
3387
|
+
* function decorators are supported.
|
|
3388
|
+
*
|
|
3389
|
+
* @param options Optional LLM Observability span options.
|
|
3390
|
+
*/
|
|
3391
|
+
decorate (options: llmobs.LLMObsNamelessSpanOptions): any
|
|
3392
|
+
|
|
3393
|
+
/**
|
|
3394
|
+
* Returns a representation of a span to export its span and trace IDs.
|
|
3395
|
+
* If no span is provided, the current LLMObs-type span will be used.
|
|
3396
|
+
* @param span Optional span to export.
|
|
3397
|
+
* @returns An object containing the span and trace IDs.
|
|
3398
|
+
*/
|
|
3399
|
+
exportSpan (span?: tracer.Span): llmobs.ExportedLLMObsSpan
|
|
3400
|
+
|
|
3401
|
+
|
|
3402
|
+
/**
|
|
3403
|
+
* Sets inputs, outputs, tags, metadata, and metrics as provided for a given LLM Observability span.
|
|
3404
|
+
* Note that with the exception of tags, this method will override any existing values for the provided fields.
|
|
3405
|
+
*
|
|
3406
|
+
* For example:
|
|
3407
|
+
* ```javascript
|
|
3408
|
+
* llmobs.trace({ kind: 'llm', name: 'myLLM', modelName: 'gpt-4o', modelProvider: 'openai' }, () => {
|
|
3409
|
+
* llmobs.annotate({
|
|
3410
|
+
* inputData: [{ content: 'system prompt', role: 'system' }, { content: 'user prompt', role: 'user' }],
|
|
3411
|
+
* outputData: { content: 'response', role: 'ai' },
|
|
3412
|
+
* metadata: { temperature: 0.7 },
|
|
3413
|
+
* tags: { host: 'localhost' },
|
|
3414
|
+
* metrics: { inputTokens: 10, outputTokens: 20, totalTokens: 30 }
|
|
3415
|
+
* })
|
|
3416
|
+
* })
|
|
3417
|
+
* ```
|
|
3418
|
+
*
|
|
3419
|
+
* @param span The span to annotate (defaults to the current LLM Observability span if not provided)
|
|
3420
|
+
* @param options An object containing the inputs, outputs, tags, metadata, and metrics to set on the span.
|
|
3421
|
+
*/
|
|
3422
|
+
annotate (options: llmobs.AnnotationOptions): void
|
|
3423
|
+
annotate (span: tracer.Span | undefined, options: llmobs.AnnotationOptions): void
|
|
3424
|
+
|
|
3425
|
+
/**
|
|
3426
|
+
* Register a processor to be called on each LLMObs span.
|
|
3427
|
+
*
|
|
3428
|
+
* This can be used to modify the span before it is sent to LLMObs. For example, you can modify the input/output.
|
|
3429
|
+
* You can also return `null` to omit the span entirely from being sent to LLM Observability.
|
|
3430
|
+
*
|
|
3431
|
+
* Otherwise, if the return value from the processor is not an instance of `LLMObservabilitySpan`, the span will be dropped.
|
|
3432
|
+
*
|
|
3433
|
+
* To deregister the processor, call `llmobs.deregisterProcessor()`
|
|
3434
|
+
* @param processor A function that will be called for each span.
|
|
3435
|
+
* @throws {Error} If a processor is already registered.
|
|
3436
|
+
*/
|
|
3437
|
+
registerProcessor (processor: ((span: LLMObservabilitySpan) => LLMObservabilitySpan | null)): void
|
|
3438
|
+
|
|
3439
|
+
/**
|
|
3440
|
+
* Deregister a processor.
|
|
3441
|
+
*/
|
|
3442
|
+
deregisterProcessor (): void
|
|
3443
|
+
|
|
3444
|
+
/**
|
|
3445
|
+
* Submits a custom evaluation metric for a given span ID and trace ID.
|
|
3446
|
+
* @param spanContext The span context of the span to submit the evaluation metric for.
|
|
3447
|
+
* @param options An object containing the label, metric type, value, and tags of the evaluation metric.
|
|
3448
|
+
*/
|
|
3449
|
+
submitEvaluation (spanContext: llmobs.ExportedLLMObsSpan, options: llmobs.EvaluationOptions): void
|
|
3450
|
+
|
|
3451
|
+
|
|
3452
|
+
/**
|
|
3453
|
+
* Annotates all spans, including auto-instrumented spans, with the provided tags created in the context of the callback function.
|
|
3454
|
+
* @param options The annotation context options.
|
|
3455
|
+
* @param fn The callback over which to apply the annotation context options.
|
|
3456
|
+
* @returns The result of the function.
|
|
3457
|
+
*/
|
|
3458
|
+
annotationContext<T> (options: llmobs.AnnotationContextOptions, fn: () => T): T
|
|
3459
|
+
|
|
3460
|
+
/**
|
|
3461
|
+
* Execute a function within a routing context, directing all LLMObs spans to a specific Datadog organization.
|
|
3462
|
+
* @param options The routing context options containing the target API key and optional site.
|
|
3463
|
+
* @param fn The callback over which to apply the routing context.
|
|
3464
|
+
* @returns The result of the function.
|
|
3465
|
+
*/
|
|
3466
|
+
routingContext<T> (options: llmobs.RoutingContextOptions, fn: () => T): T
|
|
3467
|
+
|
|
3468
|
+
/**
|
|
3469
|
+
* Flushes any remaining spans and evaluation metrics to LLM Observability.
|
|
3470
|
+
*/
|
|
3471
|
+
flush (): void
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
interface LLMObservabilitySpan {
|
|
3475
|
+
/**
|
|
3476
|
+
* The input content associated with the span.
|
|
3477
|
+
*/
|
|
3478
|
+
input: { content: string, role?: string }[]
|
|
3479
|
+
|
|
3480
|
+
/**
|
|
3481
|
+
* The output content associated with the span.
|
|
3482
|
+
*/
|
|
3483
|
+
output: { content: string, role?: string }[]
|
|
3484
|
+
|
|
3485
|
+
/**
|
|
3486
|
+
* Get a tag from the span.
|
|
3487
|
+
* @param key The key of the tag to get.
|
|
3488
|
+
* @returns The value of the tag, or `undefined` if the tag does not exist.
|
|
3489
|
+
*/
|
|
3490
|
+
getTag (key: string): string | undefined
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
interface EvaluationOptions {
|
|
3494
|
+
/**
|
|
3495
|
+
* The name of the evaluation metric
|
|
3496
|
+
*/
|
|
3497
|
+
label: string,
|
|
3498
|
+
|
|
3499
|
+
/**
|
|
3500
|
+
* The type of evaluation metric, one of 'categorical', 'score', or 'boolean'
|
|
3501
|
+
*/
|
|
3502
|
+
metricType: 'categorical' | 'score' | 'boolean' | 'json',
|
|
3503
|
+
|
|
3504
|
+
/**
|
|
3505
|
+
* The value of the evaluation metric.
|
|
3506
|
+
* Must be string for 'categorical' metrics, number for 'score' metrics, boolean for 'boolean' metrics and a JSON object for 'json' metrics.
|
|
3507
|
+
*/
|
|
3508
|
+
value: string | number | boolean | { [key: string]: any },
|
|
3509
|
+
|
|
3510
|
+
/**
|
|
3511
|
+
* An object of string key-value pairs to tag the evaluation metric with.
|
|
3512
|
+
*/
|
|
3513
|
+
tags?: { [key: string]: any },
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* The name of the ML application
|
|
3517
|
+
*/
|
|
3518
|
+
mlApp?: string,
|
|
3519
|
+
|
|
3520
|
+
/**
|
|
3521
|
+
* The timestamp in milliseconds when the evaluation metric result was generated.
|
|
3522
|
+
*/
|
|
3523
|
+
timestampMs?: number
|
|
3524
|
+
|
|
3525
|
+
/**
|
|
3526
|
+
* Reasoning for the evaluation result.
|
|
3527
|
+
*/
|
|
3528
|
+
reasoning?: string,
|
|
3529
|
+
|
|
3530
|
+
/**
|
|
3531
|
+
* Whether the evaluation passed or failed. Valid values are pass and fail.
|
|
3532
|
+
*/
|
|
3533
|
+
assessment?: 'pass' | 'fail',
|
|
3534
|
+
|
|
3535
|
+
/**
|
|
3536
|
+
* Arbitrary JSON data associated with the evaluation.
|
|
3537
|
+
*/
|
|
3538
|
+
metadata?: { [key: string]: any }
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
interface Document {
|
|
3542
|
+
/**
|
|
3543
|
+
* Document text
|
|
3544
|
+
*/
|
|
3545
|
+
text?: string,
|
|
3546
|
+
|
|
3547
|
+
/**
|
|
3548
|
+
* Document name
|
|
3549
|
+
*/
|
|
3550
|
+
name?: string,
|
|
3551
|
+
|
|
3552
|
+
/**
|
|
3553
|
+
* Document ID
|
|
3554
|
+
*/
|
|
3555
|
+
id?: string,
|
|
3556
|
+
|
|
3557
|
+
/**
|
|
3558
|
+
* Score of the document retrieval as a source of ground truth
|
|
3559
|
+
*/
|
|
3560
|
+
score?: number
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
/**
|
|
3564
|
+
* Represents a single LLM chat model message
|
|
3565
|
+
*/
|
|
3566
|
+
interface Message {
|
|
3567
|
+
/**
|
|
3568
|
+
* Content of the message.
|
|
3569
|
+
*/
|
|
3570
|
+
content: string,
|
|
3571
|
+
|
|
3572
|
+
/**
|
|
3573
|
+
* Role of the message (ie system, user, ai)
|
|
3574
|
+
*/
|
|
3575
|
+
role?: string,
|
|
3576
|
+
|
|
3577
|
+
/**
|
|
3578
|
+
* Tool calls of the message
|
|
3579
|
+
*/
|
|
3580
|
+
toolCalls?: ToolCall[],
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3583
|
+
/**
|
|
3584
|
+
* Represents a single tool call for an LLM chat model message
|
|
3585
|
+
*/
|
|
3586
|
+
interface ToolCall {
|
|
3587
|
+
/**
|
|
3588
|
+
* Name of the tool
|
|
3589
|
+
*/
|
|
3590
|
+
name?: string,
|
|
3591
|
+
|
|
3592
|
+
/**
|
|
3593
|
+
* Arguments passed to the tool
|
|
3594
|
+
*/
|
|
3595
|
+
arguments?: { [key: string]: any },
|
|
3596
|
+
|
|
3597
|
+
/**
|
|
3598
|
+
* The tool ID
|
|
3599
|
+
*/
|
|
3600
|
+
toolId?: string,
|
|
3601
|
+
|
|
3602
|
+
/**
|
|
3603
|
+
* The tool type
|
|
3604
|
+
*/
|
|
3605
|
+
type?: string
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
/**
|
|
3609
|
+
* A Prompt object that represents the prompt template used for an LLM call.
|
|
3610
|
+
* Used to power LLM Observability prompts and hallucination evaluations.
|
|
3611
|
+
*/
|
|
3612
|
+
interface Prompt {
|
|
3613
|
+
/**
|
|
3614
|
+
* Version of the prompt
|
|
3615
|
+
*/
|
|
3616
|
+
version?: string,
|
|
3617
|
+
|
|
3618
|
+
|
|
3619
|
+
/**
|
|
3620
|
+
* The id of the prompt set by the user. Should be unique per mlApp.
|
|
3621
|
+
*/
|
|
3622
|
+
id?: string,
|
|
3623
|
+
|
|
3624
|
+
/**
|
|
3625
|
+
* An object of string key-value pairs that will be used to render the prompt
|
|
3626
|
+
*/
|
|
3627
|
+
variables?: Record<string, string>,
|
|
3628
|
+
|
|
3629
|
+
/**
|
|
3630
|
+
* List of tags to add to the prompt run.
|
|
3631
|
+
*/
|
|
3632
|
+
tags?: Record<string, string>,
|
|
3633
|
+
|
|
3634
|
+
|
|
3635
|
+
/**
|
|
3636
|
+
* A list of variable key names that contains query information
|
|
3637
|
+
*/
|
|
3638
|
+
queryVariables?: string[],
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* A list of variable key names that contain ground truth context information.
|
|
3642
|
+
*/
|
|
3643
|
+
contextVariables?: string[],
|
|
3644
|
+
|
|
3645
|
+
/**
|
|
3646
|
+
* A template string or chat message template list.
|
|
3647
|
+
*/
|
|
3648
|
+
template?: string | Message[]
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* Annotation options for LLM Observability spans.
|
|
3653
|
+
*/
|
|
3654
|
+
interface AnnotationOptions {
|
|
3655
|
+
/**
|
|
3656
|
+
* A single input string, object, or a list of objects based on the span kind:
|
|
3657
|
+
* 1. LLM spans: accepts a string, or an object of the form {content: "...", role: "..."}, or a list of objects with the same signature.
|
|
3658
|
+
* 2. Embedding spans: accepts a string, list of strings, or an object of the form {text: "...", ...}, or a list of objects with the same signature.
|
|
3659
|
+
* 3. Other: any JSON serializable type
|
|
3660
|
+
*/
|
|
3661
|
+
inputData?: string | Message | Message[] | Document | Document[] | { [key: string]: any },
|
|
3662
|
+
|
|
3663
|
+
/**
|
|
3664
|
+
* A single output string, object, or a list of objects based on the span kind:
|
|
3665
|
+
* 1. LLM spans: accepts a string, or an object of the form {content: "...", role: "..."}, or a list of objects with the same signature.
|
|
3666
|
+
* 2. Retrieval spans: An object containing any of the key value pairs {name: str, id: str, text: str, source: number} or a list of dictionaries with the same signature.
|
|
3667
|
+
* 3. Other: any JSON serializable type
|
|
3668
|
+
*/
|
|
3669
|
+
outputData?: string | Message | Message[] | Document | Document[] | { [key: string]: any },
|
|
3670
|
+
|
|
3671
|
+
/**
|
|
3672
|
+
* Object of JSON serializable key-value metadata pairs relevant to the input/output operation described by the LLM Observability span.
|
|
3673
|
+
*/
|
|
3674
|
+
metadata?: { [key: string]: any },
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Object of JSON serializable key-value metrics (number) pairs, such as `{input,output,total}Tokens`
|
|
3678
|
+
*/
|
|
3679
|
+
metrics?: { [key: string]: number },
|
|
3680
|
+
|
|
3681
|
+
/**
|
|
3682
|
+
* Object of JSON serializable key-value tag pairs to set or update on the LLM Observability span regarding the span's context.
|
|
3683
|
+
*/
|
|
3684
|
+
tags?: { [key: string]: any },
|
|
3685
|
+
|
|
3686
|
+
/**
|
|
3687
|
+
* A Prompt object that represents the prompt used for an LLM call. Only used on `llm` spans.
|
|
3688
|
+
*/
|
|
3689
|
+
prompt?: Prompt,
|
|
3690
|
+
}
|
|
3691
|
+
|
|
3692
|
+
interface AnnotationContextOptions {
|
|
3693
|
+
/**
|
|
3694
|
+
* Dictionary of JSON serializable key-value tag pairs to set or update on the LLMObs span regarding the span's context.
|
|
3695
|
+
*/
|
|
3696
|
+
tags?: { [key: string]: any },
|
|
3697
|
+
|
|
3698
|
+
/**
|
|
3699
|
+
* Set to override the span name for any spans annotated within the returned context.
|
|
3700
|
+
*/
|
|
3701
|
+
name?: string,
|
|
3702
|
+
|
|
3703
|
+
/**
|
|
3704
|
+
* A Prompt object that represents the prompt used for an LLM call. Only used on `llm` spans.
|
|
3705
|
+
*/
|
|
3706
|
+
prompt?: Prompt,
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
interface RoutingContextOptions {
|
|
3710
|
+
/**
|
|
3711
|
+
* The Datadog API key for the target organization.
|
|
3712
|
+
*/
|
|
3713
|
+
ddApiKey: string,
|
|
3714
|
+
|
|
3715
|
+
/**
|
|
3716
|
+
* The Datadog site for the target organization (e.g., 'datadoghq.eu').
|
|
3717
|
+
*/
|
|
3718
|
+
ddSite?: string,
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
/**
|
|
3722
|
+
* An object containing the span ID and trace ID of interest
|
|
3723
|
+
*/
|
|
3724
|
+
interface ExportedLLMObsSpan {
|
|
3725
|
+
/**
|
|
3726
|
+
* Trace ID associated with the span of interest
|
|
3727
|
+
*/
|
|
3728
|
+
traceId: string,
|
|
3729
|
+
|
|
3730
|
+
/**
|
|
3731
|
+
* Span ID associated with the span of interest
|
|
3732
|
+
*/
|
|
3733
|
+
spanId: string,
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
interface LLMObsSpanOptions extends SpanOptions {
|
|
3737
|
+
/**
|
|
3738
|
+
* LLM Observability span kind. One of `agent`, `workflow`, `task`, `tool`, `retrieval`, `embedding`, or `llm`.
|
|
3739
|
+
*/
|
|
3740
|
+
kind: llmobs.spanKind,
|
|
3741
|
+
|
|
3742
|
+
/**
|
|
3743
|
+
* The ID of the underlying user session. Required for tracking sessions.
|
|
3744
|
+
*/
|
|
3745
|
+
sessionId?: string,
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* The name of the ML application that the agent is orchestrating.
|
|
3749
|
+
* If not provided, the default value will be set to mlApp provided during initialization, or `DD_LLMOBS_ML_APP`.
|
|
3750
|
+
* @env DD_LLMOBS_ML_APP
|
|
3751
|
+
*/
|
|
3752
|
+
mlApp?: string,
|
|
3753
|
+
|
|
3754
|
+
/**
|
|
3755
|
+
* The name of the invoked LLM or embedding model. Only used on `llm` and `embedding` spans.
|
|
3756
|
+
*/
|
|
3757
|
+
modelName?: string,
|
|
3758
|
+
|
|
3759
|
+
/**
|
|
3760
|
+
* The name of the invoked LLM or embedding model provider. Only used on `llm` and `embedding` spans.
|
|
3761
|
+
* If not provided for LLM or embedding spans, a default value of 'custom' will be set.
|
|
3762
|
+
*/
|
|
3763
|
+
modelProvider?: string,
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
interface LLMObsNamedSpanOptions extends LLMObsSpanOptions {
|
|
3767
|
+
/**
|
|
3768
|
+
* The name of the traced operation. This is a required option.
|
|
3769
|
+
*/
|
|
3770
|
+
name: string,
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
interface LLMObsNamelessSpanOptions extends LLMObsSpanOptions {
|
|
3774
|
+
/**
|
|
3775
|
+
* The name of the traced operation.
|
|
3776
|
+
*/
|
|
3777
|
+
name?: string,
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
/**
|
|
3781
|
+
* Options for enabling LLM Observability tracing.
|
|
3782
|
+
*/
|
|
3783
|
+
interface LLMObsEnableOptions {
|
|
3784
|
+
/**
|
|
3785
|
+
* The name of your ML application.
|
|
3786
|
+
* @env DD_LLMOBS_ML_APP
|
|
3787
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3788
|
+
*/
|
|
3789
|
+
mlApp?: string,
|
|
3790
|
+
|
|
3791
|
+
/**
|
|
3792
|
+
* Set to `true` to disable sending data that requires a Datadog Agent.
|
|
3793
|
+
* @env DD_LLMOBS_AGENTLESS_ENABLED
|
|
3794
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
3795
|
+
*/
|
|
3796
|
+
agentlessEnabled?: boolean,
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
/** @hidden */
|
|
3800
|
+
type spanKind = 'agent' | 'workflow' | 'task' | 'tool' | 'retrieval' | 'embedding' | 'llm'
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
/**
|
|
3805
|
+
* Singleton returned by the module. It has to be initialized before it will
|
|
3806
|
+
* start tracing. If not initialized, or initialized and disabled, it will use
|
|
3807
|
+
* a no-op implementation.
|
|
3808
|
+
*/
|
|
3809
|
+
declare const tracer: Tracer;
|
|
3810
|
+
|
|
3811
|
+
export = tracer;
|