@loglayer/plugin-datadog-apm-trace-injector 1.0.13 → 1.0.15

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.
@@ -31,4 +31,4 @@ interface DatadogTraceInjectorPluginParams extends LogLayerPluginParams {
31
31
  declare function datadogTraceInjectorPlugin(config: DatadogTraceInjectorPluginParams): LogLayerPlugin;
32
32
  //#endregion
33
33
  export { type DatadogTraceInjectorPluginParams, datadogTraceInjectorPlugin };
34
- //# sourceMappingURL=index.d.ts.map
34
+ //# sourceMappingURL=index.d.mts.map
@@ -27,4 +27,4 @@ function datadogTraceInjectorPlugin(config) {
27
27
 
28
28
  //#endregion
29
29
  export { datadogTraceInjectorPlugin };
30
- //# sourceMappingURL=index.js.map
30
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { LogLayerPlugin, PluginBeforeDataOutParams } from \"@loglayer/plugin\";\nimport type { DatadogTraceInjectorPluginParams } from \"./types.js\";\n\n/**\n * Creates a new Datadog trace injector plugin.\n *\n * This plugin injects the current Datadog APM trace context into the log data.\n *\n * @param config - The datadog trace injector plugin configuration\n * @returns A LogLayer plugin instance\n */\nexport function datadogTraceInjectorPlugin(config: DatadogTraceInjectorPluginParams): LogLayerPlugin {\n const tracer = config.tracerInstance;\n\n return {\n id: config.id,\n disabled: config.disabled,\n onBeforeDataOut({ data }: PluginBeforeDataOutParams): Record<string, any> {\n if (!data) {\n data = {};\n }\n\n try {\n // Associates log with APM trace\n // https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/nodejs/\n const span = tracer.scope().active();\n\n if (span) {\n tracer.inject(span.context(), \"log\", data);\n }\n } catch (error) {\n // Call error handler if provided, otherwise silently continue\n if (config.onError && error instanceof Error) {\n config.onError(error, data);\n }\n // Continue logging even if tracer operations fail\n // This ensures logging doesn't break if dd-trace has issues\n }\n\n return data;\n },\n };\n}\n"],"mappings":";;;;;;;;;AAWA,SAAgB,2BAA2B,QAA0D;CACnG,MAAM,SAAS,OAAO;AAEtB,QAAO;EACL,IAAI,OAAO;EACX,UAAU,OAAO;EACjB,gBAAgB,EAAE,QAAwD;AACxE,OAAI,CAAC,KACH,QAAO,EAAE;AAGX,OAAI;IAGF,MAAM,OAAO,OAAO,OAAO,CAAC,QAAQ;AAEpC,QAAI,KACF,QAAO,OAAO,KAAK,SAAS,EAAE,OAAO,KAAK;YAErC,OAAO;AAEd,QAAI,OAAO,WAAW,iBAAiB,MACrC,QAAO,QAAQ,OAAO,KAAK;;AAM/B,UAAO;;EAEV"}
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@loglayer/plugin-datadog-apm-trace-injector",
3
3
  "description": "Injects DataDog APM traces to logs in LogLayer.",
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
8
  "exports": {
9
9
  "import": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
10
+ "types": "./dist/index.d.mts",
11
+ "import": "./dist/index.mjs"
12
12
  },
13
13
  "require": {
14
14
  "types": "./dist/index.d.cts",
15
15
  "require": "./dist/index.cjs"
16
16
  }
17
17
  },
18
- "types": "./dist/index.d.ts",
18
+ "types": "./dist/index.d.mts",
19
+ "sideEffects": false,
19
20
  "license": "MIT",
20
21
  "repository": {
21
22
  "type": "git",
@@ -36,19 +37,19 @@
36
37
  "dd-trace"
37
38
  ],
38
39
  "dependencies": {
39
- "@loglayer/plugin": "2.2.4",
40
- "@loglayer/shared": "3.1.0"
40
+ "@loglayer/plugin": "2.2.6",
41
+ "@loglayer/shared": "3.2.0"
41
42
  },
42
43
  "devDependencies": {
43
- "@types/node": "24.10.1",
44
+ "@types/node": "24.10.2",
44
45
  "dd-trace": "5.71.0",
45
46
  "express": "5.1.0",
46
- "tsdown": "0.15.12",
47
- "tsx": "4.20.6",
47
+ "tsdown": "0.17.2",
48
+ "tsx": "4.21.0",
48
49
  "typescript": "5.9.3",
49
- "vitest": "4.0.9",
50
+ "vitest": "4.0.15",
50
51
  "@internal/tsconfig": "2.1.0",
51
- "loglayer": "8.1.0"
52
+ "loglayer": "8.2.0"
52
53
  },
53
54
  "bugs": "https://github.com/loglayer/loglayer/issues",
54
55
  "engines": {
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { LogLayerPlugin, PluginBeforeDataOutParams } from \"@loglayer/plugin\";\nimport type { DatadogTraceInjectorPluginParams } from \"./types.js\";\n\n/**\n * Creates a new Datadog trace injector plugin.\n *\n * This plugin injects the current Datadog APM trace context into the log data.\n *\n * @param config - The datadog trace injector plugin configuration\n * @returns A LogLayer plugin instance\n */\nexport function datadogTraceInjectorPlugin(config: DatadogTraceInjectorPluginParams): LogLayerPlugin {\n const tracer = config.tracerInstance;\n\n return {\n id: config.id,\n disabled: config.disabled,\n onBeforeDataOut({ data }: PluginBeforeDataOutParams): Record<string, any> {\n if (!data) {\n data = {};\n }\n\n try {\n // Associates log with APM trace\n // https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/nodejs/\n const span = tracer.scope().active();\n\n if (span) {\n tracer.inject(span.context(), \"log\", data);\n }\n } catch (error) {\n // Call error handler if provided, otherwise silently continue\n if (config.onError && error instanceof Error) {\n config.onError(error, data);\n }\n // Continue logging even if tracer operations fail\n // This ensures logging doesn't break if dd-trace has issues\n }\n\n return data;\n },\n };\n}\n"],"mappings":";;;;;;;;;AAWA,SAAgB,2BAA2B,QAA0D;CACnG,MAAM,SAAS,OAAO;AAEtB,QAAO;EACL,IAAI,OAAO;EACX,UAAU,OAAO;EACjB,gBAAgB,EAAE,QAAwD;AACxE,OAAI,CAAC,KACH,QAAO,EAAE;AAGX,OAAI;IAGF,MAAM,OAAO,OAAO,OAAO,CAAC,QAAQ;AAEpC,QAAI,KACF,QAAO,OAAO,KAAK,SAAS,EAAE,OAAO,KAAK;YAErC,OAAO;AAEd,QAAI,OAAO,WAAW,iBAAiB,MACrC,QAAO,QAAQ,OAAO,KAAK;;AAM/B,UAAO;;EAEV"}