dd-trace 5.63.1 → 5.63.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "5.63.1",
3
+ "version": "5.63.2",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -252,6 +252,12 @@ const sourcesOrder = [
252
252
  ]
253
253
 
254
254
  class Config {
255
+ /**
256
+ * parsed DD_TAGS, usable as a standalone tag set across products
257
+ * @type {Record<string, string> | undefined}
258
+ */
259
+ #parsedDdTags = {}
260
+
255
261
  constructor (options = {}) {
256
262
  if (!isInServerlessEnvironment()) {
257
263
  // Bail out early if we're in a serverless environment, stable config isn't supported
@@ -431,6 +437,10 @@ class Config {
431
437
  }
432
438
  }
433
439
 
440
+ get parsedDdTags () {
441
+ return this.#parsedDdTags
442
+ }
443
+
434
444
  // Supports only a subset of options for now.
435
445
  configure (options, remote) {
436
446
  if (remote) {
@@ -823,8 +833,10 @@ class Config {
823
833
  const env = setHiddenProperty(this, '_env', {})
824
834
  setHiddenProperty(this, '_envUnprocessed', {})
825
835
 
836
+ tagger.add(this.#parsedDdTags, parseSpaceSeparatedTags(DD_TAGS))
837
+
826
838
  tagger.add(tags, parseSpaceSeparatedTags(handleOtel(OTEL_RESOURCE_ATTRIBUTES)))
827
- tagger.add(tags, parseSpaceSeparatedTags(DD_TAGS))
839
+ tagger.add(tags, this.#parsedDdTags)
828
840
  tagger.add(tags, DD_TRACE_TAGS)
829
841
  tagger.add(tags, DD_TRACE_GLOBAL_TAGS)
830
842
 
@@ -178,6 +178,7 @@ class LLMObsSpanProcessor {
178
178
 
179
179
  _processTags (span, mlApp, sessionId, error) {
180
180
  let tags = {
181
+ ...this._config.parsedDdTags,
181
182
  version: this._config.version,
182
183
  env: this._config.env,
183
184
  service: this._config.service,
@@ -187,6 +188,7 @@ class LLMObsSpanProcessor {
187
188
  error: Number(!!error) || 0,
188
189
  language: 'javascript'
189
190
  }
191
+
190
192
  const errType = span.context()._tags[ERROR_TYPE] || error?.name
191
193
  if (errType) tags.error_type = errType
192
194
  if (sessionId) tags.session_id = sessionId