@nxgt/telemetry-otlp 0.2.0 → 0.2.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/export/errors.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/export/errors.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C,iFAAiF;AACjF,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B;;;;;;;;GAQG;AACH,8BAAsB,SAAU,SAAQ,KAAK;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAGzB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM;CAOjB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,SAAkB,IAAI,0BAA0B;IAChD,8CAA8C;IAC9C,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/export/errors.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C,iFAAiF;AACjF,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B;;;;;;;;GAQG;AACH,8BAAsB,SAAU,SAAQ,KAAK;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAGzB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM;CAOjB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,SAAkB,IAAI,0BAA0B;IAChD,8CAA8C;IAC9C,SAAkB,KAAK,EAAE,OAAO,CAAC;gBAGhC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO;CAUf;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;IAC9C,SAAkB,IAAI,sBAAsB;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGrB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM;CAWb;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAC/C,SAAkB,IAAI,uBAAuB;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGrB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM;CAWb"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
var BODY_LIMIT = 500;
|
|
3
3
|
|
|
4
4
|
class OtlpError extends Error {
|
|
5
|
+
url;
|
|
6
|
+
signal;
|
|
7
|
+
attempts;
|
|
5
8
|
constructor(message, url, signal, attempts) {
|
|
6
9
|
super(message);
|
|
7
10
|
this.url = url;
|
|
@@ -11,26 +14,31 @@ class OtlpError extends Error {
|
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
class OtlpUnreachableError extends OtlpError {
|
|
17
|
+
name = "OtlpUnreachableError";
|
|
18
|
+
cause;
|
|
14
19
|
constructor(url, signal, attempts, cause) {
|
|
15
20
|
super(`[telemetry] ${url} did not answer for ${signal} after ${attempts} attempt(s)`, url, signal, attempts);
|
|
16
|
-
this.name = "OtlpUnreachableError";
|
|
17
21
|
this.cause = cause;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
class OtlpRefusedError extends OtlpError {
|
|
26
|
+
name = "OtlpRefusedError";
|
|
27
|
+
status;
|
|
28
|
+
body;
|
|
22
29
|
constructor(url, signal, attempts, status, body) {
|
|
23
30
|
super(`[telemetry] ${url} refused ${signal} with ${status} after ${attempts} attempt(s): ${body}`, url, signal, attempts);
|
|
24
|
-
this.name = "OtlpRefusedError";
|
|
25
31
|
this.status = status;
|
|
26
32
|
this.body = body;
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
class OtlpRejectedError extends OtlpError {
|
|
37
|
+
name = "OtlpRejectedError";
|
|
38
|
+
status;
|
|
39
|
+
body;
|
|
31
40
|
constructor(url, signal, attempts, status, body) {
|
|
32
41
|
super(`[telemetry] ${url} rejected ${signal} with ${status}: ${body}`, url, signal, attempts);
|
|
33
|
-
this.name = "OtlpRejectedError";
|
|
34
42
|
this.status = status;
|
|
35
43
|
this.body = body;
|
|
36
44
|
}
|
|
@@ -343,5 +351,5 @@ export {
|
|
|
343
351
|
wait
|
|
344
352
|
};
|
|
345
353
|
|
|
346
|
-
//# debugId=
|
|
354
|
+
//# debugId=51D3B55FD27ED63764756E2164756E21
|
|
347
355
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/export/errors.ts", "../src/wire/convert.ts", "../src/export/transport.ts", "../src/export/otlp.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/** Which document failed. A mixed batch is two requests, and either can fail. */\nexport type OtlpSignal = 'logs' | 'traces';\n\n/** How much of a collector's answer is kept. Enough to read; not a log flood. */\nexport const BODY_LIMIT = 500;\n\n/**\n * The shared shape. All three are thrown out of `export`, which means they\n * reach `onExportError` and nothing else: a collector being down is not a\n * reason for a request to fail.\n *\n * They are plain classes with a `name` rather than a discriminated union\n * because that is what a `catch` reads, and `instanceof` across two copies of\n * this package would answer false.\n */\nexport abstract class OtlpError extends Error {\n\t/**\n\t * The request URL — the endpoint and the path — **with any credentials\n\t * removed**. A vendor's collector URL carries its key in the userinfo or\n\t * the query string often enough that a failure must not be the thing that\n\t * writes it to a log.\n\t */\n\treadonly url: string;\n\treadonly signal: OtlpSignal;\n\t/** How many requests were made, including the one that failed. */\n\treadonly attempts: number;\n\n\tconstructor(\n\t\tmessage: string,\n\t\turl: string,\n\t\tsignal: OtlpSignal,\n\t\tattempts: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.url = url;\n\t\tthis.signal = signal;\n\t\tthis.attempts = attempts;\n\t}\n}\n\n/**\n * The collector never answered: DNS, a refused connection, a timeout. Retried\n * to the end of `attempts` before this is thrown.\n */\nexport class OtlpUnreachableError extends OtlpError {\n\toverride readonly name = 'OtlpUnreachableError';\n\t/** What `fetch` threw on the last attempt. */\n\
|
|
5
|
+
"/** Which document failed. A mixed batch is two requests, and either can fail. */\nexport type OtlpSignal = 'logs' | 'traces';\n\n/** How much of a collector's answer is kept. Enough to read; not a log flood. */\nexport const BODY_LIMIT = 500;\n\n/**\n * The shared shape. All three are thrown out of `export`, which means they\n * reach `onExportError` and nothing else: a collector being down is not a\n * reason for a request to fail.\n *\n * They are plain classes with a `name` rather than a discriminated union\n * because that is what a `catch` reads, and `instanceof` across two copies of\n * this package would answer false.\n */\nexport abstract class OtlpError extends Error {\n\t/**\n\t * The request URL — the endpoint and the path — **with any credentials\n\t * removed**. A vendor's collector URL carries its key in the userinfo or\n\t * the query string often enough that a failure must not be the thing that\n\t * writes it to a log.\n\t */\n\treadonly url: string;\n\treadonly signal: OtlpSignal;\n\t/** How many requests were made, including the one that failed. */\n\treadonly attempts: number;\n\n\tconstructor(\n\t\tmessage: string,\n\t\turl: string,\n\t\tsignal: OtlpSignal,\n\t\tattempts: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.url = url;\n\t\tthis.signal = signal;\n\t\tthis.attempts = attempts;\n\t}\n}\n\n/**\n * The collector never answered: DNS, a refused connection, a timeout. Retried\n * to the end of `attempts` before this is thrown.\n */\nexport class OtlpUnreachableError extends OtlpError {\n\toverride readonly name = 'OtlpUnreachableError';\n\t/** What `fetch` threw on the last attempt. */\n\toverride readonly cause: unknown;\n\n\tconstructor(\n\t\turl: string,\n\t\tsignal: OtlpSignal,\n\t\tattempts: number,\n\t\tcause: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`[telemetry] ${url} did not answer for ${signal} after ${attempts} attempt(s)`,\n\t\t\turl,\n\t\t\tsignal,\n\t\t\tattempts,\n\t\t);\n\t\tthis.cause = cause;\n\t}\n}\n\n/**\n * The collector answered, and kept answering, with a status worth retrying —\n * `408`, `429`, or a `5xx` it declares. The queue it was busy with is still\n * busy.\n */\nexport class OtlpRefusedError extends OtlpError {\n\toverride readonly name = 'OtlpRefusedError';\n\treadonly status: number;\n\t/** The first `BODY_LIMIT` characters of the last answer. */\n\treadonly body: string;\n\n\tconstructor(\n\t\turl: string,\n\t\tsignal: OtlpSignal,\n\t\tattempts: number,\n\t\tstatus: number,\n\t\tbody: string,\n\t) {\n\t\tsuper(\n\t\t\t`[telemetry] ${url} refused ${signal} with ${status} after ${attempts} attempt(s): ${body}`,\n\t\t\turl,\n\t\t\tsignal,\n\t\t\tattempts,\n\t\t);\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t}\n}\n\n/**\n * The collector rejected the request outright — a bad path, a missing header, a\n * document it will not accept. **Not retried**: sending the same bytes again\n * gets the same answer, and the batch is lost either way.\n */\nexport class OtlpRejectedError extends OtlpError {\n\toverride readonly name = 'OtlpRejectedError';\n\treadonly status: number;\n\t/** The first `BODY_LIMIT` characters of the answer. */\n\treadonly body: string;\n\n\tconstructor(\n\t\turl: string,\n\t\tsignal: OtlpSignal,\n\t\tattempts: number,\n\t\tstatus: number,\n\t\tbody: string,\n\t) {\n\t\tsuper(\n\t\t\t`[telemetry] ${url} rejected ${signal} with ${status}: ${body}`,\n\t\t\turl,\n\t\t\tsignal,\n\t\t\tattempts,\n\t\t);\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t}\n}\n",
|
|
6
6
|
"import type {\n\tAttributes,\n\tAttributeValue,\n\tErrorInfo,\n\tLogRecord,\n\tResource,\n\tSignal,\n\tSpanRecord,\n\tSpanStatus,\n} from '@nxgt/telemetry';\nimport { SEVERITY_NUMBER, SPAN_KIND_NUMBER } from '@nxgt/telemetry';\nimport type {\n\tAnyValue,\n\tExportLogsServiceRequest,\n\tExportTraceServiceRequest,\n\tKeyValue,\n\tOtlpLogRecord,\n\tOtlpResource,\n\tOtlpSpan,\n\tOtlpSpanEvent,\n\tScopeLogs,\n} from './documents';\n\n/** The instrumentation scope reported for spans. Logs report their `source`. */\nexport const SPAN_SCOPE = 'nxgt-telemetry';\n\n/**\n * `ok` maps to `1` and `error` to `2`, and **`cancelled` maps to `0`** — unset,\n * not error. A shutdown and a timeout are not failures, and a dashboard that\n * counts them as such is a dashboard nobody trusts; OTLP has no third code, so\n * the honest answer is to say nothing rather than to say \"failed\".\n */\nexport const STATUS_CODE: Readonly<Record<SpanStatus, number>> = Object.freeze({\n\tok: 1,\n\terror: 2,\n\tcancelled: 0,\n});\n\n/**\n * Epoch milliseconds to the decimal nanoseconds OTLP wants, through `BigInt`.\n *\n * A `number` would be wrong from 2001 onwards: `Date.now() * 1e6` is well past\n * `Number.MAX_SAFE_INTEGER`, so the last digits are whatever the float rounds\n * to, and two signals a microsecond apart arrive with the same timestamp.\n */\nexport function nanos(at: number): string {\n\treturn (BigInt(Math.round(at)) * 1_000_000n).toString();\n}\n\n/** A scalar, tagged the way OTLP tags it. */\nexport function anyValue(value: AttributeValue): AnyValue {\n\tif (value === null) return {};\n\tif (typeof value === 'string') return { stringValue: value };\n\tif (typeof value === 'boolean') return { boolValue: value };\n\n\tif (typeof value === 'number') {\n\t\t// A whole number is an integer to every backend that groups by it, and\n\t\t// it crosses as text so that the low bits survive.\n\t\t//\n\t\t// **Safe**, not merely whole: `Number.isInteger` is true well past the\n\t\t// safe range, and `String` switches to exponential notation at 1e21.\n\t\t// `1e21` would be sent as `\"1e+21\"`, which is not the decimal string\n\t\t// OTLP asks for; `1e20` is decimal but past `int64`; and `2 ** 60`\n\t\t// would arrive with the wrong last three digits. A collector rejects\n\t\t// the first two with a `400`, which is not retried — so one attribute\n\t\t// would lose the whole document. Past the safe range the honest answer\n\t\t// is a double, which is all the precision the value had anyway.\n\t\treturn Number.isSafeInteger(value)\n\t\t\t? { intValue: String(value) }\n\t\t\t: { doubleValue: value };\n\t}\n\n\treturn { arrayValue: { values: value.map(anyValue) } };\n}\n\nexport function keyValues(attributes: Attributes): KeyValue[] {\n\treturn Object.keys(attributes).map((key) => ({\n\t\tkey,\n\t\tvalue: anyValue(attributes[key] as AttributeValue),\n\t}));\n}\n\n/**\n * The resource, with `service.name`, `service.version` and\n * `deployment.environment.name` — the three keys every backend looks for, under\n * the names the semantic conventions give them. An attribute already carrying\n * one of those keys wins: it was set deliberately.\n */\nexport function otlpResource(resource: Resource): OtlpResource {\n\tconst declared: Record<string, AttributeValue> = {\n\t\t'service.name': resource.service,\n\t};\n\tif (resource.version !== undefined) {\n\t\tdeclared['service.version'] = resource.version;\n\t}\n\tif (resource.environment !== undefined) {\n\t\tdeclared['deployment.environment.name'] = resource.environment;\n\t}\n\n\treturn { attributes: keyValues({ ...declared, ...resource.attributes }) };\n}\n\n/**\n * The logs of a batch, **grouped by `source`** into one scope each: the logger's\n * name is the instrumentation scope, which is what lets a backend filter by the\n * component that wrote the line rather than by the service that ran it.\n *\n * `undefined` when there is nothing to send — an empty document is a request\n * worth not making.\n */\nexport function logsRequest(\n\tresource: Resource,\n\tbatch: readonly Signal[],\n): ExportLogsServiceRequest | undefined {\n\tconst bySource = new Map<string, OtlpLogRecord[]>();\n\n\tfor (const signal of batch) {\n\t\tif (signal.type !== 'log') continue;\n\t\tconst found = bySource.get(signal.source) ?? [];\n\t\tfound.push(otlpLog(signal));\n\t\tbySource.set(signal.source, found);\n\t}\n\n\tif (bySource.size === 0) return undefined;\n\n\tconst scopeLogs: ScopeLogs[] = [...bySource].map(([name, logRecords]) => ({\n\t\tscope: { name },\n\t\tlogRecords,\n\t}));\n\n\treturn { resourceLogs: [{ resource: otlpResource(resource), scopeLogs }] };\n}\n\n/**\n * The spans of a batch, in one scope named for this library. A span has no\n * `source` — it is named for the work, not for the component — so there is\n * nothing to group by.\n */\nexport function tracesRequest(\n\tresource: Resource,\n\tbatch: readonly Signal[],\n): ExportTraceServiceRequest | undefined {\n\tconst spans = batch\n\t\t.filter((signal): signal is SpanRecord => signal.type === 'span')\n\t\t.map(otlpSpan);\n\n\tif (spans.length === 0) return undefined;\n\n\treturn {\n\t\tresourceSpans: [\n\t\t\t{\n\t\t\t\tresource: otlpResource(resource),\n\t\t\t\tscopeSpans: [{ scope: { name: SPAN_SCOPE }, spans }],\n\t\t\t},\n\t\t],\n\t};\n}\n\nfunction otlpLog(log: LogRecord): OtlpLogRecord {\n\tconst at = nanos(log.at);\n\n\treturn {\n\t\ttimeUnixNano: at,\n\t\t// The same instant: this library records when the line was written, and\n\t\t// has nothing else to observe it at.\n\t\tobservedTimeUnixNano: at,\n\t\tseverityNumber: SEVERITY_NUMBER[log.severity],\n\t\tseverityText: log.severity.toUpperCase(),\n\t\t// The body is the event's name, or the message when there is no type\n\t\t// for it yet. Everything structured is an attribute.\n\t\tbody: { stringValue: log.name },\n\t\tattributes: keyValues({ ...log.attributes, ...exception(log.error) }),\n\t\t...(log.span === undefined\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\ttraceId: log.span.traceId,\n\t\t\t\t\tspanId: log.span.spanId,\n\t\t\t\t\tflags: log.span.sampled ? 1 : 0,\n\t\t\t\t}),\n\t};\n}\n\nfunction otlpSpan(span: SpanRecord): OtlpSpan {\n\treturn {\n\t\ttraceId: span.context.traceId,\n\t\tspanId: span.context.spanId,\n\t\t...(span.parent === undefined ? {} : { parentSpanId: span.parent }),\n\t\tname: span.name,\n\t\tkind: SPAN_KIND_NUMBER[span.kind],\n\t\tstartTimeUnixNano: nanos(span.startedAt),\n\t\tendTimeUnixNano: nanos(span.endedAt),\n\t\tattributes: keyValues({ ...span.attributes, ...exception(span.error) }),\n\t\tevents: span.events.map(\n\t\t\t(happened): OtlpSpanEvent => ({\n\t\t\t\ttimeUnixNano: nanos(happened.at),\n\t\t\t\tname: happened.name,\n\t\t\t\tattributes: keyValues(happened.attributes),\n\t\t\t}),\n\t\t),\n\t\tstatus: {\n\t\t\tcode: STATUS_CODE[span.status],\n\t\t\t...(span.error?.message === undefined\n\t\t\t\t? {}\n\t\t\t\t: { message: span.error.message }),\n\t\t},\n\t};\n}\n\n/**\n * A failure travels as attributes, under the semantic convention's keys, on a\n * log and on a span alike. There is no dedicated field for it in either\n * document.\n */\nfunction exception(error: ErrorInfo | undefined): Attributes {\n\tif (error === undefined) return {};\n\n\treturn {\n\t\t'exception.type': error.type,\n\t\t...(error.message === undefined\n\t\t\t? {}\n\t\t\t: { 'exception.message': error.message }),\n\t\t...(error.stackTrace === undefined\n\t\t\t? {}\n\t\t\t: { 'exception.stacktrace': error.stackTrace }),\n\t};\n}\n",
|
|
7
7
|
"import * as zlib from 'node:zlib';\nimport type { PartialSuccess } from '../wire/documents';\nimport {\n\tBODY_LIMIT,\n\tOtlpRefusedError,\n\tOtlpRejectedError,\n\ttype OtlpSignal,\n\tOtlpUnreachableError,\n} from './errors';\n\nexport const DEFAULT_TIMEOUT = 10_000;\nexport const DEFAULT_ATTEMPTS = 3;\nexport const DEFAULT_BACKOFF = 500;\n/** Below this, compressing costs more than the bytes it saves. */\nexport const COMPRESSION_FLOOR = 1_024;\n\n/** `null` where `node:zlib` was shimmed away — a browser bundle, usually. */\nconst AVAILABLE_GZIP: typeof zlib.gzip | null =\n\t(zlib as Partial<typeof zlib>).gzip ?? null;\n\n/**\n * The statuses worth sending the same bytes again for. Everything else is the\n * collector saying the request is wrong, and a retry would only repeat it.\n */\nexport const RETRYABLE: ReadonlySet<number> = new Set([\n\t408, 429, 500, 502, 503, 504,\n]);\n\n/** What a collector accepted with reservations. */\nexport interface PartialSuccessReport {\n\treadonly signal: OtlpSignal;\n\t/** How many records the collector threw away. */\n\treadonly rejected: number;\n\treadonly message: string;\n}\n\n/** Everything `post` needs, resolved once when the exporter is built. */\nexport interface Transport {\n\treadonly headers: Readonly<Record<string, string>>;\n\treadonly timeout: number;\n\treadonly attempts: number;\n\treadonly backoff: number;\n\treadonly gzip: boolean;\n\treadonly onPartialSuccess?: (report: PartialSuccessReport) => void;\n\treadonly fetch: typeof fetch;\n\treadonly sleep: (ms: number) => Promise<void>;\n}\n\n/**\n * One document to one URL, retried to the end of `attempts`.\n *\n * The body is encoded **once**, before the loop: a retry sends the same bytes,\n * and gzipping them again each time would be work for nothing.\n */\nexport async function post(\n\ttransport: Transport,\n\turl: string,\n\tsignal: OtlpSignal,\n\tdocument: unknown,\n): Promise<void> {\n\tconst body = await encode(JSON.stringify(document), transport.gzip);\n\tconst named = safeUrl(url);\n\n\tlet failure: unknown;\n\tlet waited = transport.backoff;\n\n\tfor (let attempt = 1; attempt <= transport.attempts; attempt++) {\n\t\tif (attempt > 1) {\n\t\t\tawait transport.sleep(waited);\n\t\t\twaited *= 2;\n\t\t}\n\n\t\tlet reply: Response;\n\t\ttry {\n\t\t\treply = await transport.fetch(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'content-type': 'application/json',\n\t\t\t\t\t...(body.encoded ? { 'content-encoding': 'gzip' } : {}),\n\t\t\t\t\t...transport.headers,\n\t\t\t\t},\n\t\t\t\tbody: body.bytes,\n\t\t\t\tsignal: AbortSignal.timeout(transport.timeout),\n\t\t\t});\n\t\t} catch (thrown) {\n\t\t\t// No answer at all: DNS, a refused connection, the timeout.\n\t\t\tfailure = thrown;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (reply.ok) {\n\t\t\tawait accepted(transport, signal, reply);\n\t\t\treturn;\n\t\t}\n\n\t\tconst text = truncate(await bodyOf(reply));\n\n\t\tif (!RETRYABLE.has(reply.status)) {\n\t\t\t// The same bytes would get the same answer.\n\t\t\tthrow new OtlpRejectedError(named, signal, attempt, reply.status, text);\n\t\t}\n\n\t\tfailure = new OtlpRefusedError(named, signal, attempt, reply.status, text);\n\t}\n\n\tif (failure instanceof OtlpRefusedError) throw failure;\n\tthrow new OtlpUnreachableError(named, signal, transport.attempts, failure);\n}\n\n/**\n * The collector took the request. Its body still has to be read or cancelled:\n * an unconsumed `Response` holds its connection out of the keep-alive pool\n * until it is collected, and this is the path every successful export takes,\n * once per linger interval, for the life of the process.\n */\nasync function accepted(\n\ttransport: Transport,\n\tsignal: OtlpSignal,\n\treply: Response,\n): Promise<void> {\n\tif (transport.onPartialSuccess === undefined) {\n\t\t// Nobody asked what it said, and the ordinary answer is empty.\n\t\tawait reply.body?.cancel().catch(() => undefined);\n\t\treturn;\n\t}\n\n\treport(signal, await partialSuccess(reply), transport.onPartialSuccess);\n}\n\n/**\n * A partial success is **not retried**. The collector took the request and\n * decided about each record in it; sending the same bytes again would duplicate\n * everything it did accept.\n */\nfunction report(\n\tsignal: OtlpSignal,\n\tfound: PartialSuccess | undefined,\n\tonPartialSuccess: (report: PartialSuccessReport) => void,\n): void {\n\tif (found === undefined) return;\n\n\tconst rejected = Number(found.rejectedLogRecords ?? found.rejectedSpans ?? 0);\n\tconst message = found.errorMessage ?? '';\n\tif (rejected === 0 && message === '') return;\n\n\ttry {\n\t\tonPartialSuccess({ signal, rejected, message });\n\t} catch {\n\t\t// A reporting hook that throws must not become an export failure.\n\t}\n}\n\nasync function partialSuccess(\n\treply: Response,\n): Promise<PartialSuccess | undefined> {\n\ttry {\n\t\tconst answered = (await reply.json()) as {\n\t\t\tpartialSuccess?: PartialSuccess;\n\t\t} | null;\n\t\treturn answered?.partialSuccess;\n\t} catch {\n\t\t// An empty body is the ordinary answer, and a collector that sends\n\t\t// something else has still accepted the batch.\n\t\treturn undefined;\n\t}\n}\n\nasync function bodyOf(reply: Response): Promise<string> {\n\ttry {\n\t\treturn await reply.text();\n\t} catch {\n\t\treturn '';\n\t}\n}\n\nfunction truncate(text: string): string {\n\treturn text.length <= BODY_LIMIT ? text : `${text.slice(0, BODY_LIMIT)}…`;\n}\n\n/**\n * The URL as it may be repeated in an error message and read by whatever\n * `onExportError` logs to — **without its credentials**. A collector URL of the\n * shape `https://user:token@otlp.vendor.example/v1/logs` and one with the key\n * in the query string are both things vendors hand out, and a failure is not a\n * reason to put either in a log line.\n */\nexport function safeUrl(url: string): string {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tparsed.username = '';\n\t\tparsed.password = '';\n\t\tparsed.search = '';\n\t\tparsed.hash = '';\n\t\treturn parsed.toString();\n\t} catch {\n\t\t// Not a URL this runtime can parse; `fetch` will say so in its own way.\n\t\treturn url;\n\t}\n}\n\n/**\n * Gzip when it is worth it, and only where `node:zlib` exists. A bundle for the\n * browser that shims the builtin away still exports — uncompressed, which every\n * collector accepts — rather than failing to load.\n */\nexport async function encode(\n\tjson: string,\n\tcompress: boolean,\n\t// `null` is \"there is no gzip here\", which is what a bundler that shims\n\t// `node:zlib` to an empty module leaves behind, whatever the types say. It\n\t// is a parameter so a spec can reach that branch without mocking a builtin.\n\tgzip: typeof zlib.gzip | null = AVAILABLE_GZIP,\n): Promise<{ bytes: Uint8Array<ArrayBuffer>; encoded: boolean }> {\n\tconst bytes = new TextEncoder().encode(json);\n\tif (!compress || bytes.byteLength < COMPRESSION_FLOOR) {\n\t\treturn { bytes, encoded: false };\n\t}\n\n\tif (typeof gzip !== 'function') return { bytes, encoded: false };\n\n\treturn new Promise((resolve) => {\n\t\tgzip(bytes, (failure, result) => {\n\t\t\tresolve(\n\t\t\t\tfailure\n\t\t\t\t\t? { bytes, encoded: false }\n\t\t\t\t\t: // `zlib` answers a `Buffer`, whose buffer is typed as\n\t\t\t\t\t\t// `ArrayBufferLike` — which `BodyInit` excludes because it\n\t\t\t\t\t\t// admits a `SharedArrayBuffer`. This one never is.\n\t\t\t\t\t\t{ bytes: result as Uint8Array<ArrayBuffer>, encoded: true },\n\t\t\t);\n\t\t});\n\t});\n}\n\nexport function wait(ms: number): Promise<void> {\n\treturn new Promise((resolve) => {\n\t\tconst timer = setTimeout(resolve, ms);\n\t\t// A retry in flight must not be the reason a process will not exit.\n\t\ttimer.unref?.();\n\t});\n}\n",
|
|
8
8
|
"import type { Exporter, Resource, Signal } from '@nxgt/telemetry';\nimport { logsRequest, tracesRequest } from '../wire/convert';\nimport {\n\tDEFAULT_ATTEMPTS,\n\tDEFAULT_BACKOFF,\n\tDEFAULT_TIMEOUT,\n\ttype PartialSuccessReport,\n\tpost,\n\ttype Transport,\n\twait,\n} from './transport';\n\nexport const DEFAULT_LOGS_PATH = '/v1/logs';\nexport const DEFAULT_TRACES_PATH = '/v1/traces';\n\nexport interface OtlpExporterOptions {\n\t/** The collector's base URL, e.g. `http://localhost:4318`. */\n\treadonly endpoint: string;\n\t/** Appended to `endpoint`. Default `/v1/logs`. */\n\treadonly logsPath?: string;\n\t/** Appended to `endpoint`. Default `/v1/traces`. */\n\treadonly tracesPath?: string;\n\t/** Sent on every request — an API key, a tenant. */\n\treadonly headers?: Readonly<Record<string, string>>;\n\t/** Per attempt, in milliseconds. Default 10s. */\n\treadonly timeout?: number;\n\t/** How many requests one document gets. Default 3. `1` disables retrying. */\n\treadonly attempts?: number;\n\t/** The first wait between attempts, doubled each time. Default 500ms. */\n\treadonly backoff?: number;\n\t/** Gzip a document over 1 KiB. Default true. */\n\treadonly gzip?: boolean;\n\t/** Called when the collector accepted the request but not every record. */\n\treadonly onPartialSuccess?: (report: PartialSuccessReport) => void;\n\t/** For specs, and for an application that routes its own traffic. */\n\treadonly fetch?: typeof fetch;\n\t/** For specs. Default a `setTimeout` that does not hold the process open. */\n\treadonly sleep?: (ms: number) => Promise<void>;\n}\n\n/**\n * Logs and traces to an OpenTelemetry collector, as OTLP/HTTP JSON.\n *\n * ```ts\n * otlpExporter({ endpoint: 'http://localhost:4318', headers: { 'x-api-key': key } })\n * ```\n *\n * There is no OpenTelemetry SDK behind this. OTLP is a wire format, and the\n * whole of it that a collector needs is two JSON documents over `fetch` — which\n * is what lets this package have one dependency and no transitive tree, and\n * what keeps the context in `AsyncLocalStorage` instead of in the Java SDK's\n * thread-local shape.\n *\n * A mixed batch is **two requests**, one per document, sent together: logs\n * failing must not cost the traces of the same batch. Both are attempted, and\n * both failures are thrown — as an `AggregateError` when there are two —\n * which means they reach `onExportError` and nothing else.\n */\nexport function otlpExporter(options: OtlpExporterOptions): Exporter {\n\tconst endpoint = options.endpoint.replace(/\\/+$/, '');\n\tconst logsUrl = endpoint + (options.logsPath ?? DEFAULT_LOGS_PATH);\n\tconst tracesUrl = endpoint + (options.tracesPath ?? DEFAULT_TRACES_PATH);\n\n\tconst transport: Transport = {\n\t\theaders: options.headers ?? {},\n\t\ttimeout: options.timeout ?? DEFAULT_TIMEOUT,\n\t\tattempts: Math.max(options.attempts ?? DEFAULT_ATTEMPTS, 1),\n\t\tbackoff: options.backoff ?? DEFAULT_BACKOFF,\n\t\tgzip: options.gzip ?? true,\n\t\t...(options.onPartialSuccess === undefined\n\t\t\t? {}\n\t\t\t: { onPartialSuccess: options.onPartialSuccess }),\n\t\tfetch: options.fetch ?? fetch,\n\t\tsleep: options.sleep ?? wait,\n\t};\n\n\treturn {\n\t\tasync export(resource: Resource, batch: readonly Signal[]): Promise<void> {\n\t\t\tconst logs = logsRequest(resource, batch);\n\t\t\tconst traces = tracesRequest(resource, batch);\n\n\t\t\tconst sent = await Promise.allSettled([\n\t\t\t\tlogs === undefined ? undefined : post(transport, logsUrl, 'logs', logs),\n\t\t\t\ttraces === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: post(transport, tracesUrl, 'traces', traces),\n\t\t\t]);\n\n\t\t\tthrowAll(sent);\n\t\t},\n\t};\n}\n\n/**\n * The two documents go to two paths and can fail for unrelated reasons — a\n * `400` on one and a refused connection on the other is not one outage. Losing\n * the second is losing the half of the story that says the collector is not\n * simply down, so both are reported.\n */\nfunction throwAll(sent: readonly PromiseSettledResult<unknown>[]): void {\n\tconst failures = sent\n\t\t.filter((one) => one.status === 'rejected')\n\t\t.map((one) => one.reason as unknown);\n\n\tif (failures.length === 0) return;\n\tif (failures.length === 1) throw failures[0];\n\n\tthrow new AggregateError(\n\t\tfailures,\n\t\t'[telemetry] neither the logs nor the traces of this batch arrived',\n\t);\n}\n"
|
|
9
9
|
],
|
|
10
|
-
"mappings": ";AAIO,IAAM,aAAa;AAAA;AAWnB,MAAe,kBAAkB,MAAM;AAAA,
|
|
11
|
-
"debugId": "
|
|
10
|
+
"mappings": ";AAIO,IAAM,aAAa;AAAA;AAWnB,MAAe,kBAAkB,MAAM;AAAA,EAOpC;AAAA,EACA;AAAA,EAEA;AAAA,EAET,WAAW,CACV,SACA,KACA,QACA,UACC;AAAA,IACD,MAAM,OAAO;AAAA,IACb,KAAK,MAAM;AAAA,IACX,KAAK,SAAS;AAAA,IACd,KAAK,WAAW;AAAA;AAElB;AAAA;AAMO,MAAM,6BAA6B,UAAU;AAAA,EACjC,OAAO;AAAA,EAEP;AAAA,EAElB,WAAW,CACV,KACA,QACA,UACA,OACC;AAAA,IACD,MACC,eAAe,0BAA0B,gBAAgB,uBACzD,KACA,QACA,QACD;AAAA,IACA,KAAK,QAAQ;AAAA;AAEf;AAAA;AAOO,MAAM,yBAAyB,UAAU;AAAA,EAC7B,OAAO;AAAA,EAChB;AAAA,EAEA;AAAA,EAET,WAAW,CAC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E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxgt/telemetry-otlp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "An OTLP/HTTP JSON exporter for @nxgt/telemetry: logs and traces to any OpenTelemetry collector, over fetch, with no OpenTelemetry SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@nxgt/telemetry": "^0.
|
|
53
|
+
"@nxgt/telemetry": "^0.2.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/bun": "^1.4.2"
|