import type { QueryExecutionHook } from './instrument.js'; /** * Minimal OTel tracer shape. Authored structurally so consumers can pass a * real `Tracer` from `@opentelemetry/api` without sqlfu taking a peer dep. */ export interface TracerLike { startActiveSpan(name: string, fn: (span: SpanLike) => TResult): TResult; } export interface SpanLike { setAttribute(key: string, value: string | number | boolean): unknown; recordException(exception: unknown): void; setStatus(status: { code: number; message?: string; }): unknown; end(): void; } /** * Reference OTel hook. Emits a span per query with `db.query.summary`, * `db.query.text`, `db.system.name`; records exceptions and sets ERROR * status on throw. * * This is a deliberately small and readable reference implementation. If * your team has different conventions (different attribute names, extra * resource attributes, custom span kind, sampling hints, etc.), copy this * function body into your codebase and edit it — that's expected and fine. * `QueryExecutionHook` is a stable contract; `createOtelHook` is one way * to satisfy it, not the only way. */ export declare function createOtelHook(options: { tracer: TracerLike; }): QueryExecutionHook;