JSR

Wraps a Federation object with a debug dashboard.

When called with an exporter, the caller is responsible for setting up the OpenTelemetry tracer provider and passing it to createFederation(). The returned object includes a sink property that should be added to the LogTape configuration to collect logs per trace.

Examples

Advanced usage with explicit exporter

const kv = new MemoryKvStore();
const exporter = new FedifySpanExporter(kv);
const tracerProvider = new BasicTracerProvider({
  spanProcessors: [new SimpleSpanProcessor(exporter)],
});
const innerFederation = createFederation({ kv, tracerProvider });
const federation = createFederationDebugger(innerFederation, {
  exporter,
  kv,
});
await configure({
  sinks: { debugger: federation.sink },
  loggers: [
    { category: "fedify", sinks: ["debugger"] },
  ],
});

Type Parameters

The context data type of the federation.

Parameters

The federation object to wrap.

Options including the exporter.

Return Type

A new Federation object with the debug dashboard attached and a sink property for LogTape integration.

Read the original on jsr.io ↗