@spinajs/log-otlp 2.0.482 → 2.0.484

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.
@@ -0,0 +1,320 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /* eslint-disable promise/always-return */
11
+ /* eslint-disable security/detect-object-injection */
12
+ import { Injectable, PerInstanceCheck } from "@spinajs/di";
13
+ import { Log, LogTarget, Logger, BatchQueue, LogLevelToSeverityNumber, safeStringify } from "@spinajs/log";
14
+ import axios from "axios";
15
+ import { BackoffType, ResiliencePipelineBuilder, TimeSpan } from "@spinajs/util";
16
+ /**
17
+ * HTTP status codes worth retrying against an OTLP endpoint: rate limiting and
18
+ * transient upstream / gateway failures.
19
+ */
20
+ const RETRYABLE_STATUS = new Set([429, 502, 503, 504]);
21
+ /**
22
+ * Decide whether a failed OTLP export is worth retrying.
23
+ *
24
+ * Retryable: any error without an HTTP response ( network / timeout / DNS, eg.
25
+ * ECONNREFUSED / ETIMEDOUT / ECONNRESET / EAI_AGAIN ), or an HTTP response with
26
+ * status 429 / 502 / 503 / 504. Everything else ( 4xx client errors like 400 /
27
+ * 401 / 403 / 404, and any other status ) is treated as a permanent error that
28
+ * must surface rather than loop forever.
29
+ */
30
+ export function isRetryableOtlpError(error) {
31
+ const status = error?.response?.status;
32
+ // No HTTP response -> network / timeout / DNS failure ( axios reports these
33
+ // without a `.response`, carrying codes like ECONNREFUSED / ETIMEDOUT /
34
+ // ECONNRESET / EAI_AGAIN ) -> retryable.
35
+ if (status === undefined) {
36
+ return true;
37
+ }
38
+ return RETRYABLE_STATUS.has(status);
39
+ }
40
+ /**
41
+ * Read a `Retry-After` header from an OTLP error response and return the delay
42
+ * in milliseconds. Supports both the numeric ( delta-seconds ) and HTTP-date
43
+ * forms. Returns `undefined` when there is no usable header.
44
+ */
45
+ export function retryAfterMs(error) {
46
+ const err = error;
47
+ const headers = err?.response?.headers;
48
+ const raw = headers?.["retry-after"];
49
+ if (raw === undefined || raw === null) {
50
+ return undefined;
51
+ }
52
+ const value = Array.isArray(raw) ? raw[0] : raw;
53
+ // numeric delta-seconds ( either a real number or a numeric string )
54
+ const asNumber = typeof value === "number" ? value : Number(value);
55
+ if (typeof value !== "boolean" && !Number.isNaN(asNumber) && `${value}`.trim() !== "") {
56
+ return Math.max(0, asNumber * 1000);
57
+ }
58
+ // HTTP-date form
59
+ const asDate = Date.parse(String(value));
60
+ if (!Number.isNaN(asDate)) {
61
+ return Math.max(0, asDate - Date.now());
62
+ }
63
+ return undefined;
64
+ }
65
+ /**
66
+ * Encode a single scalar / structured value as an OTLP `AnyValue`. Never throws:
67
+ * objects / arrays fall back to a JSON string via `safeStringify`.
68
+ *
69
+ * - string -> `{ stringValue }`
70
+ * - boolean -> `{ boolValue }`
71
+ * - integer number -> `{ intValue: String(v) }`
72
+ * - non-integer number -> `{ doubleValue: v }`
73
+ * - anything else ( object / array / bigint / etc. ) -> `{ stringValue: safeStringify(v) }`
74
+ */
75
+ export function anyValue(v) {
76
+ if (typeof v === "string") {
77
+ return { stringValue: v };
78
+ }
79
+ if (typeof v === "boolean") {
80
+ return { boolValue: v };
81
+ }
82
+ if (typeof v === "number") {
83
+ return Number.isInteger(v) ? { intValue: String(v) } : { doubleValue: v };
84
+ }
85
+ return { stringValue: safeStringify(v) };
86
+ }
87
+ /**
88
+ * Encode a plain record as an array of OTLP `KeyValue`s. Missing / empty input
89
+ * yields an empty array.
90
+ */
91
+ export function kv(obj) {
92
+ if (!obj) {
93
+ return [];
94
+ }
95
+ return Object.keys(obj).map((key) => ({ key, value: anyValue(obj[key]) }));
96
+ }
97
+ /**
98
+ * Variable keys that get dedicated OTLP mapping ( body / severity / trace ) and
99
+ * must therefore be excluded from the generic attribute set.
100
+ */
101
+ const RESERVED_VARIABLE_KEYS = new Set(["message", "level", "traceId", "spanId"]);
102
+ /**
103
+ * Map one buffered record to an OTLP `LogRecord`.
104
+ */
105
+ export function toLogRecord(record) {
106
+ const { entry, timeUnixNano } = record;
107
+ const vars = entry.Variables ?? {};
108
+ const attributes = [];
109
+ for (const key of Object.keys(vars)) {
110
+ if (RESERVED_VARIABLE_KEYS.has(key)) {
111
+ continue;
112
+ }
113
+ const value = vars[key];
114
+ // The serializer registry turns a logged `Error` into a plain
115
+ // `{ name, message, stack, ... }` record. Emit the OTel exception.* semantic
116
+ // convention attributes instead of a raw serialized object.
117
+ if (key === "error" && value !== null && typeof value === "object" && !Array.isArray(value)) {
118
+ const err = value;
119
+ if (err.name !== undefined) {
120
+ attributes.push({ key: "exception.type", value: anyValue(err.name) });
121
+ }
122
+ if (err.message !== undefined) {
123
+ attributes.push({ key: "exception.message", value: anyValue(err.message) });
124
+ }
125
+ if (err.stack !== undefined) {
126
+ attributes.push({ key: "exception.stacktrace", value: anyValue(err.stack) });
127
+ }
128
+ continue;
129
+ }
130
+ attributes.push({ key, value: anyValue(value) });
131
+ }
132
+ const logRecord = {
133
+ timeUnixNano,
134
+ observedTimeUnixNano: timeUnixNano,
135
+ severityNumber: LogLevelToSeverityNumber[entry.Level],
136
+ severityText: vars.level,
137
+ body: { stringValue: String(vars.message ?? "") },
138
+ attributes,
139
+ };
140
+ // traceId / spanId ( hex strings from the http traceparent feature ) become
141
+ // top-level fields on the record, NOT attributes.
142
+ if (vars.traceId !== undefined && vars.traceId !== null) {
143
+ logRecord.traceId = String(vars.traceId);
144
+ }
145
+ if (vars.spanId !== undefined && vars.spanId !== null) {
146
+ logRecord.spanId = String(vars.spanId);
147
+ }
148
+ return logRecord;
149
+ }
150
+ /**
151
+ * Build the full OTLP Logs JSON payload for a batch of records.
152
+ */
153
+ export function toOtlp(batch, resource, scopeName = "@spinajs/log") {
154
+ return {
155
+ resourceLogs: [
156
+ {
157
+ resource: { attributes: kv(resource) },
158
+ scopeLogs: [
159
+ {
160
+ scope: { name: scopeName },
161
+ logRecords: batch.map(toLogRecord),
162
+ },
163
+ ],
164
+ },
165
+ ],
166
+ };
167
+ }
168
+ // we mark per instance check because we can have multiple otlp targets for
169
+ // different endpoints/logs but we dont want to create the writer twice for the
170
+ // same one.
171
+ let OtlpLogTarget = class OtlpLogTarget extends LogTarget {
172
+ constructor(options) {
173
+ super(options);
174
+ /**
175
+ * Set true when the queue overflows maxBufferSize, so the drop warning is
176
+ * emitted ONCE per overflow episode and reset when a flush succeeds.
177
+ */
178
+ this.Overflowed = false;
179
+ // Config-driven targets ( resolved through the logger config ) nest their
180
+ // settings under an `options` sub-object ( like FileTarget ), while direct
181
+ // construction passes them flat. Hoist any nested options onto this.Options
182
+ // at highest precedence so both forms resolve the same flat reads below.
183
+ const nested = (options?.options ?? {});
184
+ this.Options = Object.assign({
185
+ interval: 3000,
186
+ bufferSize: 10,
187
+ maxBufferSize: 1000,
188
+ timeout: 5000,
189
+ scopeName: "@spinajs/log",
190
+ }, this.Options, nested);
191
+ }
192
+ __checkInstance__(creationOptions) {
193
+ return this.Options.name === creationOptions[0].name;
194
+ }
195
+ resolve() {
196
+ this.AxiosInstance = axios.create({
197
+ baseURL: this.Options.endpoint,
198
+ headers: {
199
+ "Content-Type": "application/json",
200
+ ...this.Options.headers,
201
+ },
202
+ timeout: this.Options.timeout,
203
+ });
204
+ // one reusable pipeline: exponential backoff + jitter, 5 attempts, 1s..5s,
205
+ // honoring Retry-After and retrying only transient errors ( network + 429 /
206
+ // 502 / 503 / 504 ). Non-retryable errors fall straight through to .catch.
207
+ this.RetryPipeline = new ResiliencePipelineBuilder()
208
+ .addRetry({
209
+ MaxRetryAttempts: 5,
210
+ Delay: TimeSpan.fromSeconds(1),
211
+ MaxDelay: TimeSpan.fromSeconds(5),
212
+ BackoffType: BackoffType.Exponential,
213
+ UseJitter: true,
214
+ ShouldHandle: (o) => o.Error !== undefined && isRetryableOtlpError(o.Error),
215
+ DelayGenerator: ({ Outcome }) => {
216
+ const ms = retryAfterMs(Outcome.Error);
217
+ return ms !== undefined ? TimeSpan.fromMilliseconds(ms) : undefined;
218
+ },
219
+ })
220
+ .build();
221
+ // one BatchQueue owns accumulation, the periodic flush timer and the
222
+ // maxQueue cap ( dropping the oldest ). The actual export happens in send().
223
+ this.Queue = new BatchQueue({
224
+ maxBatch: this.Options.bufferSize,
225
+ maxQueue: this.Options.maxBufferSize,
226
+ flushIntervalMs: this.Options.interval ?? 3000,
227
+ onFlush: (batch) => this.send(batch),
228
+ onOverflow: (droppedItems) => {
229
+ // emit the drop warning ONCE per overflow episode; reset on the next
230
+ // successful send() so a later episode warns again.
231
+ if (!this.Overflowed) {
232
+ this.Overflowed = true;
233
+ this.Log.warn(`OTLP buffer exceeded ${this.Options.maxBufferSize} records, dropped ${droppedItems.length} oldest records.`);
234
+ }
235
+ // spill each dropped entry to the fallback ( if a wrapper wired one ) so
236
+ // a durable target catches exactly what overflow discarded. Records wrap
237
+ // the entry, so unwrap to the ILogEntry.
238
+ for (const rec of droppedItems) {
239
+ this.OnDropped?.(rec.entry);
240
+ }
241
+ },
242
+ });
243
+ super.resolve();
244
+ }
245
+ write(data) {
246
+ if (!this.Options.enabled) {
247
+ return;
248
+ }
249
+ // capture the event time now ( wall-clock ms -> OTLP nanosecond string )
250
+ const record = {
251
+ entry: data,
252
+ timeUnixNano: (BigInt(Date.now()) * 1000000n).toString(),
253
+ };
254
+ // fire-and-forget: a size-triggered flush ( when the batch fills ) runs in
255
+ // the background.
256
+ void this.Queue.enqueue(record);
257
+ }
258
+ forceFlush() {
259
+ return this.Queue ? this.Queue.forceFlush() : Promise.resolve();
260
+ }
261
+ async dispose() {
262
+ // stop the flush timer and perform a final best-effort flush.
263
+ await this.Queue.shutdown();
264
+ }
265
+ /**
266
+ * Export a single batch to the OTLP endpoint. Wired as the queue's `onFlush`.
267
+ *
268
+ * MUST resolve ( never reject ) so shutdown()/forceFlush() cannot reject: on a
269
+ * retryable-exhausted failure the batch is requeued at the front, on a
270
+ * non-retryable error it is dropped and surfaced via HasError/Error.
271
+ */
272
+ async send(batch) {
273
+ const payload = toOtlp(batch, this.Options.resource, this.Options.scopeName);
274
+ // wrap ONLY the push in the resilience pipeline: transient failures are
275
+ // retried inline with backoff; we reach the catch only after retries are
276
+ // exhausted or immediately on a non-retryable error.
277
+ try {
278
+ await this.RetryPipeline.execute(() => this.AxiosInstance.post("/v1/logs", payload).then(() => undefined));
279
+ // successful export -> clear any previous error state
280
+ this.HasError = false;
281
+ this.Error = null;
282
+ // drained successfully - allow the next overflow episode to warn again
283
+ this.Overflowed = false;
284
+ this.Log.trace(`Wrote buffered messages to OTLP target at ${this.Options.endpoint}, ${batch.length} records.`);
285
+ }
286
+ catch (err) {
287
+ // reached only after retries are exhausted ( transient ) or immediately
288
+ // for a non-retryable error.
289
+ this.HasError = true;
290
+ this.Error = err;
291
+ if (isRetryableOtlpError(err)) {
292
+ // retryable but exhausted: put the batch back at the front so the next
293
+ // flush retries it. The queue enforces the maxQueue cap ( dropping the
294
+ // oldest + onOverflow ) so the retry buffer never grows without bound.
295
+ this.Log.error(err, `Cannot export log records to OTLP target - retries exhausted, retaining records for next flush.`);
296
+ this.Queue.requeueFront(batch);
297
+ return;
298
+ }
299
+ // permanent error ( eg. 400 malformed, 401 bad auth ): retrying forever
300
+ // would only hide a config problem. Drop the batch and surface it, but
301
+ // first spill each undelivered entry to the fallback ( if a wrapper wired
302
+ // one ) so a durable target catches exactly what was not delivered.
303
+ for (const rec of batch) {
304
+ this.OnDropped?.(rec.entry);
305
+ }
306
+ this.Log.error(err, `Cannot export log records to OTLP target - dropping ${batch.length} records because the error is non-retryable.`);
307
+ }
308
+ }
309
+ };
310
+ __decorate([
311
+ Logger("LogOtlpTarget"),
312
+ __metadata("design:type", Log)
313
+ ], OtlpLogTarget.prototype, "Log", void 0);
314
+ OtlpLogTarget = __decorate([
315
+ PerInstanceCheck(),
316
+ Injectable("OtlpLogTarget"),
317
+ __metadata("design:paramtypes", [Object])
318
+ ], OtlpLogTarget);
319
+ export { OtlpLogTarget };
320
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAA0C;AAC1C,qDAAqD;AACrD,OAAO,EAAkB,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAa,SAAS,EAAwB,MAAM,EAAE,UAAU,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5I,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAsB,yBAAyB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAErG;;;GAGG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE/D;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,MAAM,GAAI,KAAgC,EAAE,QAAQ,EAAE,MAAM,CAAC;IAEnE,4EAA4E;IAC5E,wEAAwE;IACxE,yCAAyC;IACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,K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