Snowflake
Overview
Snowflake streams logs from a Praxis collector to Snowflake via the Snowpipe Streaming v2 REST API. The exporter targets a pre-created pipe bound to a table in your Snowflake account; each OpenTelemetry log record becomes one row.
Supported types: Logs
Minimum collector version: 0.3.0
Note: Snowpipe Streaming has no first-party Go SDK. The exporter is a hand-rolled REST client. The default
path_templatetargets the v2 row-insert endpoint and is overridable per Snowflake API version.
Authentication
Authentication supports both OAuth2 and Basic Auth credential types.
| Credential type | When to use |
|---|---|
OAuth2 (oauth2) | Use when Snowflake is configured with an OAuth security integration. Configure token_url, client_id, client_secret, and (typically) scope (e.g. session:role:LOGS_INGEST). |
Basic Auth (basicauth) | Use when your Snowflake endpoint is configured to accept HTTP Basic credentials. Configure username and password in a basicauth credential. |
Snowflake security integration
CREATE SECURITY INTEGRATION praxis_collector_oauth
TYPE = OAUTH
ENABLED = TRUE
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'https://localhost'
OAUTH_ISSUE_REFRESH_TOKENS = TRUE
OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('PRAXIS_COLLECTOR_OAUTH');
Use the printed OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET in the OAuth2 credential.
Basic configuration
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
endpoint | string | none | Yes | Snowflake account URL, e.g. https://xy12345.us-east-1.snowflakecomputing.com. |
database | string | none | Yes | Target Snowflake database holding the Snowpipe Streaming pipe. |
schema | string | none | Yes | Target Snowflake schema holding the Snowpipe Streaming pipe. |
pipe | string | none | Yes | Snowpipe Streaming pipe object name. The pipe must be pre-created and bound to the target table — the exporter does not issue DDL. |
role | string | none | No | Optional Snowflake role to assume on the streaming session. Sent as X-Snowflake-Role. |
Pipe and table setup
CREATE TABLE TELEMETRY_DB.PUBLIC.LOGS (
TIMESTAMP TIMESTAMP_NTZ,
OBSERVED_TIMESTAMP TIMESTAMP_NTZ,
SEVERITY STRING,
BODY VARIANT,
ATTRIBUTES VARIANT,
RESOURCE_ATTRIBUTES VARIANT,
SCOPE_NAME STRING,
TRACE_ID STRING,
SPAN_ID STRING
);
CREATE PIPE TELEMETRY_DB.PUBLIC.LOGS_PIPE AS
COPY INTO TELEMETRY_DB.PUBLIC.LOGS
FROM TABLE(STREAMING_INSERT(
'TELEMETRY_DB.PUBLIC.LOGS',
'JSON'
));
The exporter emits one JSON row per log record with these keys (snake_case, matching the recommended column names above):
| JSON key | Source |
|---|---|
timestamp | LogRecord.Timestamp (RFC3339Nano UTC) |
observed_timestamp | LogRecord.ObservedTimestamp (RFC3339Nano UTC) |
severity | LogRecord.SeverityText or SeverityNumber.String() |
body | LogRecord.Body |
attributes | LogRecord.Attributes |
resource_attributes | Resource.Attributes |
scope_name | InstrumentationScope.Name |
trace_id / span_id | hex, omitted when zero |
Advanced configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
path_template | string | /v2/streaming/databases/{database}/schemas/{schema}/pipes/{pipe}/rows:insert | URL path appended to endpoint. Substitutes {database}, {schema}, {pipe}. Override when targeting a different Snowpipe Streaming API version. |
compression | string | gzip | Request body compression: gzip or none. |
max_batch_rows | int | 10000 | Cap on rows per REST POST. Larger batches are split. |
max_batch_bytes | int | 16777216 | Cap on serialized request body in bytes (16 MiB). |
timeout | int | 30 | Per-request HTTP timeout in seconds. |
retry_on_failure | bool | true | Enable automatic retries on send failures. |
backpressure_queue | bool | true | Enable a sending queue (with optional disk backing). |
TLS (advanced.tls)
| Parameter | Type | Default | Description |
|---|---|---|---|
insecure_skip_verify | bool | false | Skip TLS server certificate verification (not recommended in production). |
ca_file | string | none | Custom CA bundle for verifying the Snowflake endpoint. |
Retry settings
When retry_on_failure is enabled, retry_on_failure_settings (under advanced) can include:
| Parameter | Type | Default | Description |
|---|---|---|---|
initial_interval | int | 5 | Initial backoff in seconds after a failure. |
max_interval | int | 30 | Maximum backoff in seconds between attempts. |
max_time_elapsed | int | 300 | Maximum time in seconds spent retrying a batch. |
Backpressure queue settings
When backpressure_queue is enabled, backpressure_queue_settings (under advanced) can include:
| Parameter | Type | Default | Description |
|---|---|---|---|
queue_size | int | 1000 | Maximum number of batches buffered. |
number_of_consumers | int | 4 | Worker count draining the queue. |
enable_disk_backed_queue | bool | true | Persist the queue to disk via file_storage, surviving restarts. Default flipped to true in v0.3 so collector restarts no longer drop buffered batches. |
Metrics
| Metric | Description |
|---|---|
otelcol_exporter_request_latency | Round-trip latency histogram. |
otelcol_exporter_request_count | Outcomes per request (result=success/auth/throttle/server_error/non_retryable/transport_error). |
otelcol_exporter_payload_size | Bytes per request. |
otelcol_exporter_batch_size | Rows per batch. |
exporter_snowflake_api_errors | Snowpipe API errors bucketed by api_code (auth, throttle, other, none). |
exporter_snowflake_auth_failures | Auth failures, labeled by auth_kind, status_code. |
exporter_snowflake_rows_inserted | Rows accepted by Snowpipe. |
exporter_snowflake_rows_rejected | Rows rejected by Snowpipe, by api_code. |
collector_destination_records_dropped_total | Shared dropped-record counter. |
collector_destination_retries_total | Shared retry counter. |
Limitations
- Logs only in the alpha release.
- No Snowpipe Streaming SDK. Hand-rolled REST. Schema/payload changes between Snowflake API versions are absorbed via
path_template; payload-shape changes need a collector update. - One pipe per destination. Routing to multiple pipes/tables requires multiple destination nodes.
- At-least-once. Snowpipe Streaming may accept duplicates on retry.