Skip to content

trulens.connectors.snowflake.otel_exporter

trulens.connectors.snowflake.otel_exporter

Classes

TruLensSnowflakeSpanExporter

Bases: SpanExporter

Implementation of SpanExporter that flushes the spans in the TruLens session to a Snowflake Stage.

Attributes
connector instance-attribute

The database connector used to export the spans.

Functions
_export_to_snowflake
_export_to_snowflake(
    spans: Sequence[ReadableSpan], dry_run: bool
) -> SpanExportResult

Exports a list of spans to a Snowflake stage as a protobuf file. This function performs the following steps: 1. Writes the provided spans to a temporary protobuf file. 2. Creates a Snowflake stage if it does not already exist. 3. Uploads the temporary protobuf file to the Snowflake stage. 4. Removes the temporary protobuf file. Args: spans: A sequence of spans to be exported. dry_run: Whether to do everything but run the ingestion SPROC. Returns: SpanExportResult: The result of the export operation, either SUCCESS or FAILURE.

Functions