/** * @factory/observability — public surface (TASK-0135). * * Source-first package: `main`/`types` point at this file (no build step, * the `packages/shared` pattern). The four apps import from here; the * infra (Prometheus/Grafana/Alertmanager, `infrastructure/observability/`) * is the pull-side counterpart of this package's push-side instruments. */ export { SERVICE_NAMES, isServiceName, buildResource, type ServiceName, type BuildResourceOptions } from "./resource.js"; export { initOtel, shutdownOtel, isOtelEnabled, getOtelState, startSpan, startAsyncSpan, type InitOtelOptions, type OtelState, type SpanHandle } from "./otel.js"; export { metrics, m, METRIC_NAMES, registeredInstruments, setQueueDepth, setWsConnections, bindGauges, DURATION_BUCKETS, type MetricName, type HttpAttrs, type DbAttrs, type RedisAttrs, type QueueAttrs, type SearchAttrs, type AiTokenAttrs, type AiRequestAttrs, type StorageAttrs, type ErrorAttrs } from "./metrics.js"; export { spanScrubber, redactQuery, REDACTED } from "./scrubber.js"; export { captureTraceparent, resumeTraceparent, parseTraceparent, buildTraceparent, metadataTraceparent, telemetryTraceparent, registerTraceparentPropagator, traceparentPropagator, W3CTraceContextPropagator, TRACE_HEADER, TRACESTATE_HEADER, type TraceMetadata } from "./traceparent.js"; export { makeOtelPino, otelLogBindings, requestChild, type OtelLogBindings, type MakeOtelPinoOptions } from "./pino-otel.js"; export { renderPrometheus, hasPrometheusReader, setPrometheusReader, prometheusReader } from "./prometheus.js"; // The OTel API context/trace surface, re-exported so apps build spans from // raw `Span` objects (the per-request server span, the BullMQ processor wrap) // without taking a DIRECT @opentelemetry/api dependency. `otelContext` is the // global context API (active()/with/setGlobalContextManager), `otelTrace` the // tracer API (getTracer/startActiveSpan, SpanStatusCode). export { context as otelContext, trace as otelTrace } from "@opentelemetry/api"; export type { Span as OtelSpan, SpanOptions as OtelSpanOptions, Context as OtelContext } from "@opentelemetry/api";