@watchtowerobservability/node 0.0.0-stage → 0.3.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/LICENSE +202 -0
- package/README.md +304 -2
- package/dist/cjs/appsec.d.ts +95 -0
- package/dist/cjs/appsec.js +206 -0
- package/dist/cjs/buffer.d.ts +49 -0
- package/dist/cjs/buffer.js +134 -0
- package/dist/cjs/errors.d.ts +17 -0
- package/dist/cjs/errors.js +55 -0
- package/dist/cjs/index.d.ts +123 -0
- package/dist/cjs/index.js +315 -0
- package/dist/cjs/integrations/amqp.d.ts +13 -0
- package/dist/cjs/integrations/amqp.js +96 -0
- package/dist/cjs/integrations/azure-functions.d.ts +18 -0
- package/dist/cjs/integrations/azure-functions.js +97 -0
- package/dist/cjs/integrations/bullmq.d.ts +19 -0
- package/dist/cjs/integrations/bullmq.js +83 -0
- package/dist/cjs/integrations/cache.d.ts +13 -0
- package/dist/cjs/integrations/cache.js +51 -0
- package/dist/cjs/integrations/db.d.ts +62 -0
- package/dist/cjs/integrations/db.js +288 -0
- package/dist/cjs/integrations/duckdb.d.ts +22 -0
- package/dist/cjs/integrations/duckdb.js +66 -0
- package/dist/cjs/integrations/express.d.ts +25 -0
- package/dist/cjs/integrations/express.js +58 -0
- package/dist/cjs/integrations/fastify.d.ts +6 -0
- package/dist/cjs/integrations/fastify.js +44 -0
- package/dist/cjs/integrations/genai-agents.d.ts +36 -0
- package/dist/cjs/integrations/genai-agents.js +124 -0
- package/dist/cjs/integrations/genai-stream.d.ts +19 -0
- package/dist/cjs/integrations/genai-stream.js +135 -0
- package/dist/cjs/integrations/genai.d.ts +18 -0
- package/dist/cjs/integrations/genai.js +150 -0
- package/dist/cjs/integrations/graphile-worker.d.ts +22 -0
- package/dist/cjs/integrations/graphile-worker.js +50 -0
- package/dist/cjs/integrations/koa.d.ts +19 -0
- package/dist/cjs/integrations/koa.js +34 -0
- package/dist/cjs/integrations/lambda.d.ts +11 -0
- package/dist/cjs/integrations/lambda.js +68 -0
- package/dist/cjs/integrations/level.d.ts +18 -0
- package/dist/cjs/integrations/level.js +71 -0
- package/dist/cjs/integrations/lmdb.d.ts +26 -0
- package/dist/cjs/integrations/lmdb.js +78 -0
- package/dist/cjs/integrations/logs.d.ts +10 -0
- package/dist/cjs/integrations/logs.js +77 -0
- package/dist/cjs/integrations/messaging.d.ts +17 -0
- package/dist/cjs/integrations/messaging.js +73 -0
- package/dist/cjs/integrations/mqtt.d.ts +7 -0
- package/dist/cjs/integrations/mqtt.js +41 -0
- package/dist/cjs/integrations/nats.d.ts +17 -0
- package/dist/cjs/integrations/nats.js +73 -0
- package/dist/cjs/integrations/nestjs.d.ts +16 -0
- package/dist/cjs/integrations/nestjs.js +30 -0
- package/dist/cjs/integrations/next.d.ts +11 -0
- package/dist/cjs/integrations/next.js +59 -0
- package/dist/cjs/integrations/orm.d.ts +47 -0
- package/dist/cjs/integrations/orm.js +93 -0
- package/dist/cjs/integrations/pg-boss.d.ts +8 -0
- package/dist/cjs/integrations/pg-boss.js +63 -0
- package/dist/cjs/integrations/pools.d.ts +41 -0
- package/dist/cjs/integrations/pools.js +94 -0
- package/dist/cjs/integrations/postgres.d.ts +12 -0
- package/dist/cjs/integrations/postgres.js +92 -0
- package/dist/cjs/integrations/prisma.d.ts +3 -0
- package/dist/cjs/integrations/prisma.js +33 -0
- package/dist/cjs/integrations/sqlite.d.ts +36 -0
- package/dist/cjs/integrations/sqlite.js +125 -0
- package/dist/cjs/integrations/util.d.ts +9 -0
- package/dist/cjs/integrations/util.js +37 -0
- package/dist/cjs/jest.d.ts +21 -0
- package/dist/cjs/jest.js +45 -0
- package/dist/cjs/load.d.ts +1 -0
- package/dist/cjs/load.js +11 -0
- package/dist/cjs/metrics.d.ts +10 -0
- package/dist/cjs/metrics.js +81 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/payload.d.ts +42 -0
- package/dist/cjs/payload.js +145 -0
- package/dist/cjs/pprof.d.ts +6 -0
- package/dist/cjs/pprof.js +88 -0
- package/dist/cjs/probes.d.ts +97 -0
- package/dist/cjs/probes.js +422 -0
- package/dist/cjs/profiling.d.ts +84 -0
- package/dist/cjs/profiling.js +263 -0
- package/dist/cjs/reporter-core.d.ts +32 -0
- package/dist/cjs/reporter-core.js +102 -0
- package/dist/cjs/sql.d.ts +19 -0
- package/dist/cjs/sql.js +332 -0
- package/dist/cjs/test-plan.d.ts +102 -0
- package/dist/cjs/test-plan.js +352 -0
- package/dist/cjs/vitest.d.ts +27 -0
- package/dist/cjs/vitest.js +52 -0
- package/dist/esm/appsec.d.ts +95 -0
- package/dist/esm/appsec.js +193 -0
- package/dist/esm/buffer.d.ts +49 -0
- package/dist/esm/buffer.js +92 -0
- package/dist/esm/errors.d.ts +17 -0
- package/dist/esm/errors.js +50 -0
- package/dist/esm/index.d.ts +123 -0
- package/dist/esm/index.js +264 -0
- package/dist/esm/integrations/amqp.d.ts +13 -0
- package/dist/esm/integrations/amqp.js +92 -0
- package/dist/esm/integrations/azure-functions.d.ts +18 -0
- package/dist/esm/integrations/azure-functions.js +60 -0
- package/dist/esm/integrations/bullmq.d.ts +19 -0
- package/dist/esm/integrations/bullmq.js +79 -0
- package/dist/esm/integrations/cache.d.ts +13 -0
- package/dist/esm/integrations/cache.js +46 -0
- package/dist/esm/integrations/db.d.ts +62 -0
- package/dist/esm/integrations/db.js +239 -0
- package/dist/esm/integrations/duckdb.d.ts +22 -0
- package/dist/esm/integrations/duckdb.js +29 -0
- package/dist/esm/integrations/express.d.ts +25 -0
- package/dist/esm/integrations/express.js +54 -0
- package/dist/esm/integrations/fastify.d.ts +6 -0
- package/dist/esm/integrations/fastify.js +41 -0
- package/dist/esm/integrations/genai-agents.d.ts +36 -0
- package/dist/esm/integrations/genai-agents.js +118 -0
- package/dist/esm/integrations/genai-stream.d.ts +19 -0
- package/dist/esm/integrations/genai-stream.js +130 -0
- package/dist/esm/integrations/genai.d.ts +18 -0
- package/dist/esm/integrations/genai.js +138 -0
- package/dist/esm/integrations/graphile-worker.d.ts +22 -0
- package/dist/esm/integrations/graphile-worker.js +46 -0
- package/dist/esm/integrations/koa.d.ts +19 -0
- package/dist/esm/integrations/koa.js +31 -0
- package/dist/esm/integrations/lambda.d.ts +11 -0
- package/dist/esm/integrations/lambda.js +32 -0
- package/dist/esm/integrations/level.d.ts +18 -0
- package/dist/esm/integrations/level.js +35 -0
- package/dist/esm/integrations/lmdb.d.ts +26 -0
- package/dist/esm/integrations/lmdb.js +42 -0
- package/dist/esm/integrations/logs.d.ts +10 -0
- package/dist/esm/integrations/logs.js +40 -0
- package/dist/esm/integrations/messaging.d.ts +17 -0
- package/dist/esm/integrations/messaging.js +64 -0
- package/dist/esm/integrations/mqtt.d.ts +7 -0
- package/dist/esm/integrations/mqtt.js +38 -0
- package/dist/esm/integrations/nats.d.ts +17 -0
- package/dist/esm/integrations/nats.js +70 -0
- package/dist/esm/integrations/nestjs.d.ts +16 -0
- package/dist/esm/integrations/nestjs.js +26 -0
- package/dist/esm/integrations/next.d.ts +11 -0
- package/dist/esm/integrations/next.js +22 -0
- package/dist/esm/integrations/orm.d.ts +47 -0
- package/dist/esm/integrations/orm.js +86 -0
- package/dist/esm/integrations/pg-boss.d.ts +8 -0
- package/dist/esm/integrations/pg-boss.js +60 -0
- package/dist/esm/integrations/pools.d.ts +41 -0
- package/dist/esm/integrations/pools.js +89 -0
- package/dist/esm/integrations/postgres.d.ts +12 -0
- package/dist/esm/integrations/postgres.js +55 -0
- package/dist/esm/integrations/prisma.d.ts +3 -0
- package/dist/esm/integrations/prisma.js +30 -0
- package/dist/esm/integrations/sqlite.d.ts +36 -0
- package/dist/esm/integrations/sqlite.js +84 -0
- package/dist/esm/integrations/util.d.ts +9 -0
- package/dist/esm/integrations/util.js +32 -0
- package/dist/esm/jest.d.ts +21 -0
- package/dist/esm/jest.js +41 -0
- package/dist/esm/load.d.ts +1 -0
- package/dist/esm/load.js +5 -0
- package/dist/esm/metrics.d.ts +10 -0
- package/dist/esm/metrics.js +44 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/payload.d.ts +42 -0
- package/dist/esm/payload.js +131 -0
- package/dist/esm/pprof.d.ts +6 -0
- package/dist/esm/pprof.js +85 -0
- package/dist/esm/probes.d.ts +97 -0
- package/dist/esm/probes.js +412 -0
- package/dist/esm/profiling.d.ts +84 -0
- package/dist/esm/profiling.js +251 -0
- package/dist/esm/reporter-core.d.ts +32 -0
- package/dist/esm/reporter-core.js +63 -0
- package/dist/esm/sql.d.ts +19 -0
- package/dist/esm/sql.js +324 -0
- package/dist/esm/test-plan.d.ts +102 -0
- package/dist/esm/test-plan.js +336 -0
- package/dist/esm/vitest.d.ts +27 -0
- package/dist/esm/vitest.js +48 -0
- package/package.json +379 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context, Span } from '@opentelemetry/api';
|
|
2
|
+
export interface ServerSpan {
|
|
3
|
+
span: Span;
|
|
4
|
+
ctx: Context;
|
|
5
|
+
finish(status?: number, route?: string): void;
|
|
6
|
+
}
|
|
7
|
+
/** Start a server span; finish(status, route) names it `METHOD route` and ends it once. */
|
|
8
|
+
export declare function serverSpan(method: string, path?: string): ServerSpan;
|
|
9
|
+
export declare const statusOf: (e: unknown) => number;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusOf = void 0;
|
|
4
|
+
exports.serverSpan = serverSpan;
|
|
5
|
+
const api_1 = require("@opentelemetry/api");
|
|
6
|
+
/** Start a server span; finish(status, route) names it `METHOD route` and ends it once. */
|
|
7
|
+
function serverSpan(method, path) {
|
|
8
|
+
// url.path only: query strings can carry secrets
|
|
9
|
+
const span = api_1.trace.getTracer('watchtower').startSpan(method, {
|
|
10
|
+
kind: api_1.SpanKind.SERVER,
|
|
11
|
+
attributes: { 'http.request.method': method, 'url.path': String(path || '').split('?')[0] },
|
|
12
|
+
});
|
|
13
|
+
let done = false;
|
|
14
|
+
return {
|
|
15
|
+
span,
|
|
16
|
+
ctx: api_1.trace.setSpan(api_1.context.active(), span),
|
|
17
|
+
finish(status, route) {
|
|
18
|
+
if (done)
|
|
19
|
+
return;
|
|
20
|
+
done = true;
|
|
21
|
+
if (route) {
|
|
22
|
+
span.updateName(`${method} ${route}`);
|
|
23
|
+
span.setAttribute('http.route', route);
|
|
24
|
+
}
|
|
25
|
+
if (status)
|
|
26
|
+
span.setAttribute('http.response.status_code', status);
|
|
27
|
+
if (status !== undefined && status >= 500)
|
|
28
|
+
span.setStatus({ code: api_1.SpanStatusCode.ERROR });
|
|
29
|
+
span.end();
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const statusOf = (e) => {
|
|
34
|
+
const x = e;
|
|
35
|
+
return (x && (x.status || x.statusCode)) || 500;
|
|
36
|
+
};
|
|
37
|
+
exports.statusOf = statusOf;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReporterOptions } from './reporter-core.js';
|
|
2
|
+
/** The slice of Jest's `TestResult` this reporter reads. */
|
|
3
|
+
export interface JestTestResult {
|
|
4
|
+
testFilePath?: string;
|
|
5
|
+
testResults?: {
|
|
6
|
+
fullName?: string;
|
|
7
|
+
ancestorTitles?: string[];
|
|
8
|
+
title: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
duration?: number | null;
|
|
11
|
+
failureMessages?: string[];
|
|
12
|
+
invocations?: number;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export default class WatchtowerJestReporter {
|
|
16
|
+
private readonly client;
|
|
17
|
+
private readonly tests;
|
|
18
|
+
constructor(_globalConfig?: unknown, options?: ReporterOptions);
|
|
19
|
+
onTestResult(_test: unknown, result: JestTestResult): void;
|
|
20
|
+
onRunComplete(): Promise<void>;
|
|
21
|
+
}
|
package/dist/cjs/jest.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Jest reporter: `reporters: ['default', ['@watchtowerobservability/node/jest', { /* apiKey, client, ... */ }]]`.
|
|
4
|
+
// With the test-plan environment (test-plan.ts) a quarantined failure arrives as a pending test that
|
|
5
|
+
// still carries its failure message; it is reported as a quarantined failure. Uploads JUnit when
|
|
6
|
+
// WT_CI_RUN_ID is set.
|
|
7
|
+
const reporter_core_js_1 = require("./reporter-core.js");
|
|
8
|
+
const test_plan_js_1 = require("./test-plan.js");
|
|
9
|
+
class WatchtowerJestReporter {
|
|
10
|
+
client;
|
|
11
|
+
tests = [];
|
|
12
|
+
constructor(_globalConfig, options) {
|
|
13
|
+
this.client = (0, reporter_core_js_1.clientFor)(options);
|
|
14
|
+
}
|
|
15
|
+
onTestResult(_test, result) {
|
|
16
|
+
const end = Date.now();
|
|
17
|
+
const decide = (0, test_plan_js_1.decider)((0, test_plan_js_1.loadPlan)());
|
|
18
|
+
for (const t of result.testResults || []) {
|
|
19
|
+
const names = (t.ancestorTitles || []).concat(t.title);
|
|
20
|
+
const id = (0, test_plan_js_1.testId)((0, test_plan_js_1.suiteName)('jest'), result.testFilePath, names);
|
|
21
|
+
const d = decide(id);
|
|
22
|
+
const failures = t.failureMessages || [];
|
|
23
|
+
const qFail = d.quarantined !== undefined && t.status === 'pending' && failures.length > 0;
|
|
24
|
+
this.tests.push({
|
|
25
|
+
name: t.fullName || names.join(' '),
|
|
26
|
+
id,
|
|
27
|
+
outcome: qFail ? 'failed' : (0, reporter_core_js_1.outcome)(t.status),
|
|
28
|
+
durationMs: t.duration || 0,
|
|
29
|
+
message: failures[0],
|
|
30
|
+
endMs: end,
|
|
31
|
+
quarantined: qFail ? d.quarantined : undefined,
|
|
32
|
+
isNew: d.isNew,
|
|
33
|
+
attempts: Math.max(0, (t.invocations || 1) - 1),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async onRunComplete() {
|
|
38
|
+
await (0, reporter_core_js_1.reportTests)(this.client, this.tests, 'jest');
|
|
39
|
+
await (0, test_plan_js_1.uploadResults)(this.client, (0, test_plan_js_1.suiteName)('jest'), this.tests);
|
|
40
|
+
if (this.client)
|
|
41
|
+
await this.client.shutdown().catch(() => { });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = WatchtowerJestReporter;
|
|
45
|
+
module.exports = Object.assign(exports.default, { default: exports.default });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function load(id: string): unknown;
|
package/dist/cjs/load.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.load = load;
|
|
4
|
+
// Optional-peer loader (winston-transport). This is the CommonJS form; scripts/build.mjs swaps in an ESM twin
|
|
5
|
+
// (createRequire(import.meta.url)) for dist/esm. The cwd fallback only matters when neither exists (test runners).
|
|
6
|
+
const node_module_1 = require("node:module");
|
|
7
|
+
function load(id) {
|
|
8
|
+
if (typeof require === 'function')
|
|
9
|
+
return require(id);
|
|
10
|
+
return (0, node_module_1.createRequire)(`${process.cwd()}/`)(id);
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Resource } from '@opentelemetry/resources';
|
|
2
|
+
import { MeterProvider } from '@opentelemetry/sdk-metrics';
|
|
3
|
+
import type { PushMetricExporter } from '@opentelemetry/sdk-metrics';
|
|
4
|
+
/** Explicit flag, else `WATCHTOWER_LOGS` / `WATCHTOWER_METRICS` (default on); `OTEL_*_EXPORTER=none` turns it off. */
|
|
5
|
+
export declare function switchOn(name: string, otelExporterEnv: string, flag?: boolean): boolean;
|
|
6
|
+
export interface Metrics {
|
|
7
|
+
provider: MeterProvider;
|
|
8
|
+
stop(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function startMetrics(endpoint: string, headers: Record<string, string>, resource: Resource, bufferDir: string | undefined, fetch: typeof globalThis.fetch, exporter?: PushMetricExporter): Metrics;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.switchOn = switchOn;
|
|
37
|
+
exports.startMetrics = startMetrics;
|
|
38
|
+
// Metrics: the OTel metrics SDK with a periodic OTLP/HTTP reader. Counters and histograms use
|
|
39
|
+
// delta temporality unless OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set. Node runtime
|
|
40
|
+
// metrics (event loop delay and utilization, GC, heap) come from the optional peer
|
|
41
|
+
// @opentelemetry/instrumentation-runtime-node when it is installed.
|
|
42
|
+
const nodePath = __importStar(require("node:path"));
|
|
43
|
+
const sdk_metrics_1 = require("@opentelemetry/sdk-metrics");
|
|
44
|
+
const exporter_metrics_otlp_http_1 = require("@opentelemetry/exporter-metrics-otlp-http");
|
|
45
|
+
const buffer_js_1 = require("./buffer.js");
|
|
46
|
+
const load_js_1 = require("./load.js");
|
|
47
|
+
/** Explicit flag, else `WATCHTOWER_LOGS` / `WATCHTOWER_METRICS` (default on); `OTEL_*_EXPORTER=none` turns it off. */
|
|
48
|
+
function switchOn(name, otelExporterEnv, flag) {
|
|
49
|
+
if (flag !== undefined)
|
|
50
|
+
return flag;
|
|
51
|
+
const env = process.env;
|
|
52
|
+
if ((env[otelExporterEnv] || '').trim().toLowerCase() === 'none')
|
|
53
|
+
return false;
|
|
54
|
+
return !['off', 'false', '0', 'no'].includes((env[name] || 'on').trim().toLowerCase());
|
|
55
|
+
}
|
|
56
|
+
function startMetrics(endpoint, headers, resource, bufferDir, fetch, exporter) {
|
|
57
|
+
const url = `${endpoint}/v1/metrics`;
|
|
58
|
+
let exp = exporter;
|
|
59
|
+
if (!exp) {
|
|
60
|
+
const delta = process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
|
|
61
|
+
? {} : { temporalityPreference: exporter_metrics_otlp_http_1.AggregationTemporalityPreference.DELTA };
|
|
62
|
+
exp = new exporter_metrics_otlp_http_1.OTLPMetricExporter({ url, headers, ...delta });
|
|
63
|
+
if (bufferDir)
|
|
64
|
+
exp = new buffer_js_1.MetricSpool(exp, nodePath.join(bufferDir, 'metrics'), url, headers, fetch);
|
|
65
|
+
}
|
|
66
|
+
const interval = Number(process.env.OTEL_METRIC_EXPORT_INTERVAL) || 60000;
|
|
67
|
+
const reader = new sdk_metrics_1.PeriodicExportingMetricReader({
|
|
68
|
+
exporter: exp, exportIntervalMillis: interval, exportTimeoutMillis: Math.min(30000, interval),
|
|
69
|
+
});
|
|
70
|
+
const provider = new sdk_metrics_1.MeterProvider({ resource, readers: [reader] });
|
|
71
|
+
let runtime;
|
|
72
|
+
try {
|
|
73
|
+
const mod = (0, load_js_1.load)('@opentelemetry/instrumentation-runtime-node');
|
|
74
|
+
runtime = new mod.RuntimeNodeInstrumentation();
|
|
75
|
+
runtime.setMeterProvider(provider);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// optional peer not installed
|
|
79
|
+
}
|
|
80
|
+
return { provider, stop: () => runtime?.disable() };
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
export interface CaptureRule {
|
|
3
|
+
route?: string | null;
|
|
4
|
+
request_headers?: string[];
|
|
5
|
+
response_headers?: string[];
|
|
6
|
+
body_bytes?: number;
|
|
7
|
+
graphql_query?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const HARD_MAX = 8192;
|
|
10
|
+
export declare const setCaptureRules: (r: CaptureRule[]) => void;
|
|
11
|
+
export declare const captureActive: () => boolean;
|
|
12
|
+
/** Fetch the service's rules; any failure leaves capture off. */
|
|
13
|
+
export declare function loadCaptureRules(o: {
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
key: string;
|
|
16
|
+
service: string;
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
}): Promise<CaptureRule[]>;
|
|
19
|
+
/** `*` matches any run of characters (the edge's glob). */
|
|
20
|
+
export declare function glob(pat: string, s: string): boolean;
|
|
21
|
+
export declare const ruleFor: (route: string) => CaptureRule | undefined;
|
|
22
|
+
/** Default secret and PII detectors: secret-named JSON and form fields, keys, tokens, emails, SSNs, Luhn-valid cards. */
|
|
23
|
+
export declare function redactText(s: string): string;
|
|
24
|
+
export declare const textLike: (type?: string) => boolean;
|
|
25
|
+
/** First `n` UTF-8 bytes without splitting a character. */
|
|
26
|
+
export declare function capBytes(s: string, n: number): string;
|
|
27
|
+
/** Redact a wider window than kept so a secret cut at the edge is still masked, then cap. */
|
|
28
|
+
export declare const excerpt: (s: string, n: number) => string;
|
|
29
|
+
/** Operation type and name of a GraphQL document (`{ ... }` is an anonymous query). */
|
|
30
|
+
export declare function graphqlOp(doc: string): {
|
|
31
|
+
type: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
export interface Payload {
|
|
35
|
+
route: string;
|
|
36
|
+
reqType?: string;
|
|
37
|
+
reqBody?: unknown;
|
|
38
|
+
resType?: string;
|
|
39
|
+
resBody?: unknown;
|
|
40
|
+
}
|
|
41
|
+
/** Record the bodies and GraphQL operation on `span` per the rule matching the route; no rule, nothing recorded. */
|
|
42
|
+
export declare function capturePayload(span: Span, p: Payload): void;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.excerpt = exports.textLike = exports.ruleFor = exports.captureActive = exports.setCaptureRules = exports.HARD_MAX = void 0;
|
|
4
|
+
exports.loadCaptureRules = loadCaptureRules;
|
|
5
|
+
exports.glob = glob;
|
|
6
|
+
exports.redactText = redactText;
|
|
7
|
+
exports.capBytes = capBytes;
|
|
8
|
+
exports.graphqlOp = graphqlOp;
|
|
9
|
+
exports.capturePayload = capturePayload;
|
|
10
|
+
exports.HARD_MAX = 8192;
|
|
11
|
+
const R = '[REDACTED]';
|
|
12
|
+
let rules = [];
|
|
13
|
+
const setCaptureRules = (r) => { rules = Array.isArray(r) ? r : []; };
|
|
14
|
+
exports.setCaptureRules = setCaptureRules;
|
|
15
|
+
const captureActive = () => rules.length > 0;
|
|
16
|
+
exports.captureActive = captureActive;
|
|
17
|
+
/** Fetch the service's rules; any failure leaves capture off. */
|
|
18
|
+
async function loadCaptureRules(o) {
|
|
19
|
+
try {
|
|
20
|
+
const f = o.fetch || globalThis.fetch;
|
|
21
|
+
const res = await f(`${o.apiUrl}/v1/capture-rules?service=${encodeURIComponent(o.service)}`, {
|
|
22
|
+
headers: { Authorization: `Bearer ${o.key}` },
|
|
23
|
+
});
|
|
24
|
+
if (!res.ok)
|
|
25
|
+
return [];
|
|
26
|
+
const body = (await res.json());
|
|
27
|
+
(0, exports.setCaptureRules)(body.rules || []);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
(0, exports.setCaptureRules)([]);
|
|
31
|
+
}
|
|
32
|
+
return rules;
|
|
33
|
+
}
|
|
34
|
+
/** `*` matches any run of characters (the edge's glob). */
|
|
35
|
+
function glob(pat, s) {
|
|
36
|
+
const body = pat.split('*').map((p) => p.replace(/[.+?^$()|{}[\]\\]/g, '\\$&')).join('.*');
|
|
37
|
+
return new RegExp('^' + body + '$', 's').test(s);
|
|
38
|
+
}
|
|
39
|
+
const ruleFor = (route) => rules.find((r) => !r.route || glob(r.route, route));
|
|
40
|
+
exports.ruleFor = ruleFor;
|
|
41
|
+
const luhn = (s) => {
|
|
42
|
+
const d = s.replace(/\D/g, '');
|
|
43
|
+
let sum = 0;
|
|
44
|
+
for (let i = 0; i < d.length; i++) {
|
|
45
|
+
let x = Number(d[d.length - 1 - i]);
|
|
46
|
+
if (i % 2)
|
|
47
|
+
x = x * 2 > 9 ? x * 2 - 9 : x * 2;
|
|
48
|
+
sum += x;
|
|
49
|
+
}
|
|
50
|
+
return d.length >= 13 && sum % 10 === 0;
|
|
51
|
+
};
|
|
52
|
+
const SECRET_KEYS = 'password|passwd|secret|token|access_token|refresh_token|client_secret|api_?key|authorization';
|
|
53
|
+
const PATTERNS = [
|
|
54
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
55
|
+
/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
|
|
56
|
+
/bearer\s+[A-Za-z0-9._~+/-]+=*/gi,
|
|
57
|
+
/wt[ik]_[a-z0-9]{8}_[A-Za-z0-9_-]{43}/g,
|
|
58
|
+
/(?:AKIA|ASIA)[0-9A-Z]{16}/g,
|
|
59
|
+
/gh[pousr]_[A-Za-z0-9]{36,}/g,
|
|
60
|
+
/[rs]k_(?:live|test)_[A-Za-z0-9]{16,}/g,
|
|
61
|
+
/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,
|
|
62
|
+
/\b\d{3}-\d{2}-\d{4}\b/g,
|
|
63
|
+
];
|
|
64
|
+
/** Default secret and PII detectors: secret-named JSON and form fields, keys, tokens, emails, SSNs, Luhn-valid cards. */
|
|
65
|
+
function redactText(s) {
|
|
66
|
+
let out = s
|
|
67
|
+
.replace(new RegExp(`("(?:${SECRET_KEYS})"\\s*:\\s*)"(?:[^"\\\\]|\\\\.)*"`, 'gi'), `$1"${R}"`)
|
|
68
|
+
.replace(new RegExp(`\\b((?:${SECRET_KEYS})=)[^&\\s]*`, 'gi'), `$1${R}`);
|
|
69
|
+
for (const re of PATTERNS)
|
|
70
|
+
out = out.replace(re, R);
|
|
71
|
+
return out.replace(/\b\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{1,7}\b/g, (m) => (luhn(m) ? R : m));
|
|
72
|
+
}
|
|
73
|
+
const textLike = (type) => !type || /json|^text\/|xml|x-www-form-urlencoded|graphql/i.test(type);
|
|
74
|
+
exports.textLike = textLike;
|
|
75
|
+
/** First `n` UTF-8 bytes without splitting a character. */
|
|
76
|
+
function capBytes(s, n) {
|
|
77
|
+
const b = Buffer.from(s, 'utf8');
|
|
78
|
+
if (b.length <= n)
|
|
79
|
+
return s;
|
|
80
|
+
return b.subarray(0, n).toString('utf8').replace(/�$/, '');
|
|
81
|
+
}
|
|
82
|
+
/** Redact a wider window than kept so a secret cut at the edge is still masked, then cap. */
|
|
83
|
+
const excerpt = (s, n) => capBytes(redactText(capBytes(s, n * 2)), n);
|
|
84
|
+
exports.excerpt = excerpt;
|
|
85
|
+
/** Operation type and name of a GraphQL document (`{ ... }` is an anonymous query). */
|
|
86
|
+
function graphqlOp(doc) {
|
|
87
|
+
const d = doc.replace(/#[^\n]*/g, '');
|
|
88
|
+
const m = /(?:^|\})\s*(query|mutation|subscription)\b\s*([_A-Za-z][_0-9A-Za-z]*)?/.exec(d);
|
|
89
|
+
if (m)
|
|
90
|
+
return { type: m[1], ...(m[2] ? { name: m[2] } : {}) };
|
|
91
|
+
return /^\s*\{/.test(d) ? { type: 'query' } : undefined;
|
|
92
|
+
}
|
|
93
|
+
const asText = (b) => {
|
|
94
|
+
if (b === undefined || b === null)
|
|
95
|
+
return undefined;
|
|
96
|
+
if (typeof b === 'string')
|
|
97
|
+
return b;
|
|
98
|
+
if (Buffer.isBuffer(b))
|
|
99
|
+
return b.toString('utf8');
|
|
100
|
+
if (typeof b.pipe === 'function')
|
|
101
|
+
return undefined; // a stream: never buffered
|
|
102
|
+
try {
|
|
103
|
+
return JSON.stringify(b);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
/** Record the bodies and GraphQL operation on `span` per the rule matching the route; no rule, nothing recorded. */
|
|
110
|
+
function capturePayload(span, p) {
|
|
111
|
+
const rule = (0, exports.ruleFor)(p.route);
|
|
112
|
+
if (!rule)
|
|
113
|
+
return;
|
|
114
|
+
const n = Math.min(rule.body_bytes || 0, exports.HARD_MAX);
|
|
115
|
+
const req = (0, exports.textLike)(p.reqType) ? asText(p.reqBody) : undefined;
|
|
116
|
+
const res = (0, exports.textLike)(p.resType) ? asText(p.resBody) : undefined;
|
|
117
|
+
if (n > 0 && req)
|
|
118
|
+
span.setAttribute('http.request.body', (0, exports.excerpt)(req, n));
|
|
119
|
+
if (n > 0 && res)
|
|
120
|
+
span.setAttribute('http.response.body', (0, exports.excerpt)(res, n));
|
|
121
|
+
let doc;
|
|
122
|
+
let opName;
|
|
123
|
+
if (req && /graphql/i.test(p.reqType || ''))
|
|
124
|
+
doc = req;
|
|
125
|
+
else if (req) {
|
|
126
|
+
try {
|
|
127
|
+
const j = (typeof p.reqBody === 'object' ? p.reqBody : JSON.parse(req));
|
|
128
|
+
if (j && typeof j.query === 'string') {
|
|
129
|
+
doc = j.query;
|
|
130
|
+
if (typeof j.operationName === 'string')
|
|
131
|
+
opName = j.operationName;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch { /* not JSON */ }
|
|
135
|
+
}
|
|
136
|
+
const op = doc ? graphqlOp(doc) : undefined;
|
|
137
|
+
if (!op || !doc)
|
|
138
|
+
return;
|
|
139
|
+
span.setAttribute('graphql.operation.type', op.type);
|
|
140
|
+
const name = opName || op.name;
|
|
141
|
+
if (name)
|
|
142
|
+
span.setAttribute('graphql.operation.name', name);
|
|
143
|
+
if (rule.graphql_query)
|
|
144
|
+
span.setAttribute('graphql.document', (0, exports.excerpt)(doc, exports.HARD_MAX));
|
|
145
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folded stacks (`[span_id=…,trace_id=…\t]a;b;c` root first, as `foldProfile` makes them) to a
|
|
3
|
+
* gzipped pprof with sample types samples/count and cpu/nanoseconds. The `k=v` prefix becomes
|
|
4
|
+
* sample labels. Frame names keep their `(file:line)` suffix; one function per distinct frame.
|
|
5
|
+
*/
|
|
6
|
+
export declare function foldedToPprof(counts: Map<string, number>, periodNs: number, startMs: number, durationMs: number): Uint8Array;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.foldedToPprof = foldedToPprof;
|
|
4
|
+
// Minimal pprof (profile.proto) encoder, no dependency: folded stacks in, gzipped protobuf out.
|
|
5
|
+
const node_zlib_1 = require("node:zlib");
|
|
6
|
+
/** Protobuf writer for the handful of field shapes profile.proto needs. */
|
|
7
|
+
class Pb {
|
|
8
|
+
b = [];
|
|
9
|
+
varint(x) {
|
|
10
|
+
let n = BigInt(x);
|
|
11
|
+
while (n > 127n) {
|
|
12
|
+
this.b.push(Number(n & 127n) | 128);
|
|
13
|
+
n >>= 7n;
|
|
14
|
+
}
|
|
15
|
+
this.b.push(Number(n));
|
|
16
|
+
}
|
|
17
|
+
int(field, v) {
|
|
18
|
+
if (v) {
|
|
19
|
+
this.varint(field << 3);
|
|
20
|
+
this.varint(v);
|
|
21
|
+
}
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
bytes(field, data) {
|
|
25
|
+
this.varint((field << 3) | 2);
|
|
26
|
+
this.varint(data.length);
|
|
27
|
+
for (let i = 0; i < data.length; i++)
|
|
28
|
+
this.b.push(data[i]);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
msg(field, m) {
|
|
32
|
+
return this.bytes(field, m.b);
|
|
33
|
+
}
|
|
34
|
+
packed(field, vs) {
|
|
35
|
+
const p = new Pb();
|
|
36
|
+
for (const v of vs)
|
|
37
|
+
p.varint(v);
|
|
38
|
+
return this.bytes(field, p.b);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Folded stacks (`[span_id=…,trace_id=…\t]a;b;c` root first, as `foldProfile` makes them) to a
|
|
43
|
+
* gzipped pprof with sample types samples/count and cpu/nanoseconds. The `k=v` prefix becomes
|
|
44
|
+
* sample labels. Frame names keep their `(file:line)` suffix; one function per distinct frame.
|
|
45
|
+
*/
|
|
46
|
+
function foldedToPprof(counts, periodNs, startMs, durationMs) {
|
|
47
|
+
const strings = [''];
|
|
48
|
+
const index = new Map([['', 0]]);
|
|
49
|
+
const s = (x) => {
|
|
50
|
+
let i = index.get(x);
|
|
51
|
+
if (i === undefined) {
|
|
52
|
+
i = strings.length;
|
|
53
|
+
strings.push(x);
|
|
54
|
+
index.set(x, i);
|
|
55
|
+
}
|
|
56
|
+
return i;
|
|
57
|
+
};
|
|
58
|
+
const vt = (type, unit) => new Pb().int(1, s(type)).int(2, s(unit));
|
|
59
|
+
const frames = new Map();
|
|
60
|
+
const out = new Pb().msg(1, vt('samples', 'count')).msg(1, vt('cpu', 'nanoseconds'));
|
|
61
|
+
for (const [key, n] of counts) {
|
|
62
|
+
const tab = key.indexOf('\t');
|
|
63
|
+
const labels = tab >= 0 ? key.slice(0, tab) : '';
|
|
64
|
+
// pprof location ids are leaf first
|
|
65
|
+
const ids = key.slice(tab + 1).split(';').reverse().map((f) => {
|
|
66
|
+
let id = frames.get(f);
|
|
67
|
+
if (id === undefined)
|
|
68
|
+
frames.set(f, (id = frames.size + 1));
|
|
69
|
+
return id;
|
|
70
|
+
});
|
|
71
|
+
const sample = new Pb().packed(1, ids).packed(2, [n, n * periodNs]);
|
|
72
|
+
for (const kv of labels ? labels.split(',') : []) {
|
|
73
|
+
const eq = kv.indexOf('=');
|
|
74
|
+
if (eq > 0)
|
|
75
|
+
sample.msg(3, new Pb().int(1, s(kv.slice(0, eq))).int(2, s(kv.slice(eq + 1))));
|
|
76
|
+
}
|
|
77
|
+
out.msg(2, sample);
|
|
78
|
+
}
|
|
79
|
+
for (const [f, id] of frames) {
|
|
80
|
+
out.msg(4, new Pb().int(1, id).msg(4, new Pb().int(1, id))); // Location{id, line[{function_id}]}
|
|
81
|
+
out.msg(5, new Pb().int(1, id).int(2, s(f))); // Function{id, name}
|
|
82
|
+
}
|
|
83
|
+
out.int(9, BigInt(Math.round(startMs)) * 1000000n).int(10, BigInt(Math.round(durationMs)) * 1000000n);
|
|
84
|
+
out.msg(11, vt('cpu', 'nanoseconds')).int(12, periodNs);
|
|
85
|
+
for (const str of strings)
|
|
86
|
+
out.bytes(6, Buffer.from(str));
|
|
87
|
+
return new Uint8Array((0, node_zlib_1.gzipSync)(Uint8Array.from(out.b)));
|
|
88
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type Vars = Record<string, unknown>;
|
|
2
|
+
export interface ProbeDef {
|
|
3
|
+
id: string;
|
|
4
|
+
kind?: string;
|
|
5
|
+
location: {
|
|
6
|
+
file?: string;
|
|
7
|
+
line?: number;
|
|
8
|
+
function?: string;
|
|
9
|
+
};
|
|
10
|
+
condition?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
capture?: {
|
|
13
|
+
locals_depth?: number;
|
|
14
|
+
max_bytes?: number;
|
|
15
|
+
tags?: {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
max_rate_per_min?: number;
|
|
21
|
+
expires_at?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ProbesOptions {
|
|
24
|
+
/** API base; default `WT_API_URL` or https://api.watchtower.dev */
|
|
25
|
+
endpoint?: string;
|
|
26
|
+
/** ingestion key with scope `probes:read`; default `WT_INGEST_KEY` */
|
|
27
|
+
key?: string;
|
|
28
|
+
service?: string;
|
|
29
|
+
env?: string;
|
|
30
|
+
version?: string;
|
|
31
|
+
intervalMs?: number;
|
|
32
|
+
/** where snapshots go; default: a log record on `logger` when given */
|
|
33
|
+
emit?: (name: string, attrs: Record<string, string>) => void;
|
|
34
|
+
logger?: {
|
|
35
|
+
emit(rec: {
|
|
36
|
+
body: string;
|
|
37
|
+
attributes: Record<string, string>;
|
|
38
|
+
}): void;
|
|
39
|
+
};
|
|
40
|
+
now?: () => number;
|
|
41
|
+
fetch?: typeof fetch;
|
|
42
|
+
}
|
|
43
|
+
/** Compile a condition; throws on anything outside the subset (calls included). Self-contained: the worker embeds its source. */
|
|
44
|
+
export declare function compile(src?: string): (v: Vars) => boolean;
|
|
45
|
+
/** Flatten to dotted names: nesting past `depth` collapses, values cut to 1 KiB, total to `maxBytes`. */
|
|
46
|
+
export declare function capture(vars: Vars, depth: number, maxBytes: number): Record<string, string>;
|
|
47
|
+
/** Fill `{a.b}` from vars (missing names render empty), cut to 1 KiB. Self-contained: the worker embeds it. */
|
|
48
|
+
export declare function render(template: string, vars: Vars): string;
|
|
49
|
+
/** `capture.tags` rendered over vars; `wt.*` names are never set. */
|
|
50
|
+
export declare function tags(def: ProbeDef, vars: Vars): Record<string, string>;
|
|
51
|
+
/** The expression the worker evaluates on a paused frame: tag the active span (OTel API 1.x global). */
|
|
52
|
+
export declare function decorateExpr(attrs: Record<string, string>): string;
|
|
53
|
+
interface Live {
|
|
54
|
+
def: ProbeDef;
|
|
55
|
+
ok: (v: Vars) => boolean;
|
|
56
|
+
win: number;
|
|
57
|
+
n: number;
|
|
58
|
+
}
|
|
59
|
+
type Bp = {
|
|
60
|
+
id: string;
|
|
61
|
+
line: number;
|
|
62
|
+
urlRegex: string;
|
|
63
|
+
dec?: {
|
|
64
|
+
cond: string;
|
|
65
|
+
tags: {
|
|
66
|
+
name: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}[];
|
|
69
|
+
rate: number;
|
|
70
|
+
exp: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/** Parameter names of a function from its source (`argN` where a parameter is destructured or unknown). */
|
|
74
|
+
export declare function paramNames(fn: Function): string[];
|
|
75
|
+
/** The probe set of one service: `set` replaces it, `poll` refreshes it, `onHit` handles a pause. */
|
|
76
|
+
export declare function createProbes(o: ProbesOptions & {
|
|
77
|
+
post?: (defs: Bp[]) => void;
|
|
78
|
+
modules?: () => Record<string, {
|
|
79
|
+
exports: unknown;
|
|
80
|
+
} | undefined>;
|
|
81
|
+
}): {
|
|
82
|
+
set: (defs: ProbeDef[]) => void;
|
|
83
|
+
poll: () => Promise<void>;
|
|
84
|
+
onHit: (h: {
|
|
85
|
+
ids: string[];
|
|
86
|
+
fn: string;
|
|
87
|
+
url: string;
|
|
88
|
+
line: number;
|
|
89
|
+
vars: Vars;
|
|
90
|
+
}) => void;
|
|
91
|
+
live: () => Map<string, Live>;
|
|
92
|
+
};
|
|
93
|
+
/** Poll active probes and hook them through an inspector worker; `stop()` detaches everything. */
|
|
94
|
+
export declare function startProbes(o?: ProbesOptions): {
|
|
95
|
+
stop(): Promise<void>;
|
|
96
|
+
};
|
|
97
|
+
export {};
|