mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
- pi-telemetry: TelemetryPropagation (inject/extract, opaque carriers), span links (SpanOptions.links, addLink), TelemetryMetrics (counter, up-down counter, histogram), typed metric schemas (createTypedMetrics), in-memory measurement log, conformance tests for propagation and metrics - chord/context: fixed Context.telemetry member (NOOP default), withTelemetry, traceIn - durable: HarnessOptions.telemetry option type (no instrumentation yet)
6 lines
341 B
TypeScript
6 lines
341 B
TypeScript
import { InMemoryTelemetryContext, type TelemetryCarrier } from "../src/index.ts";
|
|
|
|
const telemetry = new InMemoryTelemetryContext();
|
|
const carrier = JSON.parse(process.argv[2] ?? "{}") as TelemetryCarrier;
|
|
await telemetry.extract(carrier).startSpan({ name: "remote" }, () => {});
|
|
process.stdout.write(JSON.stringify(telemetry.getSpans()));
|