autotel-devtools 8.1.1 → 9.0.0
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/cli.cjs +108 -1429
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +109 -1422
- package/dist/cli.js.map +1 -1
- package/dist/error-aggregator-BvNmgn7E.d.ts +120 -0
- package/dist/error-aggregator-nnfbpSR7.d.cts +120 -0
- package/dist/exporter-1Y3GmLVS.d.cts +182 -0
- package/dist/exporter-CZ5HdD3o.d.ts +182 -0
- package/dist/genai/index.cjs +650 -537
- package/dist/genai/index.cjs.map +1 -1
- package/dist/genai/index.d.cts +164 -157
- package/dist/genai/index.d.ts +164 -157
- package/dist/genai/index.js +649 -536
- package/dist/genai/index.js.map +1 -1
- package/dist/http-BkkKa9C_.js +1128 -0
- package/dist/http-BkkKa9C_.js.map +1 -0
- package/dist/http-Yj6iSrMX.cjs +1275 -0
- package/dist/http-Yj6iSrMX.cjs.map +1 -0
- package/dist/index.cjs +50 -1728
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -23
- package/dist/index.d.ts +21 -23
- package/dist/index.js +44 -1716
- package/dist/index.js.map +1 -1
- package/dist/listen-BBsxO0wm.cjs +125 -0
- package/dist/listen-BBsxO0wm.cjs.map +1 -0
- package/dist/listen-DfOCquUq.js +120 -0
- package/dist/listen-DfOCquUq.js.map +1 -0
- package/dist/resource-utils-B4UVvfnH.js +18 -0
- package/dist/resource-utils-B4UVvfnH.js.map +1 -0
- package/dist/resource-utils-DjHJB6uc.cjs +24 -0
- package/dist/resource-utils-DjHJB6uc.cjs.map +1 -0
- package/dist/server/exporter.cjs +135 -159
- package/dist/server/exporter.cjs.map +1 -1
- package/dist/server/exporter.d.cts +2 -4
- package/dist/server/exporter.d.ts +2 -4
- package/dist/server/exporter.js +134 -158
- package/dist/server/exporter.js.map +1 -1
- package/dist/server/index.cjs +29 -1660
- package/dist/server/index.d.cts +34 -31
- package/dist/server/index.d.ts +34 -31
- package/dist/server/index.js +5 -1630
- package/dist/server/log-exporter.cjs +75 -102
- package/dist/server/log-exporter.cjs.map +1 -1
- package/dist/server/log-exporter.d.cts +27 -46
- package/dist/server/log-exporter.d.ts +27 -46
- package/dist/server/log-exporter.js +74 -100
- package/dist/server/log-exporter.js.map +1 -1
- package/dist/server/remote-exporter.cjs +171 -213
- package/dist/server/remote-exporter.cjs.map +1 -1
- package/dist/server/remote-exporter.d.cts +62 -82
- package/dist/server/remote-exporter.d.ts +62 -82
- package/dist/server/remote-exporter.js +170 -212
- package/dist/server/remote-exporter.js.map +1 -1
- package/package.json +5 -5
- package/dist/error-aggregator-D0Uu5r38.d.ts +0 -147
- package/dist/error-aggregator-D1Mr221Y.d.cts +0 -147
- package/dist/exporter-De6p4iAD.d.cts +0 -182
- package/dist/exporter-De6p4iAD.d.ts +0 -182
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.js.map +0 -1
package/dist/server/index.d.cts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Server } from 'node:http';
|
|
7
|
-
import '@opentelemetry/sdk-trace-base';
|
|
8
|
-
import '@opentelemetry/core';
|
|
9
|
-
import '@opentelemetry/sdk-logs';
|
|
1
|
+
import { a as ErrorGroup, c as MetricData, i as DevtoolsData, l as SpanData, n as DevtoolsServer, o as ErrorOccurrence, r as DevtoolsServerOptions, s as LogData, t as DevtoolsSpanExporter, u as TraceData } from "../exporter-1Y3GmLVS.cjs";
|
|
2
|
+
import { DevtoolsLogExporter } from "./log-exporter.cjs";
|
|
3
|
+
import { DevtoolsRemoteExporter, DevtoolsRemoteExporterOptions } from "./remote-exporter.cjs";
|
|
4
|
+
import { t as ErrorAggregator } from "../error-aggregator-nnfbpSR7.cjs";
|
|
5
|
+
import { Server } from "node:http";
|
|
10
6
|
|
|
7
|
+
//#region src/server/http.d.ts
|
|
11
8
|
interface HttpServerOptions {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
port?: number;
|
|
10
|
+
host?: string;
|
|
14
11
|
}
|
|
15
12
|
interface DevtoolsRoutesOptions {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
/** Bound to a loopback host (the default). Enables the DNS-rebinding `Host`
|
|
14
|
+
* check on read endpoints; an explicit non-loopback bind opts out. */
|
|
15
|
+
loopbackOnly?: boolean;
|
|
19
16
|
}
|
|
20
17
|
declare function attachDevtoolsRoutes(httpServer: Server, devtools: DevtoolsServer, options?: DevtoolsRoutesOptions): void;
|
|
21
18
|
declare function createDevtoolsHttpServer(devtools: DevtoolsServer, _options?: HttpServerOptions): Server;
|
|
22
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/server/origin-guard.d.ts
|
|
23
21
|
/** True for `localhost`, any `127.x.x.x`, and IPv6 loopback. Case-insensitive. */
|
|
24
22
|
declare function isLoopbackHostname(hostname: string): boolean;
|
|
25
23
|
/** True when the `Host` header names a loopback host. */
|
|
@@ -29,8 +27,8 @@ declare function hostHeaderIsLoopback(host: string): boolean;
|
|
|
29
27
|
* non-loopback. */
|
|
30
28
|
declare function originIsLoopback(origin: string): boolean;
|
|
31
29
|
interface GuardHeaders {
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
origin?: string;
|
|
31
|
+
host?: string;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Decide whether a request to a sensitive (read/mutate) endpoint is allowed.
|
|
@@ -39,7 +37,8 @@ interface GuardHeaders {
|
|
|
39
37
|
* rebinding). Skipped when the receiver is bound to a non-loopback host.
|
|
40
38
|
*/
|
|
41
39
|
declare function allowSensitiveRequest(headers: GuardHeaders, loopbackOnly: boolean): boolean;
|
|
42
|
-
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/server/otlp.d.ts
|
|
43
42
|
declare function parseOtlpTraces(payload: unknown): TraceData[];
|
|
44
43
|
declare function parseOtlpLogs(payload: unknown): LogData[];
|
|
45
44
|
/**
|
|
@@ -48,7 +47,8 @@ declare function parseOtlpLogs(payload: unknown): LogData[];
|
|
|
48
47
|
* `application/protobuf`. Anything else (JSON, unset) is treated as OTLP/JSON.
|
|
49
48
|
*/
|
|
50
49
|
declare function isProtobufContentType(contentType?: string): boolean;
|
|
51
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/server/identity.d.ts
|
|
52
52
|
/** Value of the `x-autotel-devtools` response header and the /healthz `service` field. */
|
|
53
53
|
declare const DEVTOOLS_IDENTITY = "autotel-devtools";
|
|
54
54
|
/** Who is holding a TCP port, as far as we can tell over HTTP:
|
|
@@ -64,29 +64,32 @@ type PortHolder = 'autotel-devtools' | 'foreign' | 'none';
|
|
|
64
64
|
* the wrong process, so the devtools UI stays empty and the app sees errors.
|
|
65
65
|
*/
|
|
66
66
|
declare function probePortHolder(host: string, port: number, timeoutMs?: number): Promise<PortHolder>;
|
|
67
|
-
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/server/otlp-proto.d.ts
|
|
68
69
|
/** Decode an OTLP/protobuf `ExportTraceServiceRequest` into the OTLP/JSON object shape. */
|
|
69
70
|
declare function decodeOtlpTraceRequest(body: Uint8Array): Record<string, unknown>;
|
|
70
71
|
/** Decode an OTLP/protobuf `ExportLogsServiceRequest` into the OTLP/JSON object shape. */
|
|
71
72
|
declare function decodeOtlpLogsRequest(body: Uint8Array): Record<string, unknown>;
|
|
72
73
|
/** Decode an OTLP/protobuf `ExportMetricsServiceRequest` into the OTLP/JSON object shape. */
|
|
73
74
|
declare function decodeOtlpMetricsRequest(body: Uint8Array): Record<string, unknown>;
|
|
74
|
-
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/server/telemetry-limits.d.ts
|
|
75
77
|
interface TelemetryLimits {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
maxTraceCount: number;
|
|
79
|
+
maxLogCount: number;
|
|
80
|
+
maxMetricCount: number;
|
|
79
81
|
}
|
|
80
82
|
interface ResolveTelemetryLimitsArgs {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
maxHistory?: number;
|
|
84
|
+
maxTraceCount?: number;
|
|
85
|
+
maxLogCount?: number;
|
|
86
|
+
maxMetricCount?: number;
|
|
87
|
+
env?: NodeJS.ProcessEnv;
|
|
86
88
|
}
|
|
87
89
|
declare function resolveTelemetryLimits(args?: ResolveTelemetryLimitsArgs): TelemetryLimits;
|
|
88
90
|
declare function appendWithLimit<T>(items: T[], item: T, limit: number): T[];
|
|
89
91
|
declare function appendManyWithLimit<T>(items: T[], incoming: T[], limit: number): T[];
|
|
90
92
|
declare function applyTelemetryLimits(data: DevtoolsData, limits: TelemetryLimits): DevtoolsData;
|
|
91
|
-
|
|
92
|
-
export { DEVTOOLS_IDENTITY, DevtoolsData, type DevtoolsRoutesOptions, DevtoolsServer, type HttpServerOptions, LogData, type PortHolder, type TelemetryLimits, TraceData, allowSensitiveRequest, appendManyWithLimit, appendWithLimit, applyTelemetryLimits, attachDevtoolsRoutes, createDevtoolsHttpServer, decodeOtlpLogsRequest, decodeOtlpMetricsRequest, decodeOtlpTraceRequest, hostHeaderIsLoopback, isLoopbackHostname, isProtobufContentType, originIsLoopback, parseOtlpLogs, parseOtlpTraces, probePortHolder, resolveTelemetryLimits };
|
|
93
|
+
//#endregion
|
|
94
|
+
export { DEVTOOLS_IDENTITY, type DevtoolsData, DevtoolsLogExporter, DevtoolsRemoteExporter, type DevtoolsRemoteExporterOptions, type DevtoolsRoutesOptions, DevtoolsServer, type DevtoolsServerOptions, DevtoolsSpanExporter, ErrorAggregator, type ErrorGroup, type ErrorOccurrence, type HttpServerOptions, type LogData, type MetricData, type PortHolder, type SpanData, type TelemetryLimits, type TraceData, allowSensitiveRequest, appendManyWithLimit, appendWithLimit, applyTelemetryLimits, attachDevtoolsRoutes, createDevtoolsHttpServer, decodeOtlpLogsRequest, decodeOtlpMetricsRequest, decodeOtlpTraceRequest, hostHeaderIsLoopback, isLoopbackHostname, isProtobufContentType, originIsLoopback, parseOtlpLogs, parseOtlpTraces, probePortHolder, resolveTelemetryLimits };
|
|
95
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Server } from 'node:http';
|
|
7
|
-
import '@opentelemetry/sdk-trace-base';
|
|
8
|
-
import '@opentelemetry/core';
|
|
9
|
-
import '@opentelemetry/sdk-logs';
|
|
1
|
+
import { a as ErrorGroup, c as MetricData, i as DevtoolsData, l as SpanData, n as DevtoolsServer, o as ErrorOccurrence, r as DevtoolsServerOptions, s as LogData, t as DevtoolsSpanExporter, u as TraceData } from "../exporter-CZ5HdD3o.js";
|
|
2
|
+
import { DevtoolsLogExporter } from "./log-exporter.js";
|
|
3
|
+
import { DevtoolsRemoteExporter, DevtoolsRemoteExporterOptions } from "./remote-exporter.js";
|
|
4
|
+
import { t as ErrorAggregator } from "../error-aggregator-BvNmgn7E.js";
|
|
5
|
+
import { Server } from "node:http";
|
|
10
6
|
|
|
7
|
+
//#region src/server/http.d.ts
|
|
11
8
|
interface HttpServerOptions {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
port?: number;
|
|
10
|
+
host?: string;
|
|
14
11
|
}
|
|
15
12
|
interface DevtoolsRoutesOptions {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
/** Bound to a loopback host (the default). Enables the DNS-rebinding `Host`
|
|
14
|
+
* check on read endpoints; an explicit non-loopback bind opts out. */
|
|
15
|
+
loopbackOnly?: boolean;
|
|
19
16
|
}
|
|
20
17
|
declare function attachDevtoolsRoutes(httpServer: Server, devtools: DevtoolsServer, options?: DevtoolsRoutesOptions): void;
|
|
21
18
|
declare function createDevtoolsHttpServer(devtools: DevtoolsServer, _options?: HttpServerOptions): Server;
|
|
22
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/server/origin-guard.d.ts
|
|
23
21
|
/** True for `localhost`, any `127.x.x.x`, and IPv6 loopback. Case-insensitive. */
|
|
24
22
|
declare function isLoopbackHostname(hostname: string): boolean;
|
|
25
23
|
/** True when the `Host` header names a loopback host. */
|
|
@@ -29,8 +27,8 @@ declare function hostHeaderIsLoopback(host: string): boolean;
|
|
|
29
27
|
* non-loopback. */
|
|
30
28
|
declare function originIsLoopback(origin: string): boolean;
|
|
31
29
|
interface GuardHeaders {
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
origin?: string;
|
|
31
|
+
host?: string;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Decide whether a request to a sensitive (read/mutate) endpoint is allowed.
|
|
@@ -39,7 +37,8 @@ interface GuardHeaders {
|
|
|
39
37
|
* rebinding). Skipped when the receiver is bound to a non-loopback host.
|
|
40
38
|
*/
|
|
41
39
|
declare function allowSensitiveRequest(headers: GuardHeaders, loopbackOnly: boolean): boolean;
|
|
42
|
-
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/server/otlp.d.ts
|
|
43
42
|
declare function parseOtlpTraces(payload: unknown): TraceData[];
|
|
44
43
|
declare function parseOtlpLogs(payload: unknown): LogData[];
|
|
45
44
|
/**
|
|
@@ -48,7 +47,8 @@ declare function parseOtlpLogs(payload: unknown): LogData[];
|
|
|
48
47
|
* `application/protobuf`. Anything else (JSON, unset) is treated as OTLP/JSON.
|
|
49
48
|
*/
|
|
50
49
|
declare function isProtobufContentType(contentType?: string): boolean;
|
|
51
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/server/identity.d.ts
|
|
52
52
|
/** Value of the `x-autotel-devtools` response header and the /healthz `service` field. */
|
|
53
53
|
declare const DEVTOOLS_IDENTITY = "autotel-devtools";
|
|
54
54
|
/** Who is holding a TCP port, as far as we can tell over HTTP:
|
|
@@ -64,29 +64,32 @@ type PortHolder = 'autotel-devtools' | 'foreign' | 'none';
|
|
|
64
64
|
* the wrong process, so the devtools UI stays empty and the app sees errors.
|
|
65
65
|
*/
|
|
66
66
|
declare function probePortHolder(host: string, port: number, timeoutMs?: number): Promise<PortHolder>;
|
|
67
|
-
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/server/otlp-proto.d.ts
|
|
68
69
|
/** Decode an OTLP/protobuf `ExportTraceServiceRequest` into the OTLP/JSON object shape. */
|
|
69
70
|
declare function decodeOtlpTraceRequest(body: Uint8Array): Record<string, unknown>;
|
|
70
71
|
/** Decode an OTLP/protobuf `ExportLogsServiceRequest` into the OTLP/JSON object shape. */
|
|
71
72
|
declare function decodeOtlpLogsRequest(body: Uint8Array): Record<string, unknown>;
|
|
72
73
|
/** Decode an OTLP/protobuf `ExportMetricsServiceRequest` into the OTLP/JSON object shape. */
|
|
73
74
|
declare function decodeOtlpMetricsRequest(body: Uint8Array): Record<string, unknown>;
|
|
74
|
-
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/server/telemetry-limits.d.ts
|
|
75
77
|
interface TelemetryLimits {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
maxTraceCount: number;
|
|
79
|
+
maxLogCount: number;
|
|
80
|
+
maxMetricCount: number;
|
|
79
81
|
}
|
|
80
82
|
interface ResolveTelemetryLimitsArgs {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
maxHistory?: number;
|
|
84
|
+
maxTraceCount?: number;
|
|
85
|
+
maxLogCount?: number;
|
|
86
|
+
maxMetricCount?: number;
|
|
87
|
+
env?: NodeJS.ProcessEnv;
|
|
86
88
|
}
|
|
87
89
|
declare function resolveTelemetryLimits(args?: ResolveTelemetryLimitsArgs): TelemetryLimits;
|
|
88
90
|
declare function appendWithLimit<T>(items: T[], item: T, limit: number): T[];
|
|
89
91
|
declare function appendManyWithLimit<T>(items: T[], incoming: T[], limit: number): T[];
|
|
90
92
|
declare function applyTelemetryLimits(data: DevtoolsData, limits: TelemetryLimits): DevtoolsData;
|
|
91
|
-
|
|
92
|
-
export { DEVTOOLS_IDENTITY, DevtoolsData, type DevtoolsRoutesOptions, DevtoolsServer, type HttpServerOptions, LogData, type PortHolder, type TelemetryLimits, TraceData, allowSensitiveRequest, appendManyWithLimit, appendWithLimit, applyTelemetryLimits, attachDevtoolsRoutes, createDevtoolsHttpServer, decodeOtlpLogsRequest, decodeOtlpMetricsRequest, decodeOtlpTraceRequest, hostHeaderIsLoopback, isLoopbackHostname, isProtobufContentType, originIsLoopback, parseOtlpLogs, parseOtlpTraces, probePortHolder, resolveTelemetryLimits };
|
|
93
|
+
//#endregion
|
|
94
|
+
export { DEVTOOLS_IDENTITY, type DevtoolsData, DevtoolsLogExporter, DevtoolsRemoteExporter, type DevtoolsRemoteExporterOptions, type DevtoolsRoutesOptions, DevtoolsServer, type DevtoolsServerOptions, DevtoolsSpanExporter, ErrorAggregator, type ErrorGroup, type ErrorOccurrence, type HttpServerOptions, type LogData, type MetricData, type PortHolder, type SpanData, type TelemetryLimits, type TraceData, allowSensitiveRequest, appendManyWithLimit, appendWithLimit, applyTelemetryLimits, attachDevtoolsRoutes, createDevtoolsHttpServer, decodeOtlpLogsRequest, decodeOtlpMetricsRequest, decodeOtlpTraceRequest, hostHeaderIsLoopback, isLoopbackHostname, isProtobufContentType, originIsLoopback, parseOtlpLogs, parseOtlpTraces, probePortHolder, resolveTelemetryLimits };
|
|
95
|
+
//# sourceMappingURL=index.d.ts.map
|