autotel-devtools 22.0.0 → 23.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.
Files changed (46) hide show
  1. package/README.md +183 -28
  2. package/dist/cli.cjs +80 -13
  3. package/dist/cli.js +80 -13
  4. package/dist/compile-JDFHUCo5.d.cts +177 -0
  5. package/dist/compile-JDFHUCo5.d.ts +177 -0
  6. package/dist/{error-aggregator-D8VKciLY.d.ts → error-aggregator-B52JI8jL.d.ts} +1 -1
  7. package/dist/{error-aggregator-DCEKMOm3.d.cts → error-aggregator-DSwUvgFF.d.cts} +1 -1
  8. package/dist/exporter-BrEcnzoT.d.ts +546 -0
  9. package/dist/exporter-C4uKgo7l.d.cts +546 -0
  10. package/dist/fullpage.global.js +39 -0
  11. package/dist/grpc-CSWjMRiB.cjs +82 -0
  12. package/dist/grpc-CZEDUYCM.js +77 -0
  13. package/dist/http-Cqm_MAtc.cjs +3942 -0
  14. package/dist/http-Dbd9TIYU.js +3776 -0
  15. package/dist/index.cjs +25 -7
  16. package/dist/index.d.cts +30 -3
  17. package/dist/index.d.ts +30 -3
  18. package/dist/index.js +25 -7
  19. package/dist/{listen-DBfsfcdd.js → listen-D-lLgfro.js} +5 -2
  20. package/dist/{listen-CEJ3nYJf.cjs → listen-l09RRHht.cjs} +5 -2
  21. package/dist/parse-BRlosZft.cjs +642 -0
  22. package/dist/parse-D_RmPPQs.js +612 -0
  23. package/dist/query/index.cjs +8 -0
  24. package/dist/query/index.d.cts +16 -0
  25. package/dist/query/index.d.ts +16 -0
  26. package/dist/query/index.js +3 -0
  27. package/dist/server/exporter.d.cts +1 -1
  28. package/dist/server/exporter.d.ts +1 -1
  29. package/dist/server/index.cjs +6 -2
  30. package/dist/server/index.d.cts +19 -6
  31. package/dist/server/index.d.ts +18 -5
  32. package/dist/server/index.js +3 -2
  33. package/dist/types-B0tjwFqj.d.cts +107 -0
  34. package/dist/types-DM8y4A9Z.d.ts +107 -0
  35. package/dist/widget.global.js +15 -24
  36. package/dist/wire/index.cjs +7 -0
  37. package/dist/wire/index.d.cts +26 -0
  38. package/dist/wire/index.d.ts +26 -0
  39. package/dist/wire/index.js +3 -0
  40. package/dist/wire-2Rmfg6IT.js +51 -0
  41. package/dist/wire-CHU1PkMo.cjs +75 -0
  42. package/package.json +21 -5
  43. package/dist/exporter-Dt4kx128.d.cts +0 -207
  44. package/dist/exporter-Due9Rd4s.d.ts +0 -207
  45. package/dist/http-CNZMrnzv.js +0 -1453
  46. package/dist/http-CXSzX4ee.cjs +0 -1607
@@ -0,0 +1,82 @@
1
+ const require_http = require('./http-Cqm_MAtc.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-Dbd9TIYU.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 };