Skip to main content
Collect local logs and system metrics and send them to ClickHouse Observability for visualization and analysis. This example uses Docker on Linux or Docker Desktop on macOS. Before you begin, install and start Docker and create a ClickHouse Observability service using the fully managed getting started guide or the self-managed getting started guide.

Collect local data

Choose your deployment below to configure and start the collector. After setup, both deployments use the same exploration steps.
In your ClickHouse Observability service, open Team Settings → Data and copy the OTLP HTTP endpoint and API key.
1

Create a custom OpenTelemetry configuration

Create a custom-local-config.yaml file with the following content:
The file_log receiver tails local log files, and the host_metrics receiver collects system metrics. Both pipelines send data to your managed telemetry endpoint over HTTPS.
This example reads new log entries only (start_at: end). It does not parse timestamps from the log body. Add a timestamp parser to the file receiver if you need to preserve the original event time. Use start_at: beginning to also ingest existing entries in newly discovered files.
For more details on the OpenTelemetry (OTel) configuration structure, we recommend the official guide.
2

Start the OpenTelemetry collector

Set the endpoint and API key copied from Team Settings → Data:
The endpoint is the base OTLP HTTP URL, without /v1/logs or /v1/metrics. The collector appends the appropriate path.
Mount the host filesystem read-only so the collector can read host metrics and log files:
Check that the collector starts without configuration or export errors:
Metrics are collected every 30 seconds. Logs appear when new entries are appended to a matching file. Keep the collector running while you explore the data in the following steps.

Explore your data

Keep the collector running while you explore the data. The screenshots show the same Search and Chart Explorer interface used by both deployment modes.
1

Explore system logs

In the ClickHouse Cloud console, select your service and open ClickHouse Observability.Open Search and select the Logs source. Choose a time range that includes when the collector was running, then filter ServiceName to system-logs.Expand an event to inspect its attributes. The screenshot shows example data; your log messages and host attributes will differ.
2

Explore system metrics

Open Chart Explorer and select Time Series and the Metrics source. Choose Maximum as the aggregation, then select system.memory.utilization. Leave Delta unchecked.In the Where field, use Attributes.state:"used" to show used memory. If you collect metrics from multiple hosts, also filter by the host attribute present in your data.Select a time range that includes when the collector was running, then select Run. The screenshot shows example data filtered to a single host. The metric is a ratio from 0 to 1: a value of 0.62 represents 62% utilization.To display utilization as a percentage, open Display Settings and choose Percentage from Output format.Select Apply to update the chart.

Stop collection

When you finish, stop collection and remove the container: