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
¶
connector: SnowflakeConnector = connector
The database connector used to export the spans.
Functions¶
make_ai_gateway_otel_exporter
¶
make_ai_gateway_otel_exporter(
gateway_base_url: str,
token: str,
*,
timeout: Optional[int] = None
) -> SpanExporter
Build an OTLP exporter targeting a Snowflake Cortex AI Gateway.
AI Gateways serve OTLP over HTTP/protobuf at
<gateway_base_url>/telemetry/v1/traces (not gRPC), so the stock
otel_exporter="otlp" path cannot reach them. This helper returns the
correct exporter plus the auth header the gateway expects.
| PARAMETER | DESCRIPTION |
|---|---|
gateway_base_url
|
Gateway URL up to and including the gateway name,
e.g.
TYPE:
|
token
|
Bearer token (e.g. programmatic access token) the gateway authenticates with.
TYPE:
|
timeout
|
Optional export timeout in seconds. |
| RETURNS | DESCRIPTION |
|---|---|
SpanExporter
|
An |
SpanExporter
|
telemetry endpoint. |