Getting Started
- Clickhouse can handle all 3 signals (metrics, logs, traces) in one single database. less overhead to manage multiple databases.
- Clickhouse is a columnar database, which is optimized for time-series immutable data like OpenTelemetry telemetry data.
- Clickhouse is a distributed database, which can scale horizontally and handle large amounts of data with efficient storage and query performance.
- Clickhouse is open-source and has a large community.
- To use ClickHouse as a destination in Odigos, you need to have a ClickHouse deployment running somewhere and accessible from cluster where Odigos is running.
- You should know the service endpoint where ClickHouse listens for incoming client connections.
- If you haven’t already, create a database in ClickHouse where you want to store the telemetry data. the default database name is
otel
(configurable). To create it, run the following SQL command:CREATE DATABASE otel;
- Understanding of how to maintain, scale, and optimize your self-hosted ClickHouse deployment, as well as how to fine tune setting based on your queries and use case.
- Odigos UI - When adding a new ClickHouse destination, select the
Create Scheme
checkbox field. - Destination K8s Manifest - Set the
CLICKHOUSE_CREATE_SCHEME
setting to valuetrue
.
- Indexes - The default schema includes indexes for the data, including trace_id, resource and scope attributes, span/metric/log attributes etc.
- TTL is set to 180 days. This means data will be kept in the database for this period of time and then deleted.
- Partitioning - The default schema includes partitioning by day, which means data is stored in separate partitions for each day.
- Order By - Optimized for trace queries on service_name + span_name + time, for logs on service_name + time, and for metrics on service_name + metric_name + attributes + time.
- You may want to adjust the settings to better fit your use case, scale performance requirements, and costs.
- Each new exporter will attempt to create the schema, which is less robust and harder to manage than a pre-created schema.
- Odigos UI - Unselect the
Create Scheme
checkbox field. - Destination K8s Manifest - Set the
CLICKHOUSE_CREATE_SCHEME
setting to valuefalse
.
- Browse to the default DDL example.
- Copy the
sql
files to your local machine. - Make any changes you need to the schema.
- Run the SQL files in your ClickHouse database to create the schema.
- You can optimize the schema for your specific use case, scale performance requirements, and costs.
- You can manage the schema in a version control system, and apply changes in a controlled way.
- Applying changes to the schema is more robust and easier to manage than attempting to create it on the fly with each new connection.
- Indexes - You may want to add or remove indexes based on your queries, to optimize performance and costs.
- TTL - You may want to adjust the TTL based on your retention policy. If you need traces for auditing purposes, you may extend it to 365 days. For high-throughput, low-latency systems, you might want to reduce it to 90 days or even less.
- Partitioning - partitioning by day is a good default, but in high throughput systems you may want to partition by hour or even minute. You may also consider partitioning by service_name, or other attributes.
- Order By - You may want to adjust the order by clause based on your queries, so that common columns are used first in the query, to optimize performance.
Configuring Destination Fields
Supported Signals:
Supported Signals:
✅ Traces
✅ Metrics
✅ Logs
- CLICKHOUSE_ENDPOINT
string
: Endpoint. The ClickHouse endpoint is the URL where the ClickHouse server is listening for incoming connections.- This field is required
- Example:
http://host:port
- CLICKHOUSE_USERNAME
string
: Username. If Clickhouse Authentication is used, provide the username- This field is optional
- CLICKHOUSE_PASSWORD
string
: Password. If Clickhouse Authentication is used, provide the password- This field is optional
- CLICKHOUSE_CREATE_SCHEME
boolean
: Create Schema. Should the destination create the schema for you? Set tofalse
if you manage your own schema, ortrue
to have Odigos create the schema for you- This field is required and defaults to
True
- This field is required and defaults to
- CLICKHOUSE_DATABASE_NAME
string
: Database Name. The name of the Clickhouse Database where the telemetry data will be stored. The Database will not be created when not exists, so make sure you have created it before- This field is required and defaults to
otel
- This field is required and defaults to
- CLICKHOUSE_TRACES_TABLE
string
: Traces Table. Name of the ClickHouse Table to use for storing trace spans. This name should be used in span queries- This field is required and defaults to
otel_traces
- This field is required and defaults to
- CLICKHOUSE_LOGS_TABLE
string
: Logs Table. Name of the ClickHouse Table to use for storing logs- This field is required and defaults to
otel_logs
- This field is required and defaults to
- CLICKHOUSE_METRICS_TABLE_EXP_HISTOGRAM
string
: Metrics Table - Exp. Histogram. Name of the table for storing exponential histogram metrics- This field is required and defaults to
otel_metrics_exponential_histogram
- This field is required and defaults to
- CLICKHOUSE_METRICS_TABLE_GAUGE
string
: Metrics Table - Gauge. Name of the table for storing gauge metrics- This field is required and defaults to
otel_metrics_gauge
- This field is required and defaults to
- CLICKHOUSE_METRICS_TABLE_HISTOGRAM
string
: Metrics Table - Histogram. Name of the table for storing histogram metrics- This field is required and defaults to
otel_metrics_histogram
- This field is required and defaults to
- CLICKHOUSE_METRICS_TABLE_SUM
string
: Metrics Table - Sum. Name of the table for storing sum metrics- This field is required and defaults to
otel_metrics_sum
- This field is required and defaults to
- CLICKHOUSE_METRICS_TABLE_SUMMARY
string
: Metrics Table - Summary. Name of the table for storing summary metrics- This field is required and defaults to
otel_metrics_summary
- This field is required and defaults to
Adding Destination to Odigos
There are two primary methods for configuring destinations in Odigos:Using the UI
1
Use the Odigos CLI to access the UI
2
Click on
Add Destination
, select Clickhouse
and follow the on-screen instructionsUsing Kubernetes manifests
1
Save the YAML below to a file (e.g.
clickhouse.yaml
)2
Apply the YAML using
kubectl