From 1ad4b84e1c98ffe938825200645b82228f4fc074 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 16 Nov 2025 10:01:43 -0800 Subject: [PATCH 1/4] Disable autogenerate session id --- clickhouse/datadog_checks/clickhouse/clickhouse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clickhouse/datadog_checks/clickhouse/clickhouse.py b/clickhouse/datadog_checks/clickhouse/clickhouse.py index e263da55fb8f4..d96e44588a269 100644 --- a/clickhouse/datadog_checks/clickhouse/clickhouse.py +++ b/clickhouse/datadog_checks/clickhouse/clickhouse.py @@ -120,6 +120,7 @@ def connect(self): compress=self._compression, ca_cert=self._tls_ca_cert, verify=self._verify, + autogenerate_session_id=False, # https://clickhouse.com/docs/integrations/python#settings-argument settings={}, ) From 4885db84f051a25a258a3cbdf3d615afb4420cbe Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 16 Nov 2025 10:16:28 -0800 Subject: [PATCH 2/4] Update unit tests --- clickhouse/README.md | 29 ++++++++++++++--------------- clickhouse/tests/test_unit.py | 1 + 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/clickhouse/README.md b/clickhouse/README.md index d5904502c12f8..ea857ba94ebf7 100644 --- a/clickhouse/README.md +++ b/clickhouse/README.md @@ -27,7 +27,7 @@ To configure this check for an Agent running on a host: 1. To start collecting your ClickHouse performance data, edit the `clickhouse.d/conf.yaml` file in the `conf.d/` folder at the root of your Agent's configuration directory. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. -*Note*: This integration uses the official `clickhouse-connect` client to connect over HTTP. +_Note_: This integration uses the official `clickhouse-connect` client to connect over HTTP. 2. [Restart the Agent][5]. @@ -42,14 +42,14 @@ To configure this check for an Agent running on a host: 2. Add the log files you are interested in to your `clickhouse.d/conf.yaml` file to start collecting your ClickHouse logs: ```yaml - logs: - - type: file - path: /var/log/clickhouse-server/clickhouse-server.log - source: clickhouse - service: "" + logs: + - type: file + path: /var/log/clickhouse-server/clickhouse-server.log + source: clickhouse + service: "" ``` - Change the `path` and `service` parameter values and configure them for your environment. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. + Change the `path` and `service` parameter values and configure them for your environment. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. 3. [Restart the Agent][5]. @@ -62,18 +62,18 @@ For containerized environments, see the [Autodiscovery Integration Templates][2] #### Metric collection -| Parameter | Value | -|----------------------|------------------------------------------------------------| -| `` | `clickhouse` | -| `` | blank or `{}` | -| `` | `{"server": "%%host%%", "port": "%%port%%", "username": "", "password": ""}` | +| Parameter | Value | +| -------------------- | -------------------------------------------------------------------------------------------- | +| `` | `clickhouse` | +| `` | blank or `{}` | +| `` | `{"server": "%%host%%", "port": "%%port%%", "username": "", "password": ""}` | ##### Log collection Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes log collection][6]. -| Parameter | Value | -|----------------|-------------------------------------------| +| Parameter | Value | +| -------------- | ------------------------------------------------------- | | `` | `{"source": "clickhouse", "service": ""}` | @@ -101,7 +101,6 @@ See [service_checks.json][9] for a list of service checks provided by this integ Need help? Contact [Datadog support][10]. - [1]: https://clickhouse.yandex [2]: https://docs.datadoghq.com/agent/kubernetes/integrations/ [3]: /account/settings/agent/latest diff --git a/clickhouse/tests/test_unit.py b/clickhouse/tests/test_unit.py index 0630026c6842f..33cf46ff2fb87 100644 --- a/clickhouse/tests/test_unit.py +++ b/clickhouse/tests/test_unit.py @@ -35,6 +35,7 @@ def test_config(instance): client_name='datadog-test-clickhouse', compress=False, settings={}, + autogenerate_session_id=False, ) From 68d1ce7efd982b581cbce46f58466bfc4f86a130 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 16 Nov 2025 10:23:53 -0800 Subject: [PATCH 3/4] Update changelog --- clickhouse/README.md | 31 +++++++++++++++--------------- clickhouse/changelog.d/21886.fixed | 1 + 2 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 clickhouse/changelog.d/21886.fixed diff --git a/clickhouse/README.md b/clickhouse/README.md index ea857ba94ebf7..63a90e5cec086 100644 --- a/clickhouse/README.md +++ b/clickhouse/README.md @@ -27,7 +27,7 @@ To configure this check for an Agent running on a host: 1. To start collecting your ClickHouse performance data, edit the `clickhouse.d/conf.yaml` file in the `conf.d/` folder at the root of your Agent's configuration directory. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. -_Note_: This integration uses the official `clickhouse-connect` client to connect over HTTP. +*Note*: This integration uses the official `clickhouse-connect` client to connect over HTTP. 2. [Restart the Agent][5]. @@ -42,14 +42,14 @@ _Note_: This integration uses the official `clickhouse-connect` client to connec 2. Add the log files you are interested in to your `clickhouse.d/conf.yaml` file to start collecting your ClickHouse logs: ```yaml - logs: - - type: file - path: /var/log/clickhouse-server/clickhouse-server.log - source: clickhouse - service: "" + logs: + - type: file + path: /var/log/clickhouse-server/clickhouse-server.log + source: clickhouse + service: "" ``` - Change the `path` and `service` parameter values and configure them for your environment. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. + Change the `path` and `service` parameter values and configure them for your environment. See the [sample clickhouse.d/conf.yaml][4] for all available configuration options. 3. [Restart the Agent][5]. @@ -62,18 +62,18 @@ For containerized environments, see the [Autodiscovery Integration Templates][2] #### Metric collection -| Parameter | Value | -| -------------------- | -------------------------------------------------------------------------------------------- | -| `` | `clickhouse` | -| `` | blank or `{}` | -| `` | `{"server": "%%host%%", "port": "%%port%%", "username": "", "password": ""}` | +| Parameter | Value | +|----------------------|------------------------------------------------------------| +| `` | `clickhouse` | +| `` | blank or `{}` | +| `` | `{"server": "%%host%%", "port": "%%port%%", "username": "", "password": ""}` | ##### Log collection Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes log collection][6]. -| Parameter | Value | -| -------------- | ------------------------------------------------------- | +| Parameter | Value | +|----------------|-------------------------------------------| | `` | `{"source": "clickhouse", "service": ""}` | @@ -101,6 +101,7 @@ See [service_checks.json][9] for a list of service checks provided by this integ Need help? Contact [Datadog support][10]. + [1]: https://clickhouse.yandex [2]: https://docs.datadoghq.com/agent/kubernetes/integrations/ [3]: /account/settings/agent/latest @@ -110,4 +111,4 @@ Need help? Contact [Datadog support][10]. [7]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information [8]: https://github.com/DataDog/integrations-core/blob/master/clickhouse/metadata.csv [9]: https://github.com/DataDog/integrations-core/blob/master/clickhouse/assets/service_checks.json -[10]: https://docs.datadoghq.com/help/ +[10]: https://docs.datadoghq.com/help/ \ No newline at end of file diff --git a/clickhouse/changelog.d/21886.fixed b/clickhouse/changelog.d/21886.fixed new file mode 100644 index 0000000000000..ed7988864083a --- /dev/null +++ b/clickhouse/changelog.d/21886.fixed @@ -0,0 +1 @@ +Disable autogenerate session id From 3b6a98e44a45706d7eb9609face6729b63ce5867 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 24 Nov 2025 07:43:37 -0800 Subject: [PATCH 4/4] add comment to autogenerate_session_id --- clickhouse/datadog_checks/clickhouse/clickhouse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clickhouse/datadog_checks/clickhouse/clickhouse.py b/clickhouse/datadog_checks/clickhouse/clickhouse.py index d96e44588a269..dbc6ace194799 100644 --- a/clickhouse/datadog_checks/clickhouse/clickhouse.py +++ b/clickhouse/datadog_checks/clickhouse/clickhouse.py @@ -120,6 +120,7 @@ def connect(self): compress=self._compression, ca_cert=self._tls_ca_cert, verify=self._verify, + # https://clickhouse.com/docs/integrations/language-clients/python/driver-api#multi-threaded-applications autogenerate_session_id=False, # https://clickhouse.com/docs/integrations/python#settings-argument settings={},