/**
 * OpenTelemetry tracing for the eval agent (evaluator).
 *
 * Opt-in via `eval.otel.enabled: true` in `.indusk/config.json` OR
 * `INDUSK_EVAL_OTEL=1` env var. Exports to `OTEL_EXPORTER_OTLP_ENDPOINT`
 * (Dash0 or any OTLP HTTP receiver).
 *
 * Default OFF — zero cost in normal operation (no SDK init, no network).
 *
 * Graceful degradation: when enabled but endpoint missing, log a warning
 * to `.indusk/eval/system.log` and return a no-op tracer. When SDK init
 * throws, same behavior. The evaluator never fails because of OTel.
 */
import { type Attributes, type Span, type Tracer } from "@opentelemetry/api";
import { type Logger } from "@opentelemetry/api-logs";
export interface EvalOtelConfig {
    enabled: boolean;
    endpoint: string | null;
    dataset: string;
}
/**
 * Pure predicate — reads `.indusk/config.json` `eval.otel.{enabled,dataset}` and
 * the `INDUSK_EVAL_OTEL` / `INDUSK_EVAL_OTEL_DATASET` / `EVAL_AGENT_DATASET` /
 * `OTEL_EXPORTER_OTLP_ENDPOINT` env vars. Does not init anything or touch the network.
 *
 * Resolution:
 * - `enabled`: `INDUSK_EVAL_OTEL=1` (truthy) wins, else config `eval.otel.enabled`, else false.
 * - `endpoint`: `OTEL_EXPORTER_OTLP_ENDPOINT` (null if unset).
 * - `dataset` (priority, highest → lowest):
 *   1. `INDUSK_EVAL_OTEL_DATASET` env var (explicit per-invocation override)
 *   2. `EVAL_AGENT_DATASET` env var (composable.env convention — see env/components/dash0.env)
 *   3. `.indusk/config.json` `eval.otel.dataset`
 *   4. `"agent"` default
 *
 *   Sent as the `Dash0-Dataset` header on every OTLP export. Also rewritten into
 *   `OTEL_EXPORTER_OTLP_HEADERS` if present there (env headers beat constructor
 *   headers per OTel spec — so we fix the env header at the source).
 */
export declare function isEvalOtelEnabled(projectRoot: string): EvalOtelConfig;
/**
 * Initialize OTel tracing for the evaluator if enabled + endpoint set.
 * Returns a Tracer — real when enabled, no-op when not.
 *
 * The no-op path costs nothing: no provider registered, no network, the
 * returned tracer's `startSpan` / `startActiveSpan` produce no-op spans.
 *
 * Safe to call multiple times — subsequent calls return the same tracer.
 */
export declare function initEvalOtel(projectRoot: string): Tracer;
/**
 * Run `fn` inside an active span. Closes the span in `finally`. On thrown
 * error, records the exception on the span and sets status to ERROR, then
 * re-throws so callers can still handle it.
 *
 * Use this for every lifecycle step in the evaluator so spans close even
 * when Claude exits non-zero or a downstream step throws.
 */
export declare function withSpan<T>(tracer: Tracer, name: string, attrs: Attributes | undefined, fn: (span: Span) => Promise<T> | T): Promise<T>;
/**
 * Initialize the OTel logs pipeline alongside traces. Returns a Logger —
 * real when enabled + endpoint set, no-op otherwise. Shares the same
 * config gating + Dash0 dataset routing as `initEvalOtel`. Safe to call
 * multiple times.
 *
 * Log records emitted via `getEvalLogger().emit(...)` automatically
 * correlate with the active span via trace_id / span_id.
 */
export declare function initEvalOtelLogs(projectRoot: string): Logger;
/**
 * Accessor for the eval logger. Always safe to call — returns a no-op
 * logger when logs aren't initialized.
 */
export declare function getEvalLogger(): Logger;
/**
 * Emit an info-severity log record with an arbitrary body. Shorthand for
 * `getEvalLogger().emit(...)`. When called inside an active span, the
 * SDK attaches trace_id + span_id automatically.
 */
export declare function logEvalContent(name: string, body: string | Record<string, unknown>, attributes?: Record<string, string | number | boolean>): void;
/**
 * Flush and shut down the active providers (traces + logs). Call this
 * before `process.exit()` in detached processes so batched signals are
 * not lost. No-op if neither provider is active.
 */
export declare function shutdownEvalOtel(): Promise<void>;
/**
 * Test hook: reset the module's state AND the global OTel API so each test
 * starts fresh. Not part of the public API.
 */
export declare function __resetEvalOtelForTests(): void;
