@loglayer/plugin-datadog-apm-trace-injector 2.0.0 → 2.0.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/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","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":"
|
|
1
|
+
{"version":3,"file":"index.cjs","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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loglayer/plugin-datadog-apm-trace-injector",
|
|
3
3
|
"description": "Injects DataDog APM traces to logs in LogLayer.",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"dd-trace"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@loglayer/plugin": "3.0.
|
|
41
|
-
"@loglayer/shared": "4.
|
|
40
|
+
"@loglayer/plugin": "3.0.2",
|
|
41
|
+
"@loglayer/shared": "4.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/node": "25.2.
|
|
44
|
+
"@types/node": "25.2.3",
|
|
45
45
|
"dd-trace": "5.71.0",
|
|
46
46
|
"express": "5.2.1",
|
|
47
|
-
"tsdown": "0.20.
|
|
47
|
+
"tsdown": "0.20.3",
|
|
48
48
|
"tsx": "4.21.0",
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
50
|
"vitest": "4.0.18",
|
|
51
51
|
"@internal/tsconfig": "2.1.0",
|
|
52
|
-
"loglayer": "9.
|
|
52
|
+
"loglayer": "9.1.0"
|
|
53
53
|
},
|
|
54
54
|
"bugs": "https://github.com/loglayer/loglayer/issues",
|
|
55
55
|
"engines": {
|