@devopsplaybook.io/otel-utils-fastify 1.0.4-beta2 → 1.0.4
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.
|
@@ -10,14 +10,13 @@ const propagator = new core_1.W3CTraceContextPropagator();
|
|
|
10
10
|
function StandardTracerFastifyRegisterHooks(fastify, standardTracer, standardLogger, options) {
|
|
11
11
|
const logger = standardLogger.createModuleLogger("Fastify");
|
|
12
12
|
fastify.addHook("onRequest", async (req) => {
|
|
13
|
-
var _a
|
|
13
|
+
var _a;
|
|
14
14
|
if (req.method === "OPTIONS" ||
|
|
15
15
|
!req.url.startsWith((options === null || options === void 0 ? void 0 : options.rootApiPath) || "/api")) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const spanName = `${req.method}-${req.url.split("?")[0]}`;
|
|
19
|
-
|
|
20
|
-
if ((_b = options === null || options === void 0 ? void 0 : options.ignoreList) === null || _b === void 0 ? void 0 : _b.includes(spanName)) {
|
|
19
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.ignoreList) === null || _a === void 0 ? void 0 : _a.includes(spanName)) {
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
22
|
const callerContext = propagator.extract(api_1.ROOT_CONTEXT, req.headers, api_1.defaultTextMapGetter);
|
package/package.json
CHANGED
|
@@ -32,11 +32,6 @@ export function StandardTracerFastifyRegisterHooks(
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const spanName = `${req.method}-${req.url.split("?")[0]}`;
|
|
35
|
-
console.log(
|
|
36
|
-
spanName,
|
|
37
|
-
options?.ignoreList,
|
|
38
|
-
options?.ignoreList?.includes(spanName)
|
|
39
|
-
);
|
|
40
35
|
if (options?.ignoreList?.includes(spanName)) {
|
|
41
36
|
return;
|
|
42
37
|
}
|