Supported telemetry types
The ClickHouse integration supports these telemetry types:Prerequisites
Meet these requirements before configuring the integration:- Allow the Collector to connect to each ClickHouse HTTP interface.
- Use a ClickHouse account that can run
SELECT 1and read thesystem.metrics,system.events,system.asynchronous_metrics,system.parts,system.replicas, andsystem.dictionariestables.
Configure
The ClickHouse integration is enabled by default. You can configure targets either by annotating pods in your Kubernetes cluster or by listing static endpoints in your Helm values. To configure the ClickHouse integration, follow these steps:-
To collect from ClickHouse pods in Kubernetes, add a CXDOT integration annotation to
the pod template. The annotation key must end with the container name, and its value
can reference credentials stored in a Kubernetes Secret in the same namespace. For
example, add the following annotation to your ClickHouse workload:
The Collector replaces
${target.host}with the pod IP address,${target.port.http}with the container port namedhttp, and${k8s_secret:clickhouse-credentials/password}with thepasswordkey of theclickhouse-credentialsSecret. To allow the Collector to read the Secret, add the pod’s namespace toapiServer.metadataServer.secretAllowlistin the Helm values for your CXDOT Collector. -
Optional: To collect from ClickHouse servers outside your Kubernetes cluster,
configure static targets: list their HTTP interface URLs in
instances. Static targets run on the cluster Collector, so provide the password throughclusterCollector.extraEnv. For example:A nonemptyinstanceslist disables annotation discovery for that integration instance. The Collector scrapes only the listed targets. -
Optional: To combine annotated pods and static targets, configure separate instances.
The unnamed instance discovers pods, and the named instance scrapes the static
targets:
The
clickhouse/statickey defines a named instance and uses the Secret-backed environment variable from the preceding example.
Validate
-
In the
Live Telemetry Analyzer,
add the following label filters:
- Set Label to
__name__and Value tocxdot.integration.target.health. - Set Label to
cxdot.integration.nameand Value toclickhouse.
cxdot.integration.target, and confirm that the metric reports1for each target. - Set Label to
-
In
Metrics Explorer,
run the following query while the ClickHouse servers process queries:
Confirm that the query returns a value greater than
0for each target.
Troubleshoot missing metrics
If expected ClickHouse metrics are missing, confirm that the ClickHouse account can read every system table listed in the prerequisites. The integration collects metric groups from separate system tables, so a permissions error can affect only some of the collected metrics.Disable the ClickHouse integration
Deleting everyclickhouse block restores the default unnamed instance. To remove
custom settings and stop collection, retain a disabled configuration:
Configuration reference
Configure one ClickHouse integration instance with the following settings. In Helm values, place these settings undercollection.cxdot.integrations.clickhouse. In a Collector configuration
file, place them under cxdot.integrations.clickhouse.
Optional settings
-
enabledType:boolean. Optional. Default:true. Whether to enable this ClickHouse integration instance. If true, the Collector runs the instance. If false, the Collector doesn’t run it. -
usernameType:string. Optional. Default:default. ClickHouse user name for connections to the configured instances. -
passwordType:string. Optional. ClickHouse password for connections to the configured instances. The Collector masks this sensitive value in diagnostic output, logs, and errors. -
databaseType:string. Optional. Default:default. Database to attach the connection to. -
collection_intervalType:duration. Optional. Default:15s. How often the Collector collects metrics from each ClickHouse target. -
timeoutType:duration. Optional. Default:15s. Maximum time allowed to collect metrics from one ClickHouse instance. The value must not exceedcollection_interval. -
instancesType:array of object. Optional. Default:[]. ClickHouse instances. Specify eachendpointas the full URL of the ClickHouse HTTP interface, such ashttp://clickhouse.default.svc:8123. Use an HTTPS URL and thetlssettings for a connection that uses TLS. -
instances[].endpointType:string. Required. URL of the instance’s HTTP interface. -
tlsType:object. Optional. Transport layer security (TLS) settings for the configured HTTPS instances. Certificate verification is enabled unlessinsecure_skip_verifyis true. These settings don’t apply to HTTP instances or targets configured through discovery annotations. -
tls.ca_fileType:string. Optional. Path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA. (optional) -
tls.ca_pemType:string. Optional. In memory PEM encoded cert. (optional) -
tls.cert_fileType:string. Optional. Path to the TLS cert to use for TLS required connections. (optional) -
tls.cert_pemType:string. Optional. In memory PEM encoded TLS cert to use for TLS required connections. (optional) -
tls.cipher_suitesType:array of string. Optional. CipherSuites is a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites. -
tls.curve_preferencesType:array of string. Optional. contains the elliptic curves that will be used in an ECDHE handshake, in preference order Defaults to empty list and “crypto/tls” defaults are used, internally. -
tls.include_system_ca_certs_poolType:boolean. Optional. If true, load system CA certificates pool in addition to the certificates configured in this struct. -
tls.insecureType:boolean. Optional. In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false) -
tls.insecure_skip_verifyType:boolean. Optional. InsecureSkipVerify will enable TLS but not verify the certificate. -
tls.key_fileType:string. Optional. Path to the TLS key to use for TLS required connections. (optional) -
tls.key_pemType:string. Optional. In memory PEM encoded TLS key to use for TLS required connections. (optional) -
tls.max_versionType:string. Optional. MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional) -
tls.min_versionType:string. Optional. MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional) -
tls.reload_intervalType:duration. Optional. ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional) -
tls.server_name_overrideType:string. Optional. ServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional) -
tls.tpmType:object. Optional. Trusted platform module configuration -
tls.tpm.authType:string. Optional. Authorization value for the trusted platform module key. -
tls.tpm.enabledType:boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key. -
tls.tpm.owner_authType:string. Optional. Owner authorization value for the trusted platform module. -
tls.tpm.pathType:string. Optional. The path to the TPM device or Unix domain socket. For instance /dev/tpm0 or /dev/tpmrm0.