import { ExportResult } from '@opentelemetry/core'; import { Context } from '@opentelemetry/api'; import { Span as OTelSpan, ReadableSpan as OTelReadableSpan, SpanProcessor, SpanExporter } from '@opentelemetry/sdk-trace-base'; import { MlflowClient } from '../clients'; import { UnityCatalogLocation } from '../core/entities/trace_location'; /** * Span processor for Databricks Unity Catalog backed traces. * * Mirrors Python's `DatabricksUCTableSpanProcessor`: * - generates V4 trace IDs (`trace://`) * - constructs TraceInfo with the UC trace location, V4 schema version, and * any context-injected metadata/tags so that `updateCurrentTrace({ tags })` * can mutate the in-memory record before export * - delegates to a UC-aware SpanExporter for trace info + OTLP span upload * * Wired up by `init({ trackingUri, experimentId })` when the linked Databricks * experiment carries `mlflow.experiment.databricksTrace*` tags pointing at a UC * destination. */ export declare class DatabricksUCTableSpanProcessor implements SpanProcessor { private _exporter; private _location; constructor(exporter: SpanExporter, location: UnityCatalogLocation); onStart(span: OTelSpan, _parentContext: Context): void; onEnd(span: OTelReadableSpan): void; private updateTraceInfo; shutdown(): Promise; forceFlush(): Promise; } /** * Exporter for Databricks Unity Catalog backed traces. * * Mirrors Python's `DatabricksUCTableSpanExporter`. Two-step export per trace: * 1. Call the V4 `CreateTraceInfo` REST endpoint with the full `TraceInfo` * (including `tags`, `trace_metadata`, state, durations). This is what * makes `updateCurrentTrace({ tags })` persist as trace-level tags in * `_traces_unified`, `get_trace`, `search_traces`, and the UI. * 2. Upload the OTel spans for this trace to `/api/2.0/otel/v1/traces` with * the `X-Databricks-UC-Table-Name` header pointing to the trace's UC * spans table. * * Errors in either step are logged but do not surface to user code, matching * the non-fatal behavior of `_log_spans` on the Python side. */ export declare class DatabricksUCTableSpanExporter implements SpanExporter { private _client; private _pendingExports; private _hasRaisedMissingSpansTableWarning; private _hasRaisedSpanExportError; constructor(client: MlflowClient); export(spans: OTelReadableSpan[], resultCallback: (result: ExportResult) => void): void; private exportTraceToBackend; forceFlush(): Promise; shutdown(): Promise; }