Skip to main content
Collect container logs, node and cluster metrics, and Kubernetes events with two OpenTelemetry collectors: a DaemonSet on each node and a single deployment for cluster-wide data.

Prerequisites

  • A ClickHouse Observability service
  • A Kubernetes cluster with Linux nodes and permission to create workloads, ClusterRoles, and host-path mounts
  • kubectl configured for the intended cluster and Helm 3 installed
  • Network access from the collectors to your service’s OTLP HTTP endpoint, the Kubernetes API, and kubelets
These collectors gather infrastructure data. Instrument your applications separately to send application metrics and traces; see OpenTelemetry integrations.

Connection details

Open ClickHouse Observability and go to Team Settings → Data → Managed Telemetry. Copy the OTLP HTTP endpoint and API key.Set these variables in your terminal:
Use the exact endpoint, including its port, without a /v1/logs or /v1/metrics suffix.

Deploy the collectors

1

Create the namespace and connection settings

Check that kubectl points to the intended cluster:
Both collectors use these settings in the observability namespace.
2

Save the shared configuration

Save this as k8s_common.yaml:
The chart presets add the receivers, Kubernetes metadata processor, RBAC rules, and mounts needed by each collector. The shared configuration forwards logs and metrics to your service and disables unused application-ingestion receivers.
3

Configure node collection

Save this as k8s_daemonset.yaml:
The DaemonSet reads container logs and collects host and kubelet metrics. Checkpoints preserve log read positions across collector restarts. This preset runs the collector as root to write checkpoints on the node; your cluster’s pod security settings must permit its host mounts.The example skips kubelet certificate verification for clusters whose kubelet certificates are not trusted by the collector. If your cluster provides trusted kubelet certificates, set insecure_skip_verify to false and configure the appropriate CA.
4

Configure cluster collection

Save this as k8s_deployment.yaml:
Keep one replica to avoid collecting duplicate cluster metrics and events.
5

Install the Helm releases

Run from the directory containing the three configuration files. These examples use OpenTelemetry Collector chart 0.175.1 and Collector Contrib 0.161.0:
Check the collectors:
If your nodes have scheduling taints, add appropriate tolerations to k8s_daemonset.yaml for the nodes you intend to monitor.
6

Verify the data

Allow a few collection intervals, then open ClickHouse Observability:
  • In Search, select your Logs source and Last 15 minutes. Expand a container log and check attributes such as k8s.namespace.name, k8s.pod.name, and k8s.node.name.
  • In Chart Explorer, select your Metrics source and look for metrics beginning with k8s. or system..
  • Check your Logs source for Kubernetes events as they occur. Event volume depends on cluster activity.

Application metadata

For instrumented applications, add pod metadata through the Kubernetes downward API. Merge this env list into your application container’s existing configuration and preserve any existing resource attributes:
The Kubernetes metadata processor enriches collected container logs with workload metadata. These application variables attach pod identity to telemetry emitted by your application’s OpenTelemetry SDK.

Troubleshooting

Collectors do not start

Inspect pod events with kubectl describe pod -n observability POD_NAME. Check image pulls, scheduling constraints, pod security restrictions, and that the ConfigMap and Secret exist in the same namespace as the releases.

No logs or metrics appear

Check collector logs for authentication or export errors. Confirm the destination endpoint is reachable from the cluster. For kubelet errors, check connectivity to port 10250, certificate settings, and the generated RBAC permissions. Container log collection requires access to the node’s /var/log/pods directory; restricted or serverless node environments may not support these host mounts.

Connection settings changed

After updating the ConfigMap or Secret, restart the collectors to reload their environment variables:

Next steps