@easyweb/logging 1.0.2 → 1.1.1
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/README.md +33 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +9 -0
- package/dist/register.js.map +1 -0
- package/dist/telemetry.d.ts +10 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +119 -0
- package/dist/telemetry.js.map +1 -0
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -115,3 +115,36 @@ operator-create refusal, and a Google registration — and they are the signup
|
|
|
115
115
|
audit trail: `userId` alone cannot answer "which address did they sign up
|
|
116
116
|
with". The exposure is real and bounded by log retention. See
|
|
117
117
|
`docs/platform/ADR-0001`.
|
|
118
|
+
|
|
119
|
+
## Tracing (OpenTelemetry)
|
|
120
|
+
|
|
121
|
+
`@easyweb/logging/register` starts the OpenTelemetry SDK on import. Make it the
|
|
122
|
+
**first** import of a service's entry file, before anything that loads `http`,
|
|
123
|
+
`express`, `pg`, `ioredis`, `amqplib`, `undici` or `pino`:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import "@easyweb/logging/register";
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The instrumentations patch those modules as they are required, so a module
|
|
130
|
+
loaded earlier is never traced. Pino lines gain `trace_id` and `span_id` next to
|
|
131
|
+
the existing `requestId`.
|
|
132
|
+
|
|
133
|
+
It is inert unless configured: it starts only when `OTEL_EXPORTER_OTLP_ENDPOINT`
|
|
134
|
+
or `OTEL_TRACES_EXPORTER` is set and non-empty, and `OTEL_SDK_DISABLED=true`
|
|
135
|
+
always wins. The service name is `OTEL_SERVICE_NAME`, else `SERVICE_NAME`, else
|
|
136
|
+
`unknown-service`. `OTEL_*` variables are read when the process starts, before
|
|
137
|
+
dotenv loads a service's `.env`, so setting them there has no effect: put them
|
|
138
|
+
on the command line or in the pod env. Exporter, endpoint and sampler come from the standard
|
|
139
|
+
`OTEL_*` variables. `/health`, `/livez` and `/api/heartbeat` are not traced. Only traces are exported (no OTLP logs or
|
|
140
|
+
metrics), query-string values are redacted in span attributes for the
|
|
141
|
+
instrumentation libraries' own default keys (`sig`, `Signature`, `AWSAccessKeyId`,
|
|
142
|
+
`X-Goog-Signature`, `X-Amz-Signature`, `X-Amz-Credential`, `X-Amz-Security-Token`)
|
|
143
|
+
plus `token`, `code`, `state` and `refresh_token`; keys are percent-decoded before
|
|
144
|
+
matching but matched exact-case, and a token in the URL path is not redacted. Redis statements carry the command name only, and `pg`,
|
|
145
|
+
`undici` and outgoing `http` make no span outside a request.
|
|
146
|
+
Note that `OTEL_TRACES_EXPORTER=none` registers no tracer provider, so spans are
|
|
147
|
+
non-recording and carry no `trace_id`.
|
|
148
|
+
|
|
149
|
+
`npm run check:telemetry` builds and proves the `trace_id` injection and the
|
|
150
|
+
traces-only, redacted export against `dist/`; it cannot be a jest test because jest bypasses the require hooks.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":""}
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const telemetry_1 = require("./telemetry");
|
|
4
|
+
(0, telemetry_1.createTelemetrySdk)(process.env)?.start();
|
|
5
|
+
// Must be the FIRST import of a service entry file. The instrumentations patch
|
|
6
|
+
// http, express, pg, ioredis, amqplib, undici and pino by hooking require, so
|
|
7
|
+
// any of those loaded before this line is never traced. Do not import ./logger
|
|
8
|
+
// or ./index here for the same reason.
|
|
9
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":";;AAAA,2CAAiD;AAEjD,IAAA,8BAAkB,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AAEzC,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,uCAAuC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NodeSDK } from "@opentelemetry/sdk-node";
|
|
2
|
+
import type { Instrumentation } from "@opentelemetry/instrumentation";
|
|
3
|
+
export declare function shouldStartTelemetry(env: NodeJS.ProcessEnv): boolean;
|
|
4
|
+
export declare function telemetryServiceName(env: NodeJS.ProcessEnv): string;
|
|
5
|
+
export declare function isProbePath(url: string | undefined): boolean;
|
|
6
|
+
export declare const REDACTED_QUERY_PARAMS: string[];
|
|
7
|
+
export declare function redactQuery(query: string): string;
|
|
8
|
+
export declare function telemetryInstrumentations(): Instrumentation[];
|
|
9
|
+
export declare function createTelemetrySdk(env: NodeJS.ProcessEnv): NodeSDK | null;
|
|
10
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAUtE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAGpE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAEnE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI5D;AAMD,eAAO,MAAM,qBAAqB,UAGjC,CAAC;AAUF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASjD;AAED,wBAAgB,yBAAyB,IAAI,eAAe,EAAE,CA+C7D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,GAAG,IAAI,CAazE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REDACTED_QUERY_PARAMS = void 0;
|
|
4
|
+
exports.shouldStartTelemetry = shouldStartTelemetry;
|
|
5
|
+
exports.telemetryServiceName = telemetryServiceName;
|
|
6
|
+
exports.isProbePath = isProbePath;
|
|
7
|
+
exports.redactQuery = redactQuery;
|
|
8
|
+
exports.telemetryInstrumentations = telemetryInstrumentations;
|
|
9
|
+
exports.createTelemetrySdk = createTelemetrySdk;
|
|
10
|
+
// The SDK and instrumentation packages are require()d lazily, after the gate:
|
|
11
|
+
// importing them costs ~100 ms and ~36 MB per process even when telemetry is off.
|
|
12
|
+
// Deliberately imports nothing from ./logger or ./index: this file must load
|
|
13
|
+
// before pino, http, pg, ... so the SDK can patch them as they are required.
|
|
14
|
+
const PROBE_PATHS = new Set(["/health", "/livez", "/api/heartbeat"]);
|
|
15
|
+
function shouldStartTelemetry(env) {
|
|
16
|
+
if (env["OTEL_SDK_DISABLED"] === "true")
|
|
17
|
+
return false;
|
|
18
|
+
return Boolean(env["OTEL_EXPORTER_OTLP_ENDPOINT"] || env["OTEL_TRACES_EXPORTER"]);
|
|
19
|
+
}
|
|
20
|
+
function telemetryServiceName(env) {
|
|
21
|
+
return env["OTEL_SERVICE_NAME"] || env["SERVICE_NAME"] || "unknown-service";
|
|
22
|
+
}
|
|
23
|
+
function isProbePath(url) {
|
|
24
|
+
if (!url)
|
|
25
|
+
return false;
|
|
26
|
+
const path = url.split("?")[0] ?? "";
|
|
27
|
+
return PROBE_PATHS.has(path);
|
|
28
|
+
}
|
|
29
|
+
// Superset of the installed instrumentation-http and instrumentation-undici default
|
|
30
|
+
// lists (passing the option REPLACES the library default, so they are repeated here;
|
|
31
|
+
// a test fails when an upgrade adds a key) plus our own. Matched exactly,
|
|
32
|
+
// case-sensitive, like the library matchers.
|
|
33
|
+
exports.REDACTED_QUERY_PARAMS = [
|
|
34
|
+
"sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature", "X-Amz-Signature", "X-Amz-Credential", "X-Amz-Security-Token",
|
|
35
|
+
"token", "code", "state", "refresh_token",
|
|
36
|
+
];
|
|
37
|
+
function decodeKey(k) {
|
|
38
|
+
try {
|
|
39
|
+
return decodeURIComponent(k.replace(/\+/g, " "));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return k;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function redactQuery(query) {
|
|
46
|
+
const q = query.startsWith("?") ? query.slice(1) : query;
|
|
47
|
+
return q
|
|
48
|
+
.split("&")
|
|
49
|
+
.map((pair) => {
|
|
50
|
+
const [k = ""] = pair.split("=");
|
|
51
|
+
return exports.REDACTED_QUERY_PARAMS.includes(decodeKey(k)) ? `${k}=REDACTED` : pair;
|
|
52
|
+
})
|
|
53
|
+
.join("&");
|
|
54
|
+
}
|
|
55
|
+
function telemetryInstrumentations() {
|
|
56
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
57
|
+
const { HttpInstrumentation } = require("@opentelemetry/instrumentation-http");
|
|
58
|
+
const { ExpressInstrumentation } = require("@opentelemetry/instrumentation-express");
|
|
59
|
+
const { UndiciInstrumentation } = require("@opentelemetry/instrumentation-undici");
|
|
60
|
+
const { PgInstrumentation } = require("@opentelemetry/instrumentation-pg");
|
|
61
|
+
const { IORedisInstrumentation } = require("@opentelemetry/instrumentation-ioredis");
|
|
62
|
+
const { AmqplibInstrumentation } = require("@opentelemetry/instrumentation-amqplib");
|
|
63
|
+
const { PinoInstrumentation } = require("@opentelemetry/instrumentation-pino");
|
|
64
|
+
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
65
|
+
return [
|
|
66
|
+
new HttpInstrumentation({
|
|
67
|
+
ignoreIncomingRequestHook: (req) => isProbePath(req.url),
|
|
68
|
+
requireParentforOutgoingSpans: true,
|
|
69
|
+
redactedQueryParamsServer: exports.REDACTED_QUERY_PARAMS,
|
|
70
|
+
redactedQueryParams: exports.REDACTED_QUERY_PARAMS,
|
|
71
|
+
}),
|
|
72
|
+
new ExpressInstrumentation(),
|
|
73
|
+
// undici has no redaction option; it records url.full and url.query with only
|
|
74
|
+
// its built-in list, so the request hook overwrites both.
|
|
75
|
+
new UndiciInstrumentation({
|
|
76
|
+
requireParentforSpans: true,
|
|
77
|
+
requestHook: (span, request) => {
|
|
78
|
+
const q = request.path.indexOf("?");
|
|
79
|
+
if (q < 0)
|
|
80
|
+
return;
|
|
81
|
+
const query = redactQuery(request.path.slice(q));
|
|
82
|
+
span.setAttribute("url.query", query);
|
|
83
|
+
span.setAttribute("url.full", `${request.origin}${request.path.slice(0, q)}?${query}`);
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
new PgInstrumentation({ requireParentSpan: true }),
|
|
87
|
+
// Command name only: arguments carry login emails, client IPs and BullMQ job data.
|
|
88
|
+
new IORedisInstrumentation({ dbStatementSerializer: (cmd) => cmd }),
|
|
89
|
+
new AmqplibInstrumentation(),
|
|
90
|
+
new PinoInstrumentation({
|
|
91
|
+
// Traces only: no OTLP log records from every pino line.
|
|
92
|
+
disableLogSending: true,
|
|
93
|
+
// Only sampled lines carry ids; an unsampled trace id is a dead link.
|
|
94
|
+
logHook: (span, record) => {
|
|
95
|
+
if ((span.spanContext().traceFlags & 1) === 0) {
|
|
96
|
+
delete record["trace_id"];
|
|
97
|
+
delete record["span_id"];
|
|
98
|
+
delete record["trace_flags"];
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
function createTelemetrySdk(env) {
|
|
105
|
+
if (!shouldStartTelemetry(env))
|
|
106
|
+
return null;
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
108
|
+
const { NodeSDK: Sdk } = require("@opentelemetry/sdk-node");
|
|
109
|
+
// No traceExporter: OTEL_TRACES_EXPORTER, OTEL_EXPORTER_OTLP_* and
|
|
110
|
+
// OTEL_TRACES_SAMPLER* are read from the environment by the SDK. The empty
|
|
111
|
+
// arrays stop the SDK defaulting logs and metrics exporters to otlp.
|
|
112
|
+
return new Sdk({
|
|
113
|
+
serviceName: telemetryServiceName(env),
|
|
114
|
+
instrumentations: telemetryInstrumentations(),
|
|
115
|
+
metricReaders: [],
|
|
116
|
+
logRecordProcessors: [],
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":";;;AAWA,oDAGC;AAED,oDAEC;AAED,kCAIC;AAmBD,kCASC;AAED,8DA+CC;AAED,gDAaC;AAjHD,8EAA8E;AAC9E,kFAAkF;AAElF,6EAA6E;AAC7E,6EAA6E;AAE7E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAErE,SAAgB,oBAAoB,CAAC,GAAsB;IACzD,IAAI,GAAG,CAAC,mBAAmB,CAAC,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,IAAI,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAsB;IACzD,OAAO,GAAG,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,IAAI,iBAAiB,CAAC;AAC9E,CAAC;AAED,SAAgB,WAAW,CAAC,GAAuB;IACjD,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,OAAO,WAAW,CAAC,GAA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ACF,IAAI,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;QAClD,mFAAmF;QACnF,IAAI,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;QACnE,IAAI,sBAAsB,EAAE;QAC5B,IAAI,mBAAmB,CAAC;YACtB,yDAAyD;YACzD,iBAAiB,EAAE,IAAI;YACvB,sEAAsE;YACtE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC9C,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC;oBAC1B,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;oBACzB,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,GAAsB;IACvD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,iEAAiE;IACjE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAA6C,CAAC;IACxG,mEAAmE;IACnE,2EAA2E;IAC3E,qEAAqE;IACrE,OAAO,IAAI,GAAG,CAAC;QACb,WAAW,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACtC,gBAAgB,EAAE,yBAAyB,EAAE;QAC7C,aAAa,EAAE,EAAE;QACjB,mBAAmB,EAAE,EAAE;KACxB,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyweb/logging",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Shared structured logging for Easyweb microservices: one pino configuration, request-scoped context over AsyncLocalStorage, an HTTP access log, and the redaction every service needs before its logs leave the pod",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"require": "./dist/index.js",
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./register": {
|
|
14
|
+
"require": "./dist/register.js",
|
|
15
|
+
"import": "./dist/register.js",
|
|
16
|
+
"types": "./dist/register.d.ts"
|
|
12
17
|
}
|
|
13
18
|
},
|
|
14
19
|
"files": [
|
|
@@ -22,7 +27,8 @@
|
|
|
22
27
|
"clean": "rimraf dist",
|
|
23
28
|
"test": "jest",
|
|
24
29
|
"typecheck": "tsc --noEmit",
|
|
25
|
-
"typecheck:test": "tsc -p tsconfig.test.json --noEmit"
|
|
30
|
+
"typecheck:test": "tsc -p tsconfig.test.json --noEmit",
|
|
31
|
+
"check:telemetry": "npm run build && node scripts/check-telemetry.js && node scripts/check-telemetry-export.js"
|
|
26
32
|
},
|
|
27
33
|
"keywords": [
|
|
28
34
|
"microservices",
|
|
@@ -55,9 +61,21 @@
|
|
|
55
61
|
"typescript": "^6.0.3"
|
|
56
62
|
},
|
|
57
63
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
64
|
+
"node": ">=22.15.0"
|
|
59
65
|
},
|
|
60
66
|
"publishConfig": {
|
|
61
67
|
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@opentelemetry/api": "^1.10.0",
|
|
71
|
+
"@opentelemetry/instrumentation": "^0.301.2",
|
|
72
|
+
"@opentelemetry/instrumentation-amqplib": "^0.72.0",
|
|
73
|
+
"@opentelemetry/instrumentation-express": "^0.73.0",
|
|
74
|
+
"@opentelemetry/instrumentation-http": "^0.301.2",
|
|
75
|
+
"@opentelemetry/instrumentation-ioredis": "^0.73.0",
|
|
76
|
+
"@opentelemetry/instrumentation-pg": "^0.78.0",
|
|
77
|
+
"@opentelemetry/instrumentation-pino": "^0.71.0",
|
|
78
|
+
"@opentelemetry/instrumentation-undici": "^0.35.1",
|
|
79
|
+
"@opentelemetry/sdk-node": "^0.301.2"
|
|
62
80
|
}
|
|
63
81
|
}
|