@vtvlive/interactive-apm 0.0.10 → 0.0.12
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/init/elastic-apm-init.d.ts.map +1 -1
- package/dist/init/elastic-apm-init.js +3 -0
- package/dist/init/opentelemetry-init.d.ts.map +1 -1
- package/dist/init/opentelemetry-init.js +19 -11
- package/dist/utils/check-packages.d.ts +19 -0
- package/dist/utils/check-packages.d.ts.map +1 -0
- package/dist/utils/check-packages.js +85 -0
- package/dist/utils/tracing.helper.d.ts.map +1 -1
- package/dist/utils/tracing.helper.js +2 -0
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elastic-apm-init.d.ts","sourceRoot":"","sources":["../../src/init/elastic-apm-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"elastic-apm-init.d.ts","sourceRoot":"","sources":["../../src/init/elastic-apm-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;CAClE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG;IACnE,SAAS,IAAI,OAAO,CAAC;IACrB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,GAAG,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACrE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,GAAG,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACjC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,GAAG,IAAI,CA+CP;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAQ7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,SAAS,IAAI,OAAO,CAAC;IACrB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,GAAG,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACrE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,GAAG,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACjC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,GAAG,IAAI,CAWP"}
|
|
@@ -23,6 +23,7 @@ exports.getElasticApmAgent = getElasticApmAgent;
|
|
|
23
23
|
const apm_provider_type_1 = require("../types/apm-provider.type");
|
|
24
24
|
const debug_logger_1 = require("../utils/debug-logger");
|
|
25
25
|
const elastic_apm_compat_1 = require("../utils/elastic-apm-compat");
|
|
26
|
+
const check_packages_1 = require("../utils/check-packages");
|
|
26
27
|
/**
|
|
27
28
|
* Check if APM should use Elastic APM provider based on configuration
|
|
28
29
|
* @returns true if Elastic APM should be used
|
|
@@ -38,6 +39,8 @@ function shouldUseElasticApm() {
|
|
|
38
39
|
* @returns The APM agent instance
|
|
39
40
|
*/
|
|
40
41
|
function initElasticApm(options = {}) {
|
|
42
|
+
// Fail fast with a clear message if elastic-apm-node is not installed.
|
|
43
|
+
(0, check_packages_1.checkElasticApmPackages)();
|
|
41
44
|
// @ts-ignore - Optional peer dependency
|
|
42
45
|
const apm = require("elastic-apm-node");
|
|
43
46
|
// If already started, return the instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opentelemetry-init.d.ts","sourceRoot":"","sources":["../../src/init/opentelemetry-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"opentelemetry-init.d.ts","sourceRoot":"","sources":["../../src/init/opentelemetry-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAgE7D,MAAM,WAAW,wBAAwB;IACvC,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kCAAkC;IAClC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,qCAAqC;IACrC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAwCD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC;IACvF,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC,CAyND"}
|
|
@@ -55,6 +55,7 @@ const apm_provider_type_1 = require("../types/apm-provider.type");
|
|
|
55
55
|
const otlp_transport_type_1 = require("../types/otlp-transport.type");
|
|
56
56
|
const debug_logger_1 = require("../utils/debug-logger");
|
|
57
57
|
const debug_exporter_wrapper_1 = require("../utils/debug-exporter-wrapper");
|
|
58
|
+
const check_packages_1 = require("../utils/check-packages");
|
|
58
59
|
/**
|
|
59
60
|
* Transaction Name Processor for OpenTelemetry
|
|
60
61
|
* Sets transaction names to format: "GET /api/healthcheck/ping"
|
|
@@ -151,16 +152,27 @@ function normalizeEndpoint(endpoint, isGrpc) {
|
|
|
151
152
|
* @returns The NodeSDK instance
|
|
152
153
|
*/
|
|
153
154
|
async function initOpenTelemetry(options = {}) {
|
|
155
|
+
// Determine transport early so the package check validates the right exporter.
|
|
156
|
+
const rawTransport = (options.otlpTransport ||
|
|
157
|
+
process.env.ELASTIC_OTLP_TRANSPORT ||
|
|
158
|
+
otlp_transport_type_1.OtlpTransport.HTTP).toLowerCase();
|
|
159
|
+
// Fail fast with a clear message if required packages are not installed.
|
|
160
|
+
(0, check_packages_1.checkOpenTelemetryPackages)(rawTransport);
|
|
154
161
|
// @ts-ignore - Optional peer dependency
|
|
155
|
-
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
|
+
const { NodeSDK } = (await Promise.resolve().then(() => __importStar(require("@opentelemetry/sdk-node"))));
|
|
156
164
|
// @ts-ignore - Optional peer dependency
|
|
157
|
-
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
const resourceMod = (await Promise.resolve().then(() => __importStar(require("@opentelemetry/resources"))));
|
|
167
|
+
// Compat: resourceFromAttributes was introduced in v1.9.0; older versions use `new Resource(attrs)`
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
|
+
const buildResource = (attrs) => typeof resourceMod.resourceFromAttributes === "function"
|
|
170
|
+
? resourceMod.resourceFromAttributes(attrs)
|
|
171
|
+
: new resourceMod.Resource(attrs);
|
|
158
172
|
const serviceName = options.serviceName || process.env.ELASTIC_APM_SERVICE_NAME || "interactive-backend";
|
|
159
173
|
const environment = options.environment || process.env.ELASTIC_APM_ENVIRONMENT || "development";
|
|
160
174
|
// Determine transport type (HTTP, gRPC, or PROTO)
|
|
161
|
-
const transportType =
|
|
162
|
-
process.env.ELASTIC_OTLP_TRANSPORT ||
|
|
163
|
-
otlp_transport_type_1.OtlpTransport.HTTP).toLowerCase();
|
|
175
|
+
const transportType = rawTransport;
|
|
164
176
|
const isGrpc = transportType === otlp_transport_type_1.OtlpTransport.GRPC || transportType === "grpc";
|
|
165
177
|
const isProto = transportType === otlp_transport_type_1.OtlpTransport.PROTO || transportType === "proto";
|
|
166
178
|
// Get endpoint from config or env (same endpoint for both transports)
|
|
@@ -252,20 +264,16 @@ async function initOpenTelemetry(options = {}) {
|
|
|
252
264
|
const { ExpressInstrumentation } = await Promise.resolve().then(() => __importStar(require("@opentelemetry/instrumentation-express")));
|
|
253
265
|
instrumentations.push(new ExpressInstrumentation());
|
|
254
266
|
}
|
|
255
|
-
console.log("[DEBUG] About to load Redis instrumentation...");
|
|
256
267
|
try {
|
|
257
268
|
const { IORedisInstrumentation } = await Promise.resolve().then(() => __importStar(require("@opentelemetry/instrumentation-ioredis")));
|
|
258
|
-
console.log("[DEBUG] Redis import successful");
|
|
259
269
|
instrumentations.push(new IORedisInstrumentation());
|
|
260
|
-
console.log("[DEBUG] Redis instrumentation added");
|
|
261
270
|
(0, debug_logger_1.infoLog)("[OpenTelemetry] Redis instrumentation enabled");
|
|
262
271
|
}
|
|
263
|
-
catch
|
|
264
|
-
console.error("[DEBUG] Redis instrumentation failed:", err);
|
|
272
|
+
catch {
|
|
265
273
|
(0, debug_logger_1.infoLog)("[OpenTelemetry] Redis instrumentation not available");
|
|
266
274
|
}
|
|
267
275
|
// Resource attributes
|
|
268
|
-
const sdkResource =
|
|
276
|
+
const sdkResource = buildResource({
|
|
269
277
|
"service.name": serviceName,
|
|
270
278
|
"deployment.environment": environment,
|
|
271
279
|
"service.version": options.serviceVersion || process.env.npm_package_version || "1.0.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upfront package availability checks.
|
|
3
|
+
*
|
|
4
|
+
* Each check function uses require.resolve() — which does NOT load the module,
|
|
5
|
+
* only verifies its path can be found — so it's safe to call before any actual
|
|
6
|
+
* imports happen. Throws an Error with install instructions when packages are
|
|
7
|
+
* missing.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Verify that the minimum set of OpenTelemetry packages are present.
|
|
11
|
+
* Throws with a clear install command when any required package is missing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkOpenTelemetryPackages(transportType?: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Verify that `elastic-apm-node` is present.
|
|
16
|
+
* Throws with a clear install command when the package is missing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkElasticApmPackages(): void;
|
|
19
|
+
//# sourceMappingURL=check-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-packages.d.ts","sourceRoot":"","sources":["../../src/utils/check-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAkDvE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAW9C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Upfront package availability checks.
|
|
4
|
+
*
|
|
5
|
+
* Each check function uses require.resolve() — which does NOT load the module,
|
|
6
|
+
* only verifies its path can be found — so it's safe to call before any actual
|
|
7
|
+
* imports happen. Throws an Error with install instructions when packages are
|
|
8
|
+
* missing.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.checkOpenTelemetryPackages = checkOpenTelemetryPackages;
|
|
12
|
+
exports.checkElasticApmPackages = checkElasticApmPackages;
|
|
13
|
+
function isPackageAvailable(pkg) {
|
|
14
|
+
try {
|
|
15
|
+
require.resolve(pkg);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Verify that the minimum set of OpenTelemetry packages are present.
|
|
24
|
+
* Throws with a clear install command when any required package is missing.
|
|
25
|
+
*/
|
|
26
|
+
function checkOpenTelemetryPackages(transportType) {
|
|
27
|
+
const core = [
|
|
28
|
+
"@opentelemetry/api",
|
|
29
|
+
"@opentelemetry/sdk-node",
|
|
30
|
+
"@opentelemetry/resources",
|
|
31
|
+
"@opentelemetry/sdk-trace-base",
|
|
32
|
+
];
|
|
33
|
+
const missing = core.filter(pkg => !isPackageAvailable(pkg));
|
|
34
|
+
// Validate that the exporter matching the chosen transport is present.
|
|
35
|
+
// We only require the one that will actually be used.
|
|
36
|
+
const transport = (transportType || "http").toLowerCase();
|
|
37
|
+
if (transport === "grpc") {
|
|
38
|
+
if (!isPackageAvailable("@opentelemetry/exporter-trace-otlp-grpc")) {
|
|
39
|
+
missing.push("@opentelemetry/exporter-trace-otlp-grpc");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (transport === "proto") {
|
|
43
|
+
if (!isPackageAvailable("@opentelemetry/exporter-trace-otlp-proto")) {
|
|
44
|
+
missing.push("@opentelemetry/exporter-trace-otlp-proto");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Default: HTTP
|
|
49
|
+
if (!isPackageAvailable("@opentelemetry/exporter-trace-otlp-http")) {
|
|
50
|
+
missing.push("@opentelemetry/exporter-trace-otlp-http");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (missing.length === 0)
|
|
54
|
+
return;
|
|
55
|
+
const installCmd = "npm install " +
|
|
56
|
+
[
|
|
57
|
+
"@opentelemetry/api",
|
|
58
|
+
"@opentelemetry/sdk-node",
|
|
59
|
+
"@opentelemetry/resources",
|
|
60
|
+
"@opentelemetry/sdk-trace-base",
|
|
61
|
+
"@opentelemetry/exporter-trace-otlp-http",
|
|
62
|
+
].join(" ");
|
|
63
|
+
throw new Error("Cannot initialize OpenTelemetry: the following required packages are not installed:\n" +
|
|
64
|
+
missing.map(p => ` - ${p}`).join("\n") +
|
|
65
|
+
"\n\n" +
|
|
66
|
+
"Run the following command to install them:\n" +
|
|
67
|
+
` ${installCmd}\n` +
|
|
68
|
+
"\n" +
|
|
69
|
+
"For gRPC transport also add: @opentelemetry/exporter-trace-otlp-grpc\n" +
|
|
70
|
+
"For PROTO transport also add: @opentelemetry/exporter-trace-otlp-proto");
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Verify that `elastic-apm-node` is present.
|
|
74
|
+
* Throws with a clear install command when the package is missing.
|
|
75
|
+
*/
|
|
76
|
+
function checkElasticApmPackages() {
|
|
77
|
+
if (isPackageAvailable("elastic-apm-node"))
|
|
78
|
+
return;
|
|
79
|
+
throw new Error("Cannot initialize Elastic APM: the required package `elastic-apm-node` is not installed.\n\n" +
|
|
80
|
+
"Run the following command to install it:\n" +
|
|
81
|
+
" npm install elastic-apm-node\n" +
|
|
82
|
+
"\n" +
|
|
83
|
+
"Note: elastic-apm-node must be loaded before any other module — " +
|
|
84
|
+
"require/import it at the very top of your application entry point.");
|
|
85
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.helper.d.ts","sourceRoot":"","sources":["../../src/utils/tracing.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,IAAI,EAA4C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAwCtD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAsC;IAC3D,OAAO,CAAC,MAAM,CAAC,WAAW,CAAoD;IAE9E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAO1B;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,IAAI;IAIjC;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC5C,QAAQ,GAAE,QAA4B,GACrC,IAAI;IAWP,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAiBxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;
|
|
1
|
+
{"version":3,"file":"tracing.helper.d.ts","sourceRoot":"","sources":["../../src/utils/tracing.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,IAAI,EAA4C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAwCtD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAsC;IAC3D,OAAO,CAAC,MAAM,CAAC,WAAW,CAAoD;IAE9E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAO1B;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,IAAI;IAIjC;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC5C,QAAQ,GAAE,QAA4B,GACrC,IAAI;IAWP,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAiBxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiBrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAwFlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAqB3C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAsBpC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAe7B;;;;;;OAMG;WACU,mBAAmB,CAAC,CAAC,EAChC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,EAC1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAC3C,OAAO,CAAC,CAAC,CAAC;IA2Cb;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAsBvC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAwB9D;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI;IA2BjC;;;OAGG;IACH,MAAM,CAAC,aAAa,IAAI,IAAI,GAAG,SAAS;IAqBxC;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI,MAAM,GAAG,SAAS;CAqBxC"}
|
|
@@ -151,11 +151,13 @@ class TracingHelper {
|
|
|
151
151
|
if (span && typeof apmSpan.setLabel === "function") {
|
|
152
152
|
const originalSetLabel = apmSpan.setLabel.bind(apmSpan);
|
|
153
153
|
// Add setAttribute method that maps to setLabel
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
155
|
span.setAttribute = (key, value) => {
|
|
155
156
|
originalSetLabel(key, String(value));
|
|
156
157
|
return span; // Return span for chaining
|
|
157
158
|
};
|
|
158
159
|
// Add setAttributes method for batch setting
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
159
161
|
span.setAttributes = (attrs) => {
|
|
160
162
|
for (const [k, v] of Object.entries(attrs)) {
|
|
161
163
|
originalSetLabel(k, String(v));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtvlive/interactive-apm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "APM integration package supporting both Elastic APM and OpenTelemetry with NestJS integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"typesVersions": {
|
|
18
18
|
"*": {
|
|
19
|
-
"nestjs": [
|
|
19
|
+
"nestjs": [
|
|
20
|
+
"dist/nestjs.d.ts"
|
|
21
|
+
]
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
"keywords": [
|
|
@@ -150,4 +152,4 @@
|
|
|
150
152
|
"files": [
|
|
151
153
|
"dist"
|
|
152
154
|
]
|
|
153
|
-
}
|
|
155
|
+
}
|