Skip to content

Sinks

Sinks deliver CDEvents to their final destinations.

Quick Reference

toml
[sinks.my_sink]
enabled = true
type = "folder"  # db | clickhouse | http | folder | sse | kafka | nats | debug
# ... type-specific parameters

Available Sinks

TypeDescriptionUse Cases
debugLog events for development and testingDevelopment, troubleshooting, pipeline validation
dbStore events in PostgreSQL databasePrimary storage, dashboards, analytics
clickhouseStore events in ClickHouseHigh-throughput analytics, columnar queries
httpForward events to HTTP endpointsWebhooks, external APIs, integrations
folderWrite events as files to storageArchival, backup, batch processing
sseStream events via Server-Sent EventsReal-time dashboards, monitoring
kafkaPublish events to Kafka topicsEvent streaming, Kafka-compatible brokers
natsPublish events to NATS subjectsCloud-native messaging, JetStream persistent publishing

Shared Configuration

Header Configuration

Sinks use headers differently based on their direction:

  • Header Validation: Validate incoming HTTP requests (SSE sink)
  • Header Authentication: Authenticate outgoing HTTP requests (HTTP sink)

→ Header Validation Guide - For incoming request validation → Header Authentication Guide - For outgoing request authentication

Default Configuration

Several sinks are included in the default configuration:

toml
[sinks.debug]
enabled = false
type = "debug"

[sinks.database]
enabled = false
type = "db"
url = "postgresql://postgres:passwd@localhost:5432/cdviz"
pool_connections_min = 1
pool_connections_max = 10

To enable them, either:

  1. Edit configuration: Set enabled = true in config file
  2. Environment variable: Set CDVIZ_COLLECTOR__SINKS__{SINK_NAME}__ENABLED="true"
  3. Override configuration: Create a custom configuration file

Multiple Sinks

All enabled sinks receive every CDEvent simultaneously. Define as many [sinks.*] sections as needed: