/** Minimal interfaces so observability is swappable without touching callers. */

export interface Span {
  end(): void;
  setError(err: unknown): void;
}

export interface Tracer {
  startSpan(name: string): Span;
  trace<T>(name: string, fn: () => Promise<T>): Promise<T>;
}

export interface Counter {
  add(value: number, attributes?: Record<string, string>): void;
}

export interface Histogram {
  record(value: number, attributes?: Record<string, string>): void;
}

export interface Meter {
  counter(name: string): Counter;
  histogram(name: string): Histogram;
}

export interface Telemetry {
  tracer: Tracer;
  meter: Meter;
}
