dd-trace 5.101.0 → 5.103.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/ext/exporters.js +1 -0
- package/package.json +20 -17
- package/packages/datadog-esbuild/src/utils.js +2 -2
- package/packages/datadog-instrumentations/src/aerospike.js +2 -2
- package/packages/datadog-instrumentations/src/ai.js +9 -9
- package/packages/datadog-instrumentations/src/amqplib.js +6 -7
- package/packages/datadog-instrumentations/src/anthropic.js +10 -10
- package/packages/datadog-instrumentations/src/apollo-server-core.js +3 -3
- package/packages/datadog-instrumentations/src/apollo-server.js +5 -5
- package/packages/datadog-instrumentations/src/avsc.js +6 -6
- package/packages/datadog-instrumentations/src/aws-sdk.js +151 -67
- package/packages/datadog-instrumentations/src/azure-durable-functions.js +8 -8
- package/packages/datadog-instrumentations/src/bluebird.js +2 -2
- package/packages/datadog-instrumentations/src/body-parser.js +2 -2
- package/packages/datadog-instrumentations/src/cassandra-driver.js +7 -7
- package/packages/datadog-instrumentations/src/child_process.js +12 -12
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +41 -24
- package/packages/datadog-instrumentations/src/connect.js +7 -7
- package/packages/datadog-instrumentations/src/cookie-parser.js +4 -4
- package/packages/datadog-instrumentations/src/cookie.js +2 -2
- package/packages/datadog-instrumentations/src/couchbase.js +73 -238
- package/packages/datadog-instrumentations/src/crypto.js +4 -4
- package/packages/datadog-instrumentations/src/cucumber.js +78 -17
- package/packages/datadog-instrumentations/src/dns.js +0 -3
- package/packages/datadog-instrumentations/src/elasticsearch.js +8 -11
- package/packages/datadog-instrumentations/src/electron/preload.js +42 -0
- package/packages/datadog-instrumentations/src/electron.js +240 -0
- package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +6 -6
- package/packages/datadog-instrumentations/src/express-session.js +4 -4
- package/packages/datadog-instrumentations/src/express.js +10 -11
- package/packages/datadog-instrumentations/src/fastify.js +2 -2
- package/packages/datadog-instrumentations/src/fetch.js +5 -5
- package/packages/datadog-instrumentations/src/fs.js +14 -14
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +5 -7
- package/packages/datadog-instrumentations/src/google-genai.js +4 -4
- package/packages/datadog-instrumentations/src/graphql.js +13 -12
- package/packages/datadog-instrumentations/src/grpc/server.js +2 -2
- package/packages/datadog-instrumentations/src/hapi.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/callback-instrumentor.js +9 -9
- package/packages/datadog-instrumentations/src/helpers/hook.js +4 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/kafka.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/promise.js +2 -2
- package/packages/datadog-instrumentations/src/hono.js +2 -2
- package/packages/datadog-instrumentations/src/http/client.js +6 -6
- package/packages/datadog-instrumentations/src/http/server.js +9 -9
- package/packages/datadog-instrumentations/src/ioredis.js +16 -12
- package/packages/datadog-instrumentations/src/jest.js +382 -81
- package/packages/datadog-instrumentations/src/kafkajs.js +165 -174
- package/packages/datadog-instrumentations/src/knex.js +17 -17
- package/packages/datadog-instrumentations/src/koa.js +12 -12
- package/packages/datadog-instrumentations/src/ldapjs.js +5 -5
- package/packages/datadog-instrumentations/src/light-my-request.js +2 -2
- package/packages/datadog-instrumentations/src/limitd-client.js +4 -4
- package/packages/datadog-instrumentations/src/lodash.js +4 -4
- package/packages/datadog-instrumentations/src/mariadb.js +13 -13
- package/packages/datadog-instrumentations/src/memcached.js +2 -2
- package/packages/datadog-instrumentations/src/microgateway-core.js +2 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +3 -3
- package/packages/datadog-instrumentations/src/mocha/main.js +85 -11
- package/packages/datadog-instrumentations/src/mocha/utils.js +133 -16
- package/packages/datadog-instrumentations/src/mocha/worker.js +7 -5
- package/packages/datadog-instrumentations/src/mongodb-core.js +42 -30
- package/packages/datadog-instrumentations/src/mongodb.js +5 -5
- package/packages/datadog-instrumentations/src/mongoose.js +21 -21
- package/packages/datadog-instrumentations/src/mquery.js +5 -5
- package/packages/datadog-instrumentations/src/multer.js +4 -4
- package/packages/datadog-instrumentations/src/mysql.js +16 -16
- package/packages/datadog-instrumentations/src/mysql2.js +4 -4
- package/packages/datadog-instrumentations/src/net.js +14 -8
- package/packages/datadog-instrumentations/src/nyc.js +5 -5
- package/packages/datadog-instrumentations/src/openai.js +19 -19
- package/packages/datadog-instrumentations/src/oracledb.js +6 -6
- package/packages/datadog-instrumentations/src/passport-utils.js +5 -5
- package/packages/datadog-instrumentations/src/pg.js +39 -25
- package/packages/datadog-instrumentations/src/pino.js +6 -10
- package/packages/datadog-instrumentations/src/playwright.js +445 -68
- package/packages/datadog-instrumentations/src/protobufjs.js +16 -16
- package/packages/datadog-instrumentations/src/redis.js +20 -12
- package/packages/datadog-instrumentations/src/restify.js +2 -2
- package/packages/datadog-instrumentations/src/router.js +12 -12
- package/packages/datadog-instrumentations/src/stripe.js +12 -12
- package/packages/datadog-instrumentations/src/vitest.js +107 -26
- package/packages/datadog-instrumentations/src/winston.js +4 -4
- package/packages/datadog-instrumentations/src/ws.js +7 -7
- package/packages/datadog-plugin-apollo/src/gateway/request.js +1 -21
- package/packages/datadog-plugin-aws-sdk/src/base.js +70 -28
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +20 -13
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +46 -36
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +34 -23
- package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/s3.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +14 -15
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +74 -55
- package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +20 -18
- package/packages/datadog-plugin-aws-sdk/src/util.js +22 -0
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +6 -6
- package/packages/datadog-plugin-couchbase/src/index.js +58 -52
- package/packages/datadog-plugin-cucumber/src/index.js +5 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +215 -26
- package/packages/datadog-plugin-cypress/src/support.js +13 -1
- package/packages/datadog-plugin-electron/src/index.js +17 -0
- package/packages/datadog-plugin-electron/src/ipc.js +143 -0
- package/packages/datadog-plugin-electron/src/net.js +82 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +1 -5
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +27 -18
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +3 -1
- package/packages/datadog-plugin-graphql/src/execute.js +6 -28
- package/packages/datadog-plugin-graphql/src/resolve.js +30 -35
- package/packages/datadog-plugin-graphql/src/tools/signature.js +32 -7
- package/packages/datadog-plugin-graphql/src/tools/transforms.js +118 -100
- package/packages/datadog-plugin-graphql/src/utils.js +29 -0
- package/packages/datadog-plugin-grpc/src/client.js +6 -7
- package/packages/datadog-plugin-grpc/src/util.js +57 -22
- package/packages/datadog-plugin-http/src/client.js +3 -7
- package/packages/datadog-plugin-jest/src/index.js +92 -50
- package/packages/datadog-plugin-jest/src/util.js +1 -2
- package/packages/datadog-plugin-mocha/src/index.js +5 -0
- package/packages/datadog-plugin-mongodb-core/src/index.js +36 -69
- package/packages/datadog-plugin-mysql/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/services.js +2 -1
- package/packages/datadog-plugin-openai/src/tracing.js +12 -23
- package/packages/datadog-plugin-pg/src/index.js +3 -3
- package/packages/datadog-plugin-playwright/src/index.js +5 -1
- package/packages/datadog-plugin-redis/src/index.js +18 -23
- package/packages/datadog-plugin-vitest/src/index.js +8 -1
- package/packages/datadog-shimmer/src/shimmer.js +7 -1
- package/packages/dd-trace/src/aiguard/index.js +3 -1
- package/packages/dd-trace/src/aiguard/sdk.js +36 -30
- package/packages/dd-trace/src/aiguard/tags.js +20 -11
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +81 -81
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +2 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugins/kafka.js +2 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +4 -4
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +1 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +83 -48
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
- package/packages/dd-trace/src/appsec/index.js +21 -24
- package/packages/dd-trace/src/appsec/reporter.js +3 -1
- package/packages/dd-trace/src/appsec/rule_manager.js +4 -2
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +31 -16
- package/packages/dd-trace/src/azure_metadata.js +17 -6
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +4 -4
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +4 -2
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +6 -4
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +1 -1
- package/packages/dd-trace/src/config/defaults.js +3 -14
- package/packages/dd-trace/src/config/generated-config-types.d.ts +3 -1
- package/packages/dd-trace/src/config/git_properties.js +2 -2
- package/packages/dd-trace/src/config/helper.js +4 -0
- package/packages/dd-trace/src/config/index.js +2 -2
- package/packages/dd-trace/src/config/major-overrides.js +98 -0
- package/packages/dd-trace/src/config/parsers.js +7 -1
- package/packages/dd-trace/src/config/supported-configurations.json +51 -38
- package/packages/dd-trace/src/datastreams/checkpointer.js +2 -2
- package/packages/dd-trace/src/datastreams/index.js +2 -1
- package/packages/dd-trace/src/datastreams/manager.js +1 -1
- package/packages/dd-trace/src/datastreams/processor.js +3 -4
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +2 -2
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/state.js +2 -1
- package/packages/dd-trace/src/debugger/index.js +7 -7
- package/packages/dd-trace/src/dogstatsd.js +2 -2
- package/packages/dd-trace/src/encode/0.4.js +748 -232
- package/packages/dd-trace/src/encode/0.5.js +47 -10
- package/packages/dd-trace/src/encode/agentless-json.js +1 -1
- package/packages/dd-trace/src/exporter.js +2 -0
- package/packages/dd-trace/src/exporters/agent/index.js +2 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +3 -2
- package/packages/dd-trace/src/exporters/agentless/writer.js +2 -2
- package/packages/dd-trace/src/exporters/common/buffering-exporter.js +2 -1
- package/packages/dd-trace/src/exporters/common/request.js +1 -1
- package/packages/dd-trace/src/exporters/electron/index.js +49 -0
- package/packages/dd-trace/src/external-logger/src/index.js +2 -1
- package/packages/dd-trace/src/git_metadata.js +10 -8
- package/packages/dd-trace/src/lambda/handler-paths.js +52 -0
- package/packages/dd-trace/src/lambda/index.js +62 -14
- package/packages/dd-trace/src/lambda/runtime/patch.js +21 -46
- package/packages/dd-trace/src/llmobs/index.js +13 -2
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +1 -2
- package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +45 -15
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +6 -3
- package/packages/dd-trace/src/llmobs/sdk.js +24 -26
- package/packages/dd-trace/src/llmobs/span_processor.js +25 -5
- package/packages/dd-trace/src/llmobs/util.js +1 -0
- package/packages/dd-trace/src/llmobs/writers/base.js +2 -1
- package/packages/dd-trace/src/msgpack/chunk.js +6 -3
- package/packages/dd-trace/src/openfeature/noop.js +40 -36
- package/packages/dd-trace/src/openfeature/writers/base.js +2 -1
- package/packages/dd-trace/src/openfeature/writers/exposures.js +33 -52
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +2 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +1 -2
- package/packages/dd-trace/src/opentelemetry/tracer.js +0 -22
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +20 -9
- package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +2 -11
- package/packages/dd-trace/src/payload-tagging/config/index.js +2 -2
- package/packages/dd-trace/src/plugins/ci_plugin.js +49 -4
- package/packages/dd-trace/src/plugins/database.js +54 -12
- package/packages/dd-trace/src/plugins/index.js +1 -0
- package/packages/dd-trace/src/plugins/plugin.js +2 -4
- package/packages/dd-trace/src/plugins/util/ci.js +9 -9
- package/packages/dd-trace/src/plugins/util/git-cache.js +23 -23
- package/packages/dd-trace/src/plugins/util/stacktrace.js +2 -2
- package/packages/dd-trace/src/plugins/util/test.js +56 -12
- package/packages/dd-trace/src/plugins/util/url.js +1 -3
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +18 -16
- package/packages/dd-trace/src/plugins/util/web.js +5 -7
- package/packages/dd-trace/src/priority_sampler.js +1 -1
- package/packages/dd-trace/src/profiling/profiler.js +1 -1
- package/packages/dd-trace/src/profiling/profilers/events.js +3 -23
- package/packages/dd-trace/src/profiling/profilers/wall.js +5 -6
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +1 -1
- package/packages/dd-trace/src/rate_limiter.js +1 -1
- package/packages/dd-trace/src/remote_config/scheduler.js +1 -1
- package/packages/dd-trace/src/ritm.js +2 -1
- package/packages/dd-trace/src/runtime_metrics/index.js +2 -2
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +5 -8
- package/packages/dd-trace/src/scope.js +3 -10
- package/packages/dd-trace/src/serverless.js +6 -6
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +27 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +24 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
- package/packages/dd-trace/src/span_stats.js +1 -1
- package/packages/dd-trace/src/telemetry/dependencies.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +1 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +2 -2
- package/packages/dd-trace/src/tracer.js +7 -7
- package/packages/dd-trace/src/lambda/runtime/ritm.js +0 -133
|
@@ -243,9 +243,11 @@ function formatContentObject (content) {
|
|
|
243
243
|
let functionResponses
|
|
244
244
|
for (const part of parts) {
|
|
245
245
|
if (part.functionCall) {
|
|
246
|
-
|
|
246
|
+
functionCalls ??= []
|
|
247
|
+
functionCalls.push(part)
|
|
247
248
|
} else if (part.functionResponse) {
|
|
248
|
-
|
|
249
|
+
functionResponses ??= []
|
|
250
|
+
functionResponses.push(part)
|
|
249
251
|
}
|
|
250
252
|
}
|
|
251
253
|
|
|
@@ -341,7 +343,8 @@ function formatNonStreamingCandidate (candidate) {
|
|
|
341
343
|
let codeExecutionResult
|
|
342
344
|
for (const part of parts) {
|
|
343
345
|
if (part.functionCall) {
|
|
344
|
-
|
|
346
|
+
functionCalls ??= []
|
|
347
|
+
functionCalls.push(part)
|
|
345
348
|
} else if (!executableCode && part.executableCode) {
|
|
346
349
|
executableCode = part
|
|
347
350
|
} else if (!codeExecutionResult && part.codeExecutionResult) {
|
|
@@ -112,16 +112,16 @@ class LLMObs extends NoopLLMObs {
|
|
|
112
112
|
const {
|
|
113
113
|
spanOptions,
|
|
114
114
|
...llmobsOptions
|
|
115
|
-
} = this
|
|
115
|
+
} = this.#extractOptions(options)
|
|
116
116
|
|
|
117
117
|
if (fn.length > 1) {
|
|
118
118
|
return this._tracer.trace(name, spanOptions, (span, cb) =>
|
|
119
|
-
this
|
|
119
|
+
this.#activate(span, { kind, ...llmobsOptions }, () => fn(span, cb))
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
return this._tracer.trace(name, spanOptions, span =>
|
|
124
|
-
this
|
|
124
|
+
this.#activate(span, { kind, ...llmobsOptions }, () => fn(span))
|
|
125
125
|
)
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -142,53 +142,53 @@ class LLMObs extends NoopLLMObs {
|
|
|
142
142
|
const {
|
|
143
143
|
spanOptions,
|
|
144
144
|
...llmobsOptions
|
|
145
|
-
} = this
|
|
145
|
+
} = this.#extractOptions(options)
|
|
146
146
|
|
|
147
147
|
const llmobs = this
|
|
148
148
|
|
|
149
|
-
function wrapped () {
|
|
149
|
+
function wrapped (...args) {
|
|
150
150
|
telemetry.incrementLLMObsSpanStartCount({ autoinstrumented: false, kind })
|
|
151
151
|
|
|
152
152
|
const span = llmobs._tracer.scope().active()
|
|
153
|
-
const fnArgs =
|
|
153
|
+
const fnArgs = args
|
|
154
154
|
|
|
155
155
|
const lastArgId = fnArgs.length - 1
|
|
156
156
|
const cb = fnArgs[lastArgId]
|
|
157
157
|
const hasCallback = typeof cb === 'function'
|
|
158
158
|
|
|
159
159
|
if (hasCallback) {
|
|
160
|
-
const scopeBoundCb = llmobs
|
|
161
|
-
fnArgs[lastArgId] = function () {
|
|
160
|
+
const scopeBoundCb = llmobs.#bind(cb)
|
|
161
|
+
fnArgs[lastArgId] = function (...args) {
|
|
162
162
|
// it is standard practice to follow the callback signature (err, result)
|
|
163
163
|
// however, we try to parse the arguments to determine if the first argument is an error
|
|
164
164
|
// if it is not, and is not undefined, we will use that for the output value
|
|
165
|
-
const maybeError =
|
|
166
|
-
const maybeResult =
|
|
165
|
+
const maybeError = args[0]
|
|
166
|
+
const maybeResult = args[1]
|
|
167
167
|
|
|
168
|
-
llmobs
|
|
168
|
+
llmobs.#autoAnnotate(
|
|
169
169
|
span,
|
|
170
170
|
kind,
|
|
171
171
|
getFunctionArguments(fn, fnArgs),
|
|
172
172
|
isError(maybeError) || maybeError == null ? maybeResult : maybeError
|
|
173
173
|
)
|
|
174
174
|
|
|
175
|
-
return scopeBoundCb.apply(this,
|
|
175
|
+
return scopeBoundCb.apply(this, args)
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
try {
|
|
180
|
-
const result = llmobs
|
|
180
|
+
const result = llmobs.#activate(span, { kind, ...llmobsOptions }, () => fn.apply(this, fnArgs))
|
|
181
181
|
|
|
182
182
|
if (result && typeof result.then === 'function') {
|
|
183
183
|
return result.then(
|
|
184
184
|
value => {
|
|
185
185
|
if (!hasCallback) {
|
|
186
|
-
llmobs
|
|
186
|
+
llmobs.#autoAnnotate(span, kind, getFunctionArguments(fn, fnArgs), value)
|
|
187
187
|
}
|
|
188
188
|
return value
|
|
189
189
|
},
|
|
190
190
|
err => {
|
|
191
|
-
llmobs
|
|
191
|
+
llmobs.#autoAnnotate(span, kind, getFunctionArguments(fn, fnArgs))
|
|
192
192
|
throw err
|
|
193
193
|
}
|
|
194
194
|
)
|
|
@@ -199,12 +199,12 @@ class LLMObs extends NoopLLMObs {
|
|
|
199
199
|
// the callback is called before the function returns (although unlikely)
|
|
200
200
|
// we do not want to throw for "annotating a finished span" in this case
|
|
201
201
|
if (!hasCallback) {
|
|
202
|
-
llmobs
|
|
202
|
+
llmobs.#autoAnnotate(span, kind, getFunctionArguments(fn, fnArgs), result)
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
return result
|
|
206
206
|
} catch (e) {
|
|
207
|
-
llmobs
|
|
207
|
+
llmobs.#autoAnnotate(span, kind, getFunctionArguments(fn, fnArgs))
|
|
208
208
|
throw e
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -516,7 +516,7 @@ class LLMObs extends NoopLLMObs {
|
|
|
516
516
|
flushCh.publish()
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
|
|
519
|
+
#autoAnnotate (span, kind, input, output) {
|
|
520
520
|
const annotations = {}
|
|
521
521
|
if (input && !['llm', 'embedding'].includes(kind) && !LLMObsTagger.tagMap.get(span)?.[INPUT_VALUE]) {
|
|
522
522
|
annotations.inputData = input
|
|
@@ -534,7 +534,7 @@ class LLMObs extends NoopLLMObs {
|
|
|
534
534
|
return store?.span
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
-
|
|
537
|
+
#activate (span, options, fn) {
|
|
538
538
|
const parentStore = storage.getStore()
|
|
539
539
|
if (this.enabled) storage.enterWith({ ...parentStore, span })
|
|
540
540
|
|
|
@@ -567,22 +567,20 @@ class LLMObs extends NoopLLMObs {
|
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
// bind function to active LLMObs span
|
|
570
|
-
|
|
570
|
+
#bind (fn) {
|
|
571
571
|
if (typeof fn !== 'function') return fn
|
|
572
572
|
|
|
573
573
|
const llmobs = this
|
|
574
574
|
const activeSpan = llmobs._active()
|
|
575
575
|
|
|
576
|
-
|
|
577
|
-
return llmobs
|
|
578
|
-
return fn.apply(this,
|
|
576
|
+
return function (...args) {
|
|
577
|
+
return llmobs.#activate(activeSpan, null, () => {
|
|
578
|
+
return fn.apply(this, args)
|
|
579
579
|
})
|
|
580
580
|
}
|
|
581
|
-
|
|
582
|
-
return bound
|
|
583
581
|
}
|
|
584
582
|
|
|
585
|
-
|
|
583
|
+
#extractOptions (options) {
|
|
586
584
|
const {
|
|
587
585
|
modelName,
|
|
588
586
|
modelProvider,
|
|
@@ -39,10 +39,16 @@ const telemetry = require('./telemetry')
|
|
|
39
39
|
const LLMObsTagger = require('./tagger')
|
|
40
40
|
|
|
41
41
|
class LLMObservabilitySpan {
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @param {string} kind span kind
|
|
44
|
+
*/
|
|
45
|
+
constructor (kind) {
|
|
43
46
|
this.input = []
|
|
44
47
|
this.output = []
|
|
45
48
|
|
|
49
|
+
/** @type {string} */
|
|
50
|
+
this.kind = kind
|
|
51
|
+
|
|
46
52
|
this._tags = {}
|
|
47
53
|
}
|
|
48
54
|
|
|
@@ -115,7 +121,6 @@ class LLMObsSpanProcessor {
|
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
format (span) {
|
|
118
|
-
const llmObsSpan = new LLMObservabilitySpan()
|
|
119
124
|
let inputType, outputType
|
|
120
125
|
|
|
121
126
|
const spanTags = span.context()._tags
|
|
@@ -145,14 +150,18 @@ class LLMObsSpanProcessor {
|
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
if (mlObsTags[TOOL_DEFINITIONS]) {
|
|
148
|
-
|
|
153
|
+
meta.tool_definitions = []
|
|
154
|
+
this.#addObject(mlObsTags[TOOL_DEFINITIONS], meta.tool_definitions)
|
|
149
155
|
}
|
|
150
156
|
|
|
157
|
+
const llmObsSpan = new LLMObservabilitySpan(spanKind)
|
|
158
|
+
|
|
151
159
|
if (spanKind === 'llm' && mlObsTags[INPUT_MESSAGES]) {
|
|
152
160
|
llmObsSpan.input = mlObsTags[INPUT_MESSAGES]
|
|
153
161
|
inputType = 'messages'
|
|
154
162
|
} else if (spanKind === 'embedding' && mlObsTags[INPUT_DOCUMENTS]) {
|
|
155
|
-
input
|
|
163
|
+
llmObsSpan.input = mlObsTags[INPUT_DOCUMENTS].map(doc => ({ content: doc.text, role: '' }))
|
|
164
|
+
inputType = 'documents'
|
|
156
165
|
} else if (mlObsTags[INPUT_VALUE]) {
|
|
157
166
|
llmObsSpan.input = [{ role: '', content: mlObsTags[INPUT_VALUE] }]
|
|
158
167
|
inputType = 'value'
|
|
@@ -162,7 +171,8 @@ class LLMObsSpanProcessor {
|
|
|
162
171
|
llmObsSpan.output = mlObsTags[OUTPUT_MESSAGES]
|
|
163
172
|
outputType = 'messages'
|
|
164
173
|
} else if (spanKind === 'retrieval' && mlObsTags[OUTPUT_DOCUMENTS]) {
|
|
165
|
-
output
|
|
174
|
+
llmObsSpan.output = mlObsTags[OUTPUT_DOCUMENTS].map(doc => ({ content: doc.text, role: '' }))
|
|
175
|
+
outputType = 'documents'
|
|
166
176
|
} else if (mlObsTags[OUTPUT_VALUE]) {
|
|
167
177
|
llmObsSpan.output = [{ role: '', content: mlObsTags[OUTPUT_VALUE] }]
|
|
168
178
|
outputType = 'value'
|
|
@@ -194,6 +204,11 @@ class LLMObsSpanProcessor {
|
|
|
194
204
|
input.messages = processedSpan.input
|
|
195
205
|
} else if (inputType === 'value') {
|
|
196
206
|
input.value = processedSpan.input[0].content
|
|
207
|
+
} else if (inputType === 'documents') {
|
|
208
|
+
input.documents = processedSpan.input.map((processedDocument, processedDocumentIdx) => ({
|
|
209
|
+
...mlObsTags[INPUT_DOCUMENTS][processedDocumentIdx],
|
|
210
|
+
text: processedDocument.content,
|
|
211
|
+
}))
|
|
197
212
|
}
|
|
198
213
|
}
|
|
199
214
|
|
|
@@ -202,6 +217,11 @@ class LLMObsSpanProcessor {
|
|
|
202
217
|
output.messages = processedSpan.output
|
|
203
218
|
} else if (outputType === 'value') {
|
|
204
219
|
output.value = processedSpan.output[0].content
|
|
220
|
+
} else if (outputType === 'documents') {
|
|
221
|
+
output.documents = processedSpan.output.map((processedDocument, processedDocumentIdx) => ({
|
|
222
|
+
...mlObsTags[OUTPUT_DOCUMENTS][processedDocumentIdx],
|
|
223
|
+
text: processedDocument.content,
|
|
224
|
+
}))
|
|
205
225
|
}
|
|
206
226
|
}
|
|
207
227
|
|
|
@@ -12,6 +12,7 @@ function encodeUnicode (str = '') {
|
|
|
12
12
|
for (let index = 0; index < str.length; index++) {
|
|
13
13
|
if (str.charCodeAt(index) > 127) {
|
|
14
14
|
let result = str.slice(0, index)
|
|
15
|
+
// eslint-disable-next-line sonarjs/updated-loop-counter -- inner loop continues from outer position
|
|
15
16
|
for (; index < str.length; index++) {
|
|
16
17
|
const code = str.charCodeAt(index)
|
|
17
18
|
result += code > 127 ? String.raw`\u${code.toString(16).padStart(4, '0')}` : str[index]
|
|
@@ -54,7 +54,8 @@ class BaseLLMObsWriter {
|
|
|
54
54
|
|
|
55
55
|
this._periodic = setInterval(() => {
|
|
56
56
|
this.flush()
|
|
57
|
-
}, this._interval)
|
|
57
|
+
}, this._interval)
|
|
58
|
+
this._periodic.unref?.()
|
|
58
59
|
|
|
59
60
|
const destroyer = this.destroy.bind(this)
|
|
60
61
|
globalThis[Symbol.for('dd-trace')].beforeExitHandlers.add(destroyer)
|
|
@@ -8,11 +8,13 @@ const DEFAULT_MIN_SIZE = 2 * 1024 * 1024 // 2MB
|
|
|
8
8
|
* either.
|
|
9
9
|
*/
|
|
10
10
|
class MsgpackChunk {
|
|
11
|
+
#minSize
|
|
12
|
+
|
|
11
13
|
constructor (minSize = DEFAULT_MIN_SIZE) {
|
|
12
14
|
this.buffer = Buffer.allocUnsafe(minSize)
|
|
13
15
|
this.view = new DataView(this.buffer.buffer)
|
|
14
16
|
this.length = 0
|
|
15
|
-
this
|
|
17
|
+
this.#minSize = minSize
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
write (value) {
|
|
@@ -50,13 +52,14 @@ class MsgpackChunk {
|
|
|
50
52
|
|
|
51
53
|
reserve (size) {
|
|
52
54
|
if (this.length + size > this.buffer.length) {
|
|
53
|
-
|
|
55
|
+
const minSize = this.#minSize
|
|
56
|
+
this.#resize(minSize * Math.ceil((this.length + size) / minSize))
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
this.length += size
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
#resize (size) {
|
|
60
63
|
const oldBuffer = this.buffer
|
|
61
64
|
|
|
62
65
|
this.buffer = Buffer.allocUnsafe(size)
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
const { NOOP_REASON } = require('./constants/constants')
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @template T
|
|
7
|
+
* @param {T} defaultValue
|
|
8
|
+
* @returns {Promise<{value: T, reason: string}>}
|
|
9
|
+
*/
|
|
10
|
+
function resolveDefault (defaultValue) {
|
|
11
|
+
return Promise.resolve({
|
|
12
|
+
value: defaultValue,
|
|
13
|
+
reason: NOOP_REASON,
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
/**
|
|
6
18
|
* No-op implementation of OpenFeature provider that always returns default values.
|
|
7
19
|
* Used when the OpenFeature provider is not initialized or disabled.
|
|
@@ -20,59 +32,51 @@ class NoopFlaggingProvider {
|
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
/**
|
|
23
|
-
* @
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {object}
|
|
27
|
-
* @
|
|
35
|
+
* @template T
|
|
36
|
+
* @param {string} flagKey
|
|
37
|
+
* @param {T} defaultValue
|
|
38
|
+
* @param {object} context
|
|
39
|
+
* @param {object} logger
|
|
40
|
+
* @returns {Promise<{value: T, reason: string}>}
|
|
28
41
|
*/
|
|
29
42
|
resolveBooleanEvaluation (flagKey, defaultValue, context, logger) {
|
|
30
|
-
return
|
|
31
|
-
value: defaultValue,
|
|
32
|
-
reason: NOOP_REASON,
|
|
33
|
-
})
|
|
43
|
+
return resolveDefault(defaultValue)
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
/**
|
|
37
|
-
* @
|
|
38
|
-
* @param {string}
|
|
39
|
-
* @param {
|
|
40
|
-
* @param {object}
|
|
41
|
-
* @
|
|
47
|
+
* @template T
|
|
48
|
+
* @param {string} flagKey
|
|
49
|
+
* @param {T} defaultValue
|
|
50
|
+
* @param {object} context
|
|
51
|
+
* @param {object} logger
|
|
52
|
+
* @returns {Promise<{value: T, reason: string}>}
|
|
42
53
|
*/
|
|
43
54
|
resolveStringEvaluation (flagKey, defaultValue, context, logger) {
|
|
44
|
-
return
|
|
45
|
-
value: defaultValue,
|
|
46
|
-
reason: NOOP_REASON,
|
|
47
|
-
})
|
|
55
|
+
return resolveDefault(defaultValue)
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
/**
|
|
51
|
-
* @
|
|
52
|
-
* @param {
|
|
53
|
-
* @param {
|
|
54
|
-
* @param {object}
|
|
55
|
-
* @
|
|
59
|
+
* @template T
|
|
60
|
+
* @param {string} flagKey
|
|
61
|
+
* @param {T} defaultValue
|
|
62
|
+
* @param {object} context
|
|
63
|
+
* @param {object} logger
|
|
64
|
+
* @returns {Promise<{value: T, reason: string}>}
|
|
56
65
|
*/
|
|
57
66
|
resolveNumberEvaluation (flagKey, defaultValue, context, logger) {
|
|
58
|
-
return
|
|
59
|
-
value: defaultValue,
|
|
60
|
-
reason: NOOP_REASON,
|
|
61
|
-
})
|
|
67
|
+
return resolveDefault(defaultValue)
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
/**
|
|
65
|
-
* @
|
|
66
|
-
* @param {
|
|
67
|
-
* @param {
|
|
68
|
-
* @param {object}
|
|
69
|
-
* @
|
|
71
|
+
* @template T
|
|
72
|
+
* @param {string} flagKey
|
|
73
|
+
* @param {T} defaultValue
|
|
74
|
+
* @param {object} context
|
|
75
|
+
* @param {object} logger
|
|
76
|
+
* @returns {Promise<{value: T, reason: string}>}
|
|
70
77
|
*/
|
|
71
78
|
resolveObjectEvaluation (flagKey, defaultValue, context, logger) {
|
|
72
|
-
return
|
|
73
|
-
value: defaultValue,
|
|
74
|
-
reason: NOOP_REASON,
|
|
75
|
-
})
|
|
79
|
+
return resolveDefault(defaultValue)
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
/**
|
|
@@ -55,7 +55,8 @@ class BaseFFEWriter {
|
|
|
55
55
|
|
|
56
56
|
this._periodic = setInterval(() => {
|
|
57
57
|
this.flush()
|
|
58
|
-
}, this._interval)
|
|
58
|
+
}, this._interval)
|
|
59
|
+
this._periodic.unref?.()
|
|
59
60
|
|
|
60
61
|
const destroyer = this.destroy.bind(this)
|
|
61
62
|
globalThis[Symbol.for('dd-trace')].beforeExitHandlers.add(destroyer)
|
|
@@ -43,7 +43,7 @@ const BaseFFEWriter = require('./base')
|
|
|
43
43
|
*/
|
|
44
44
|
class ExposuresWriter extends BaseFFEWriter {
|
|
45
45
|
/**
|
|
46
|
-
* @param {import('../../config')} config - Tracer configuration object
|
|
46
|
+
* @param {import('../../config/config-base')} config - Tracer configuration object
|
|
47
47
|
*/
|
|
48
48
|
constructor (config) {
|
|
49
49
|
// Build full EVP endpoint path
|
|
@@ -62,7 +62,19 @@ class ExposuresWriter extends BaseFFEWriter {
|
|
|
62
62
|
})
|
|
63
63
|
this._enabled = false // Start disabled until agent strategy is set
|
|
64
64
|
this._pendingEvents = [] // Buffer events until enabled
|
|
65
|
-
|
|
65
|
+
|
|
66
|
+
const context = {
|
|
67
|
+
service: config.service,
|
|
68
|
+
}
|
|
69
|
+
// Only include version and env if they are defined
|
|
70
|
+
if (config.version !== undefined) {
|
|
71
|
+
context.version = config.version
|
|
72
|
+
}
|
|
73
|
+
if (config.env !== undefined) {
|
|
74
|
+
context.env = config.env
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this._context = context
|
|
66
78
|
}
|
|
67
79
|
|
|
68
80
|
/**
|
|
@@ -112,62 +124,31 @@ class ExposuresWriter extends BaseFFEWriter {
|
|
|
112
124
|
* @returns {ExposureEventPayload} Formatted payload with service context
|
|
113
125
|
*/
|
|
114
126
|
makePayload (events) {
|
|
115
|
-
const formattedEvents = events.map(event =>
|
|
127
|
+
const formattedEvents = events.map(event => {
|
|
128
|
+
return {
|
|
129
|
+
timestamp: event.timestamp || Date.now(),
|
|
130
|
+
allocation: {
|
|
131
|
+
key: event.allocation?.key || event['allocation.key'],
|
|
132
|
+
},
|
|
133
|
+
flag: {
|
|
134
|
+
key: event.flag?.key || event['flag.key'],
|
|
135
|
+
},
|
|
136
|
+
variant: {
|
|
137
|
+
key: event.variant?.key || event['variant.key'],
|
|
138
|
+
},
|
|
139
|
+
subject: {
|
|
140
|
+
id: event.subject?.id || event['subject.id'],
|
|
141
|
+
type: event.subject?.type,
|
|
142
|
+
attributes: event.subject?.attributes,
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
})
|
|
116
146
|
|
|
117
147
|
return {
|
|
118
148
|
context: this._context,
|
|
119
149
|
exposures: formattedEvents,
|
|
120
150
|
}
|
|
121
151
|
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Builds service context metadata
|
|
125
|
-
* @private
|
|
126
|
-
* @returns {ExposureContext} Service context
|
|
127
|
-
*/
|
|
128
|
-
_buildContext () {
|
|
129
|
-
const context = {
|
|
130
|
-
service: this._config.service || 'unknown',
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Only include version and env if they are defined
|
|
134
|
-
if (this._config.version !== undefined) {
|
|
135
|
-
context.version = this._config.version
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (this._config.env !== undefined) {
|
|
139
|
-
context.env = this._config.env
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return context
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @private
|
|
147
|
-
* @param {ExposureEvent} event - Raw exposure event
|
|
148
|
-
* @returns {ExposureEvent} Formatted exposure event
|
|
149
|
-
*/
|
|
150
|
-
_formatExposureEvent (event) {
|
|
151
|
-
// Ensure the event matches the expected schema
|
|
152
|
-
const formattedEvent = {
|
|
153
|
-
timestamp: event.timestamp || Date.now(),
|
|
154
|
-
allocation: {
|
|
155
|
-
key: event.allocation?.key || event['allocation.key'],
|
|
156
|
-
},
|
|
157
|
-
flag: {
|
|
158
|
-
key: event.flag?.key || event['flag.key'],
|
|
159
|
-
},
|
|
160
|
-
variant: {
|
|
161
|
-
key: event.variant?.key || event['variant.key'],
|
|
162
|
-
},
|
|
163
|
-
subject: {
|
|
164
|
-
id: event.subject?.id || event['subject.id'],
|
|
165
|
-
type: event.subject?.type,
|
|
166
|
-
attributes: event.subject?.attributes,
|
|
167
|
-
},
|
|
168
|
-
}
|
|
169
|
-
return formattedEvent
|
|
170
|
-
}
|
|
171
152
|
}
|
|
172
153
|
|
|
173
154
|
module.exports = ExposuresWriter
|
|
@@ -141,8 +141,7 @@ class OtlpTransformerBase {
|
|
|
141
141
|
*/
|
|
142
142
|
serializeToProtobuf (protoType, data) {
|
|
143
143
|
const message = protoType.create(data)
|
|
144
|
-
|
|
145
|
-
return buffer
|
|
144
|
+
return protoType.encode(message).finish()
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
/**
|
|
@@ -130,28 +130,6 @@ class Tracer {
|
|
|
130
130
|
}
|
|
131
131
|
const attributes = sanitizeAttributes(options.attributes)
|
|
132
132
|
|
|
133
|
-
// TODO: sampling API is not yet supported
|
|
134
|
-
// // make sampling decision
|
|
135
|
-
// const samplingResult = this._sampler.shouldSample(
|
|
136
|
-
// context,
|
|
137
|
-
// spanContext.traceId,
|
|
138
|
-
// name,
|
|
139
|
-
// spanKind,
|
|
140
|
-
// attributes,
|
|
141
|
-
// links
|
|
142
|
-
// )
|
|
143
|
-
|
|
144
|
-
// // Should use new span context
|
|
145
|
-
// spanContext._ddContext._sampling.priority =
|
|
146
|
-
// samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED
|
|
147
|
-
// ? AUTO_KEEP
|
|
148
|
-
// : AUTO_REJECT
|
|
149
|
-
|
|
150
|
-
// if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {
|
|
151
|
-
// api.diag.debug('Recording is off, propagating context in a non-recording span')
|
|
152
|
-
// return api.trace.wrapSpanContext(spanContext)
|
|
153
|
-
// }
|
|
154
|
-
|
|
155
133
|
return new Span(
|
|
156
134
|
this,
|
|
157
135
|
context,
|
|
@@ -9,6 +9,7 @@ const tags = require('../../../../../ext/tags')
|
|
|
9
9
|
const { getConfiguredEnvName } = require('../../config/helper')
|
|
10
10
|
const { setAllBaggageItems, getAllBaggageItems, removeAllBaggageItems } = require('../../baggage')
|
|
11
11
|
const telemetryMetrics = require('../../telemetry/metrics')
|
|
12
|
+
const { DD_MAJOR } = require('../../../../../version')
|
|
12
13
|
|
|
13
14
|
const { AUTO_KEEP, AUTO_REJECT, USER_KEEP } = require('../../../../../ext/priority')
|
|
14
15
|
const TraceState = require('./tracestate')
|
|
@@ -78,10 +79,17 @@ class TextMapPropagator {
|
|
|
78
79
|
constructor (config) {
|
|
79
80
|
this._config = config
|
|
80
81
|
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
// v6: `'b3'` is always single-header. v5: env-name decides — OTEL_PROPAGATORS callers expect
|
|
83
|
+
// single, the legacy `DD_TRACE_PROPAGATION_STYLE` callers expect multi.
|
|
84
|
+
if (DD_MAJOR >= 6) {
|
|
85
|
+
this.#extractB3Context = this._extractB3SingleContext
|
|
86
|
+
} else {
|
|
87
|
+
const envName = getConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
|
|
88
|
+
// eslint-disable-next-line eslint-rules/eslint-env-aliases
|
|
89
|
+
this.#extractB3Context = envName === 'OTEL_PROPAGATORS'
|
|
90
|
+
? this._extractB3SingleContext
|
|
91
|
+
: this._extractB3MultiContext
|
|
92
|
+
}
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
/**
|
|
@@ -262,9 +270,10 @@ class TextMapPropagator {
|
|
|
262
270
|
}
|
|
263
271
|
|
|
264
272
|
_injectB3MultipleHeaders (spanContext, carrier) {
|
|
265
|
-
|
|
266
|
-
const hasB3multi = this._hasPropagationStyle('inject', 'b3multi')
|
|
267
|
-
|
|
273
|
+
// v5 also accepts the legacy `'b3'` spelling for multi; v6 routes `'b3'` to single-header.
|
|
274
|
+
const hasB3multi = this._hasPropagationStyle('inject', 'b3multi') ||
|
|
275
|
+
(DD_MAJOR < 6 && this._hasPropagationStyle('inject', 'b3'))
|
|
276
|
+
if (!hasB3multi) return
|
|
268
277
|
|
|
269
278
|
carrier[b3TraceKey] = this._getB3TraceId(spanContext)
|
|
270
279
|
carrier[b3SpanKey] = spanContext._spanId.toString(16)
|
|
@@ -280,7 +289,9 @@ class TextMapPropagator {
|
|
|
280
289
|
}
|
|
281
290
|
|
|
282
291
|
_injectB3SingleHeader (spanContext, carrier) {
|
|
283
|
-
|
|
292
|
+
// v6 keeps `'b3 single header'` as a back-compat alias for callers that bypass parser normalisation.
|
|
293
|
+
const hasB3SingleHeader = this._hasPropagationStyle('inject', 'b3 single header') ||
|
|
294
|
+
(DD_MAJOR >= 6 && this._hasPropagationStyle('inject', 'b3'))
|
|
284
295
|
if (!hasB3SingleHeader) return null
|
|
285
296
|
|
|
286
297
|
const traceId = this._getB3TraceId(spanContext)
|
|
@@ -394,7 +405,7 @@ class TextMapPropagator {
|
|
|
394
405
|
case 'tracecontext':
|
|
395
406
|
extractedContext = this._extractTraceparentContext(carrier)
|
|
396
407
|
break
|
|
397
|
-
case 'b3 single header':
|
|
408
|
+
case 'b3 single header':
|
|
398
409
|
extractedContext = this._extractB3SingleContext(carrier)
|
|
399
410
|
break
|
|
400
411
|
case 'b3':
|