/** * Example — OpenTelemetry bridge for Darwin's metrics sink (v0.14.0). * * Darwin's core stays zero-dep: the loop emits typed {@link DarwinMetricEvent}s * on an injected {@link MetricsSink}, and THIS file — an example, not part of * the library — turns them into OpenTelemetry span events + counters. Copy it * into your project and adapt; `@opentelemetry/api` is YOUR dependency: * * npm install @opentelemetry/api * # plus your SDK/exporter of choice (@opentelemetry/sdk-node, OTLP, …) * * Usage with a hand-wired loop: * * import { DarwinLoop } from 'darwin-agents'; * import { otelMetricsSink } from './otel-bridge.js'; * * const loop = new DarwinLoop({ memory, tracker, optimizer, safety, patterns, * agent, metrics: otelMetricsSink() }); * * Every A/B decision then shows up in your traces/metrics backend next to the * rest of your services — the same place @kamiyo-style Prometheus/Grafana * setups look, but via the vendor-neutral OTel API. */ import type { MetricsSink } from 'darwin-agents'; /** * Build a {@link MetricsSink} that records every Darwin event as * - a span event on the CURRENT active span (when one exists), and * - a monotonic counter `darwin.events` keyed by event type + agent. * * Errors are irrelevant by design: Darwin's `emitMetric` swallows anything * this sink throws, so instrument freely. */ export declare function otelMetricsSink(): MetricsSink; //# sourceMappingURL=otel-bridge.d.ts.map