autotel-devtools 22.0.0 → 23.1.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/README.md +183 -28
- package/dist/cli.cjs +80 -13
- package/dist/cli.js +80 -13
- package/dist/compile-JDFHUCo5.d.cts +177 -0
- package/dist/compile-JDFHUCo5.d.ts +177 -0
- package/dist/{error-aggregator-D8VKciLY.d.ts → error-aggregator-B52JI8jL.d.ts} +1 -1
- package/dist/{error-aggregator-DCEKMOm3.d.cts → error-aggregator-DSwUvgFF.d.cts} +1 -1
- package/dist/exporter-C88W22vY.d.ts +576 -0
- package/dist/exporter-OoWkSMCR.d.cts +576 -0
- package/dist/fullpage.global.js +39 -0
- package/dist/grpc-D0B3P9sI.cjs +82 -0
- package/dist/grpc-DY-C1jSU.js +77 -0
- package/dist/http-1afd_01N.cjs +3991 -0
- package/dist/http-gk1xapnA.js +3825 -0
- package/dist/index.cjs +25 -7
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +25 -7
- package/dist/{listen-DBfsfcdd.js → listen-D-lLgfro.js} +5 -2
- package/dist/{listen-CEJ3nYJf.cjs → listen-l09RRHht.cjs} +5 -2
- package/dist/parse-BRlosZft.cjs +642 -0
- package/dist/parse-D_RmPPQs.js +612 -0
- package/dist/query/index.cjs +8 -0
- package/dist/query/index.d.cts +16 -0
- package/dist/query/index.d.ts +16 -0
- package/dist/query/index.js +3 -0
- package/dist/server/exporter.d.cts +1 -1
- package/dist/server/exporter.d.ts +1 -1
- package/dist/server/index.cjs +6 -2
- package/dist/server/index.d.cts +19 -6
- package/dist/server/index.d.ts +18 -5
- package/dist/server/index.js +3 -2
- package/dist/types-B0tjwFqj.d.cts +107 -0
- package/dist/types-DM8y4A9Z.d.ts +107 -0
- package/dist/widget.global.js +15 -24
- package/dist/wire/index.cjs +7 -0
- package/dist/wire/index.d.cts +26 -0
- package/dist/wire/index.d.ts +26 -0
- package/dist/wire/index.js +3 -0
- package/dist/wire-2Rmfg6IT.js +51 -0
- package/dist/wire-CHU1PkMo.cjs +75 -0
- package/package.json +21 -5
- package/dist/exporter-Dt4kx128.d.cts +0 -207
- package/dist/exporter-Due9Rd4s.d.ts +0 -207
- package/dist/http-CNZMrnzv.js +0 -1453
- package/dist/http-CXSzX4ee.cjs +0 -1607
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const require_http = require('./http-1afd_01N.cjs');
|
|
2
|
+
let _grpc_grpc_js = require("@grpc/grpc-js");
|
|
3
|
+
|
|
4
|
+
//#region src/server/grpc.ts
|
|
5
|
+
const decodeTrace = (bytes) => require_http.decodeOtlpTraceRequest(bytes);
|
|
6
|
+
const decodeLogs = (bytes) => require_http.decodeOtlpLogsRequest(bytes);
|
|
7
|
+
const decodeMetrics = (bytes) => require_http.decodeOtlpMetricsRequest(bytes);
|
|
8
|
+
const DEFINITIONS = [
|
|
9
|
+
[
|
|
10
|
+
"traces",
|
|
11
|
+
"trace",
|
|
12
|
+
decodeTrace
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"logs",
|
|
16
|
+
"logs",
|
|
17
|
+
decodeLogs
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"metrics",
|
|
21
|
+
"metrics",
|
|
22
|
+
decodeMetrics
|
|
23
|
+
]
|
|
24
|
+
];
|
|
25
|
+
function servicePath(namespace) {
|
|
26
|
+
return `/opentelemetry.proto.collector.${namespace}.v1.${namespace === "trace" ? "Trace" : namespace[0].toUpperCase() + namespace.slice(1)}Service/Export`;
|
|
27
|
+
}
|
|
28
|
+
async function startOtlpGrpcReceiver(options) {
|
|
29
|
+
const host = options.host ?? "127.0.0.1";
|
|
30
|
+
const requestedPort = options.port ?? 4317;
|
|
31
|
+
const server = new _grpc_grpc_js.Server();
|
|
32
|
+
for (const [signal, namespace, decode] of DEFINITIONS) {
|
|
33
|
+
const path = servicePath(namespace);
|
|
34
|
+
const handler = (call, callback) => {
|
|
35
|
+
try {
|
|
36
|
+
options.devtools.ingestOtlp(signal, call.request);
|
|
37
|
+
callback(null, {});
|
|
38
|
+
} catch (error) {
|
|
39
|
+
callback({
|
|
40
|
+
code: _grpc_grpc_js.status.INVALID_ARGUMENT,
|
|
41
|
+
message: error instanceof Error ? error.message : String(error)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
server.addService({ Export: {
|
|
46
|
+
path,
|
|
47
|
+
requestStream: false,
|
|
48
|
+
responseStream: false,
|
|
49
|
+
requestSerialize: (value) => value,
|
|
50
|
+
requestDeserialize: decode,
|
|
51
|
+
responseSerialize: () => Buffer.alloc(0),
|
|
52
|
+
responseDeserialize: () => ({}),
|
|
53
|
+
originalName: "Export"
|
|
54
|
+
} }, { Export: handler });
|
|
55
|
+
}
|
|
56
|
+
const attempts = Math.max(1, options.maxPortAttempts ?? 20);
|
|
57
|
+
let lastError;
|
|
58
|
+
for (let offset = 0; offset < attempts; offset++) {
|
|
59
|
+
const port = requestedPort === 0 ? 0 : requestedPort + offset;
|
|
60
|
+
try {
|
|
61
|
+
const boundPort = await new Promise((resolve, reject) => {
|
|
62
|
+
server.bindAsync(`${host}:${port}`, _grpc_grpc_js.ServerCredentials.createInsecure(), (error, actualPort) => error ? reject(error) : resolve(actualPort));
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
port: boundPort,
|
|
66
|
+
address: `${host}:${boundPort}`,
|
|
67
|
+
close: () => new Promise((resolve) => server.tryShutdown(() => resolve()))
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
lastError = error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw lastError;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
Object.defineProperty(exports, 'startOtlpGrpcReceiver', {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return startOtlpGrpcReceiver;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { c as decodeOtlpTraceRequest, o as decodeOtlpLogsRequest, s as decodeOtlpMetricsRequest } from "./http-gk1xapnA.js";
|
|
2
|
+
import { Server, ServerCredentials, status } from "@grpc/grpc-js";
|
|
3
|
+
|
|
4
|
+
//#region src/server/grpc.ts
|
|
5
|
+
const decodeTrace = (bytes) => decodeOtlpTraceRequest(bytes);
|
|
6
|
+
const decodeLogs = (bytes) => decodeOtlpLogsRequest(bytes);
|
|
7
|
+
const decodeMetrics = (bytes) => decodeOtlpMetricsRequest(bytes);
|
|
8
|
+
const DEFINITIONS = [
|
|
9
|
+
[
|
|
10
|
+
"traces",
|
|
11
|
+
"trace",
|
|
12
|
+
decodeTrace
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"logs",
|
|
16
|
+
"logs",
|
|
17
|
+
decodeLogs
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"metrics",
|
|
21
|
+
"metrics",
|
|
22
|
+
decodeMetrics
|
|
23
|
+
]
|
|
24
|
+
];
|
|
25
|
+
function servicePath(namespace) {
|
|
26
|
+
return `/opentelemetry.proto.collector.${namespace}.v1.${namespace === "trace" ? "Trace" : namespace[0].toUpperCase() + namespace.slice(1)}Service/Export`;
|
|
27
|
+
}
|
|
28
|
+
async function startOtlpGrpcReceiver(options) {
|
|
29
|
+
const host = options.host ?? "127.0.0.1";
|
|
30
|
+
const requestedPort = options.port ?? 4317;
|
|
31
|
+
const server = new Server();
|
|
32
|
+
for (const [signal, namespace, decode] of DEFINITIONS) {
|
|
33
|
+
const path = servicePath(namespace);
|
|
34
|
+
const handler = (call, callback) => {
|
|
35
|
+
try {
|
|
36
|
+
options.devtools.ingestOtlp(signal, call.request);
|
|
37
|
+
callback(null, {});
|
|
38
|
+
} catch (error) {
|
|
39
|
+
callback({
|
|
40
|
+
code: status.INVALID_ARGUMENT,
|
|
41
|
+
message: error instanceof Error ? error.message : String(error)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
server.addService({ Export: {
|
|
46
|
+
path,
|
|
47
|
+
requestStream: false,
|
|
48
|
+
responseStream: false,
|
|
49
|
+
requestSerialize: (value) => value,
|
|
50
|
+
requestDeserialize: decode,
|
|
51
|
+
responseSerialize: () => Buffer.alloc(0),
|
|
52
|
+
responseDeserialize: () => ({}),
|
|
53
|
+
originalName: "Export"
|
|
54
|
+
} }, { Export: handler });
|
|
55
|
+
}
|
|
56
|
+
const attempts = Math.max(1, options.maxPortAttempts ?? 20);
|
|
57
|
+
let lastError;
|
|
58
|
+
for (let offset = 0; offset < attempts; offset++) {
|
|
59
|
+
const port = requestedPort === 0 ? 0 : requestedPort + offset;
|
|
60
|
+
try {
|
|
61
|
+
const boundPort = await new Promise((resolve, reject) => {
|
|
62
|
+
server.bindAsync(`${host}:${port}`, ServerCredentials.createInsecure(), (error, actualPort) => error ? reject(error) : resolve(actualPort));
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
port: boundPort,
|
|
66
|
+
address: `${host}:${boundPort}`,
|
|
67
|
+
close: () => new Promise((resolve) => server.tryShutdown(() => resolve()))
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
lastError = error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw lastError;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { startOtlpGrpcReceiver as t };
|