DataDog / integrations-core

Core integrations of the Datadog Agent
BSD 3-Clause "New" or "Revised" License
932 stars 1.4k forks source link

Clickhouse metrics query isn't supporting multi-nodes cluster #14199

Open sichenzhao opened 1 year ago

sichenzhao commented 1 year ago

https://github.com/DataDog/integrations-core/blob/b24ab848bb79718e4963c106b47173105b81ae3d/clickhouse/datadog_checks/clickhouse/queries.py#L9

Currently metrics queries are against local system tables only in Clickhouse. If customers have multi-nodes cluster, it will just reflect the metrics of one node whichever agent is connecting to. This isn't ideal. We should leverage clusterAllReplicas or remote to get all replicas info.

https://clickhouse.com/docs/en/sql-reference/table-functions/cluster https://clickhouse.com/docs/en/sql-reference/table-functions/remote

sichenzhao commented 1 year ago

Hi there, how do we build/test the change locally?