@cryptotaxi247 / netdata-1 / commits / de6f98f5a

add go.d clickhouse (#17743)

Ilya Mashchenko committed May 24, 2024 at 23:46 UTC de6f98f5af02414bb6e195fb9e62d3afcde17365
26 files changed +3814 -294
src/go/collectors/go.d.plugin/README.md
+1
@@ -55,6 +55,7 @@ see the appropriate collector readme.
55 | [bind](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/bind) | ISC Bind |
56 | [cassandra](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cassandra) | Cassandra |
57 | [chrony](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/chrony) | Chrony |
58 +| [clickhouse](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/clickhouse) | ClickHouse |
59 | [cockroachdb](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cockroachdb) | CockroachDB |
60 | [consul](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/consul) | Consul |
61 | [coredns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/coredns) | CoreDNS |
src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/promport.go
+269 -267
@@ -4,273 +4,275 @@ package pipeline
4
5 // https://github.com/prometheus/prometheus/wiki/Default-port-allocations
6 var prometheusPortAllocations = map[int]string{
7 - 2019: "caddy",
8 - 3000: "openethereum",
9 - 3100: "loki",
10 - 5555: "prometheus-jdbc-exporter",
11 - 6060: "crowdsec",
12 - 7300: "midonet_agent",
13 - 8001: "netbox",
14 - 8088: "fawkes",
15 - 8089: "prom2teams",
16 - 8292: "phabricator_webhook_for_alertmanager",
17 - 8404: "ha_proxy_v2_plus",
18 - 9042: "rds_exporter",
19 - 9087: "telegram_bot_for_alertmanager",
20 - 9091: "pushgateway",
21 - 9097: "jiralert",
22 - 9101: "haproxy_exporter",
23 - 9102: "statsd_exporter",
24 - 9103: "collectd_exporter",
25 - 9104: "mysqld_exporter",
26 - 9105: "mesos_exporter",
27 - 9106: "cloudwatch_exporter",
28 - 9107: "consul_exporter",
29 - 9108: "graphite_exporter",
30 - 9109: "graphite_exporter",
31 - 9110: "blackbox_exporter",
32 - 9111: "expvar_exporter",
33 - 9112: "promacct_pcap-based_network_traffic_accounting",
34 - 9113: "nginx_exporter",
35 - 9114: "elasticsearch_exporter",
36 - 9115: "blackbox_exporter",
37 - 9116: "snmp_exporter",
38 - 9117: "apache_exporter",
39 - 9118: "jenkins_exporter",
40 - 9119: "bind_exporter",
41 - 9120: "powerdns_exporter",
42 - 9121: "redis_exporter",
43 - 9122: "influxdb_exporter",
44 - 9123: "rethinkdb_exporter",
45 - 9124: "freebsd_sysctl_exporter",
46 - 9125: "statsd_exporter",
47 - 9126: "new_relic_exporter",
48 - 9127: "pgbouncer_exporter",
49 - 9128: "ceph_exporter",
50 - 9129: "haproxy_log_exporter",
51 - 9130: "unifi_poller",
52 - 9131: "varnish_exporter",
53 - 9132: "airflow_exporter",
54 - 9133: "fritz_box_exporter",
55 - 9134: "zfs_exporter",
56 - 9135: "rtorrent_exporter",
57 - 9136: "collins_exporter",
58 - 9137: "silicondust_hdhomerun_exporter",
59 - 9138: "heka_exporter",
60 - 9139: "azure_sql_exporter",
61 - 9140: "mirth_exporter",
62 - 9141: "zookeeper_exporter",
63 - 9142: "big-ip_exporter",
64 - 9143: "cloudmonitor_exporter",
65 - 9145: "aerospike_exporter",
66 - 9146: "icecast_exporter",
67 - 9147: "nginx_request_exporter",
68 - 9148: "nats_exporter",
69 - 9149: "passenger_exporter",
70 - 9150: "memcached_exporter",
71 - 9151: "varnish_request_exporter",
72 - 9152: "command_runner_exporter",
73 - 9154: "postfix_exporter",
74 - 9155: "vsphere_graphite",
75 - 9156: "webdriver_exporter",
76 - 9157: "ibm_mq_exporter",
77 - 9158: "pingdom_exporter",
78 - 9160: "apache_flink_exporter",
79 - 9161: "oracle_db_exporter",
80 - 9162: "apcupsd_exporter",
81 - 9163: "zgres_exporter",
82 - 9164: "s6_exporter",
83 - 9165: "keepalived_exporter",
84 - 9166: "dovecot_exporter",
85 - 9167: "unbound_exporter",
86 - 9168: "gitlab-monitor",
87 - 9169: "lustre_exporter",
88 - 9170: "docker_hub_exporter",
89 - 9171: "github_exporter",
90 - 9172: "script_exporter",
91 - 9173: "rancher_exporter",
92 - 9174: "docker-cloud_exporter",
93 - 9175: "saltstack_exporter",
94 - 9176: "openvpn_exporter",
95 - 9177: "libvirt_exporter",
96 - 9178: "stream_exporter",
97 - 9179: "shield_exporter",
98 - 9180: "scylladb_exporter",
99 - 9181: "openstack_ceilometer_exporter",
100 - 9183: "openstack_exporter",
101 - 9184: "twitch_exporter",
102 - 9185: "kafka_topic_exporter",
103 - 9186: "cloud_foundry_firehose_exporter",
104 - 9187: "postgresql_exporter",
105 - 9188: "crypto_exporter",
106 - 9189: "hetzner_cloud_csi_driver_nodes",
107 - 9190: "bosh_exporter",
108 - 9191: "netflow_exporter",
109 - 9192: "ceph_exporter",
110 - 9193: "cloud_foundry_exporter",
111 - 9194: "bosh_tsdb_exporter",
112 - 9195: "maxscale_exporter",
113 - 9196: "upnp_internet_gateway_device_exporter",
114 - 9198: "logstash_exporter",
115 - 9199: "cloudflare_exporter",
116 - 9202: "pacemaker_exporter",
117 - 9203: "domain_exporter",
118 - 9204: "pcsensor_temper_exporter",
119 - 9205: "nextcloud_exporter",
120 - 9206: "elasticsearch_exporter",
121 - 9207: "mysql_exporter",
122 - 9208: "kafka_consumer_group_exporter",
123 - 9209: "fastnetmon_advanced_exporter",
124 - 9210: "netatmo_exporter",
125 - 9211: "dnsbl-exporter",
126 - 9212: "digitalocean_exporter",
127 - 9213: "custom_exporter",
128 - 9214: "mqtt_blackbox_exporter",
129 - 9215: "prometheus_graphite_bridge",
130 - 9216: "mongodb_exporter",
131 - 9217: "consul_agent_exporter",
132 - 9218: "promql-guard",
133 - 9219: "ssl_certificate_exporter",
134 - 9220: "netapp_trident_exporter",
135 - 9221: "proxmox_ve_exporter",
136 - 9222: "aws_ecs_exporter",
137 - 9223: "bladepsgi_exporter",
138 - 9224: "fluentd_exporter",
139 - 9225: "mailexporter",
140 - 9226: "allas",
141 - 9227: "proc_exporter",
142 - 9228: "flussonic_exporter",
143 - 9229: "gitlab-workhorse",
144 - 9230: "network_ups_tools_exporter",
145 - 9231: "solr_exporter",
146 - 9232: "osquery_exporter",
147 - 9233: "mgmt_exporter",
148 - 9234: "mosquitto_exporter",
149 - 9235: "gitlab-pages_exporter",
150 - 9236: "gitlab_gitaly_exporter",
151 - 9237: "sql_exporter",
152 - 9238: "uwsgi_expoter",
153 - 9239: "surfboard_exporter",
154 - 9240: "tinyproxy_exporter",
155 - 9241: "arangodb_exporter",
156 - 9242: "ceph_radosgw_usage_exporter",
157 - 9243: "chef_compliance_exporter",
158 - 9244: "moby_container_exporter",
159 - 9245: "naemon_nagios_exporter",
160 - 9246: "smartpi",
161 - 9247: "sphinx_exporter",
162 - 9248: "freebsd_gstat_exporter",
163 - 9249: "apache_flink_metrics_reporter",
164 - 9250: "opentsdb_exporter",
165 - 9251: "sensu_exporter",
166 - 9252: "gitlab_runner_exporter",
167 - 9253: "php-fpm_exporter",
168 - 9254: "kafka_burrow_exporter",
169 - 9255: "google_stackdriver_exporter",
170 - 9256: "td-agent_exporter",
171 - 9257: "smart_exporter",
172 - 9258: "hello_sense_exporter",
173 - 9259: "azure_resources_exporter",
174 - 9260: "buildkite_exporter",
175 - 9261: "grafana_exporter",
176 - 9262: "bloomsky_exporter",
177 - 9263: "vmware_guest_exporter",
178 - 9264: "nest_exporter",
179 - 9265: "weather_exporter",
180 - 9266: "openhab_exporter",
181 - 9267: "nagios_livestatus_exporter",
182 - 9268: "cratedb_remote_remote_read_write_adapter",
183 - 9269: "fluent-agent-lite_exporter",
184 - 9270: "jmeter_exporter",
185 - 9271: "pagespeed_exporter",
186 - 9272: "vmware_exporter",
187 - 9274: "kubernetes_persistentvolume_disk_usage_exporter",
188 - 9275: "nrpe_exporter",
189 - 9276: "azure_monitor_exporter",
190 - 9277: "mongo_collection_exporter",
191 - 9278: "crypto_miner_exporter",
192 - 9279: "instaclustr_exporter",
193 - 9280: "citrix_netscaler_exporter",
194 - 9281: "fastd_exporter",
195 - 9282: "freeswitch_exporter",
196 - 9283: "ceph_ceph-mgr_prometheus_plugin",
197 - 9284: "gobetween",
198 - 9285: "database_exporter",
199 - 9286: "vdo_compression_and_deduplication_exporter",
200 - 9287: "ceph_iscsi_gateway_statistics",
201 - 9288: "consrv",
202 - 9289: "lovoos_ipmi_exporter",
203 - 9290: "soundclouds_ipmi_exporter",
204 - 9291: "ibm_z_hmc_exporter",
205 - 9292: "netapp_ontap_api_exporter",
206 - 9293: "connection_status_exporter",
207 - 9294: "miflora_flower_care_exporter",
208 - 9295: "freifunk_exporter",
209 - 9296: "odbc_exporter",
210 - 9297: "machbase_exporter",
211 - 9298: "generic_exporter",
212 - 9299: "exporter_aggregator",
213 - 9301: "squid_exporter",
214 - 9302: "faucet_sdn_faucet_exporter",
215 - 9303: "faucet_sdn_gauge_exporter",
216 - 9304: "logstash_exporter",
217 - 9305: "go-ethereum_exporter",
218 - 9306: "kyototycoon_exporter",
219 - 9307: "audisto_exporter",
220 - 9308: "kafka_exporter",
221 - 9309: "fluentd_exporter",
222 - 9310: "open_vswitch_exporter",
223 - 9311: "iota_exporter",
224 - 9313: "cloudprober_exporter",
225 - 9314: "eris_exporter",
226 - 9315: "centrifugo_exporter",
227 - 9316: "tado_exporter",
228 - 9317: "tellstick_local_exporter",
229 - 9318: "conntrack_exporter",
230 - 9319: "flexlm_exporter",
231 - 9320: "consul_telemetry_exporter",
232 - 9321: "spring_boot_actuator_exporter",
233 - 9322: "haproxy_abuser_exporter",
234 - 9323: "docker_prometheus_metrics",
235 - 9324: "bird_routing_daemon_exporter",
236 - 9325: "ovirt_exporter",
237 - 9326: "junos_exporter",
238 - 9327: "s3_exporter",
239 - 9328: "openldap_syncrepl_exporter",
240 - 9329: "cups_exporter",
241 - 9330: "openldap_metrics_exporter",
242 - 9331: "influx-spout_prometheus_metrics",
243 - 9332: "network_exporter",
244 - 9333: "vault_pki_exporter",
245 - 9334: "ejabberd_exporter",
246 - 9335: "nexsan_exporter",
247 - 9336: "mediacom_internet_usage_exporter",
248 - 9337: "mqttgateway",
249 - 9339: "aws_s3_exporter",
250 - 9340: "financial_quotes_exporter",
251 - 9341: "slurm_exporter",
252 - 9342: "frr_exporter",
253 - 9343: "gridserver_exporter",
254 - 9344: "mqtt_exporter",
255 - 9345: "ruckus_smartzone_exporter",
256 - 9346: "ping_exporter",
257 - 9347: "junos_exporter",
258 - 9348: "bigquery_exporter",
259 - 9349: "configurable_elasticsearch_query_exporter",
260 - 9350: "thousandeyes_exporter",
261 - 9351: "wal-e_wal-g_exporter",
262 - 9352: "nature_remo_exporter",
263 - 9353: "ceph_exporter",
264 - 9354: "deluge_exporter",
265 - 9355: "nightwatchjs_exporter",
266 - 9356: "pacemaker_exporter",
267 - 9357: "p1_exporter",
268 - 9358: "performance_counters_exporter",
269 - 9359: "sidekiq_prometheus",
270 - 9360: "powershell_exporter",
271 - 9361: "scaleway_sd_exporter",
272 - 9362: "cisco_exporter",
273 - 9363: "clickhouse",
7 + 2019: "caddy",
8 + 3000: "grafana",
9 + 3100: "loki",
10 + 5555: "prometheus-jdbc-exporter",
11 + 6060: "crowdsec",
12 + 7300: "midonet_agent",
13 + 8001: "netbox",
14 + 8088: "fawkes",
15 + 8089: "prom2teams",
16 + 8292: "phabricator_webhook_for_alertmanager",
17 + 8404: "ha_proxy_v2_plus",
18 + 9042: "rds_exporter",
19 + 9087: "telegram_bot_for_alertmanager",
20 + 9091: "pushgateway",
21 + 9097: "jiralert",
22 + 9101: "haproxy_exporter",
23 + 9102: "statsd_exporter",
24 + 9103: "collectd_exporter",
25 + 9104: "mysqld_exporter",
26 + 9105: "mesos_exporter",
27 + 9106: "cloudwatch_exporter",
28 + 9107: "consul_exporter",
29 + 9108: "graphite_exporter",
30 + 9109: "graphite_exporter",
31 + 9110: "blackbox_exporter",
32 + 9111: "expvar_exporter",
33 + 9112: "promacct_pcap-based_network_traffic_accounting",
34 + 9113: "nginx_exporter",
35 + 9114: "elasticsearch_exporter",
36 + 9115: "blackbox_exporter",
37 + 9116: "snmp_exporter",
38 + 9117: "apache_exporter",
39 + 9118: "jenkins_exporter",
40 + 9119: "bind_exporter",
41 + 9120: "powerdns_exporter",
42 + 9121: "redis_exporter",
43 + 9122: "influxdb_exporter",
44 + 9123: "rethinkdb_exporter",
45 + 9124: "freebsd_sysctl_exporter",
46 + 9125: "statsd_exporter",
47 + 9126: "new_relic_exporter",
48 + 9127: "pgbouncer_exporter",
49 + 9128: "ceph_exporter",
50 + 9129: "haproxy_log_exporter",
51 + 9130: "unifi_poller",
52 + 9131: "varnish_exporter",
53 + 9132: "airflow_exporter",
54 + 9133: "fritz_box_exporter",
55 + 9134: "zfs_exporter",
56 + 9135: "rtorrent_exporter",
57 + 9136: "collins_exporter",
58 + 9137: "silicondust_hdhomerun_exporter",
59 + 9138: "heka_exporter",
60 + 9139: "azure_sql_exporter",
61 + 9140: "mirth_exporter",
62 + 9141: "zookeeper_exporter",
63 + 9142: "big-ip_exporter",
64 + 9143: "cloudmonitor_exporter",
65 + 9145: "aerospike_exporter",
66 + 9146: "icecast_exporter",
67 + 9147: "nginx_request_exporter",
68 + 9148: "nats_exporter",
69 + 9149: "passenger_exporter",
70 + 9150: "memcached_exporter",
71 + 9151: "varnish_request_exporter",
72 + 9152: "command_runner_exporter",
73 + 9154: "postfix_exporter",
74 + 9155: "vsphere_graphite",
75 + 9156: "webdriver_exporter",
76 + 9157: "ibm_mq_exporter",
77 + 9158: "pingdom_exporter",
78 + 9160: "apache_flink_exporter",
79 + 9161: "oracle_db_exporter",
80 + 9162: "apcupsd_exporter",
81 + 9163: "zgres_exporter",
82 + 9164: "s6_exporter",
83 + 9165: "keepalived_exporter",
84 + 9166: "dovecot_exporter",
85 + 9167: "unbound_exporter",
86 + 9168: "gitlab-monitor",
87 + 9169: "lustre_exporter",
88 + 9170: "docker_hub_exporter",
89 + 9171: "github_exporter",
90 + 9172: "script_exporter",
91 + 9173: "rancher_exporter",
92 + 9174: "docker-cloud_exporter",
93 + 9175: "saltstack_exporter",
94 + 9176: "openvpn_exporter",
95 + 9177: "libvirt_exporter",
96 + 9178: "stream_exporter",
97 + 9179: "shield_exporter",
98 + 9180: "scylladb_exporter",
99 + 9181: "openstack_ceilometer_exporter",
100 + 9183: "openstack_exporter",
101 + 9184: "twitch_exporter",
102 + 9185: "kafka_topic_exporter",
103 + 9186: "cloud_foundry_firehose_exporter",
104 + 9187: "postgresql_exporter",
105 + 9188: "crypto_exporter",
106 + 9189: "hetzner_cloud_csi_driver_nodes",
107 + 9190: "bosh_exporter",
108 + 9191: "netflow_exporter",
109 + 9192: "ceph_exporter",
110 + 9193: "cloud_foundry_exporter",
111 + 9194: "bosh_tsdb_exporter",
112 + 9195: "maxscale_exporter",
113 + 9196: "upnp_internet_gateway_device_exporter",
114 + 9198: "logstash_exporter",
115 + 9199: "cloudflare_exporter",
116 + 9202: "pacemaker_exporter",
117 + 9203: "domain_exporter",
118 + 9204: "pcsensor_temper_exporter",
119 + 9205: "nextcloud_exporter",
120 + 9206: "elasticsearch_exporter",
121 + 9207: "mysql_exporter",
122 + 9208: "kafka_consumer_group_exporter",
123 + 9209: "fastnetmon_advanced_exporter",
124 + 9210: "netatmo_exporter",
125 + 9211: "dnsbl-exporter",
126 + 9212: "digitalocean_exporter",
127 + 9213: "custom_exporter",
128 + 9214: "mqtt_blackbox_exporter",
129 + 9215: "prometheus_graphite_bridge",
130 + 9216: "mongodb_exporter",
131 + 9217: "consul_agent_exporter",
132 + 9218: "promql-guard",
133 + 9219: "ssl_certificate_exporter",
134 + 9220: "netapp_trident_exporter",
135 + 9221: "proxmox_ve_exporter",
136 + 9222: "aws_ecs_exporter",
137 + 9223: "bladepsgi_exporter",
138 + 9224: "fluentd_exporter",
139 + 9225: "mailexporter",
140 + 9226: "allas",
141 + 9227: "proc_exporter",
142 + 9228: "flussonic_exporter",
143 + 9229: "gitlab-workhorse",
144 + 9230: "network_ups_tools_exporter",
145 + 9231: "solr_exporter",
146 + 9232: "osquery_exporter",
147 + 9233: "mgmt_exporter",
148 + 9234: "mosquitto_exporter",
149 + 9235: "gitlab-pages_exporter",
150 + 9236: "gitlab_gitaly_exporter",
151 + 9237: "sql_exporter",
152 + 9238: "uwsgi_expoter",
153 + 9239: "surfboard_exporter",
154 + 9240: "tinyproxy_exporter",
155 + 9241: "arangodb_exporter",
156 + 9242: "ceph_radosgw_usage_exporter",
157 + 9243: "chef_compliance_exporter",
158 + 9244: "moby_container_exporter",
159 + 9245: "naemon_nagios_exporter",
160 + 9246: "smartpi",
161 + 9247: "sphinx_exporter",
162 + 9248: "freebsd_gstat_exporter",
163 + 9249: "apache_flink_metrics_reporter",
164 + 9250: "opentsdb_exporter",
165 + 9251: "sensu_exporter",
166 + 9252: "gitlab_runner_exporter",
167 + 9253: "php-fpm_exporter",
168 + 9254: "kafka_burrow_exporter",
169 + 9255: "google_stackdriver_exporter",
170 + 9256: "td-agent_exporter",
171 + 9257: "smart_exporter",
172 + 9258: "hello_sense_exporter",
173 + 9259: "azure_resources_exporter",
174 + 9260: "buildkite_exporter",
175 + 9261: "grafana_exporter",
176 + 9262: "bloomsky_exporter",
177 + 9263: "vmware_guest_exporter",
178 + 9264: "nest_exporter",
179 + 9265: "weather_exporter",
180 + 9266: "openhab_exporter",
181 + 9267: "nagios_livestatus_exporter",
182 + 9268: "cratedb_remote_remote_read_write_adapter",
183 + 9269: "fluent-agent-lite_exporter",
184 + 9270: "jmeter_exporter",
185 + 9271: "pagespeed_exporter",
186 + 9272: "vmware_exporter",
187 + 9274: "kubernetes_persistentvolume_disk_usage_exporter",
188 + 9275: "nrpe_exporter",
189 + 9276: "azure_monitor_exporter",
190 + 9277: "mongo_collection_exporter",
191 + 9278: "crypto_miner_exporter",
192 + 9279: "instaclustr_exporter",
193 + 9280: "citrix_netscaler_exporter",
194 + 9281: "fastd_exporter",
195 + 9282: "freeswitch_exporter",
196 + 9283: "ceph_ceph-mgr_prometheus_plugin",
197 + 9284: "gobetween",
198 + 9285: "database_exporter",
199 + 9286: "vdo_compression_and_deduplication_exporter",
200 + 9287: "ceph_iscsi_gateway_statistics",
201 + 9288: "consrv",
202 + 9289: "lovoos_ipmi_exporter",
203 + 9290: "soundclouds_ipmi_exporter",
204 + 9291: "ibm_z_hmc_exporter",
205 + 9292: "netapp_ontap_api_exporter",
206 + 9293: "connection_status_exporter",
207 + 9294: "miflora_flower_care_exporter",
208 + 9295: "freifunk_exporter",
209 + 9296: "odbc_exporter",
210 + 9297: "machbase_exporter",
211 + 9298: "generic_exporter",
212 + 9299: "exporter_aggregator",
213 + 9301: "squid_exporter",
214 + 9302: "faucet_sdn_faucet_exporter",
215 + 9303: "faucet_sdn_gauge_exporter",
216 + 9304: "logstash_exporter",
217 + 9305: "go-ethereum_exporter",
218 + 9306: "kyototycoon_exporter",
219 + 9307: "audisto_exporter",
220 + 9308: "kafka_exporter",
221 + 9309: "fluentd_exporter",
222 + 9310: "open_vswitch_exporter",
223 + 9311: "iota_exporter",
224 + 9313: "cloudprober_exporter",
225 + 9314: "eris_exporter",
226 + 9315: "centrifugo_exporter",
227 + 9316: "tado_exporter",
228 + 9317: "tellstick_local_exporter",
229 + 9318: "conntrack_exporter",
230 + 9319: "flexlm_exporter",
231 + 9320: "consul_telemetry_exporter",
232 + 9321: "spring_boot_actuator_exporter",
233 + 9322: "haproxy_abuser_exporter",
234 + 9323: "docker_prometheus_metrics",
235 + 9324: "bird_routing_daemon_exporter",
236 + 9325: "ovirt_exporter",
237 + 9326: "junos_exporter",
238 + 9327: "s3_exporter",
239 + 9328: "openldap_syncrepl_exporter",
240 + 9329: "cups_exporter",
241 + 9330: "openldap_metrics_exporter",
242 + 9331: "influx-spout_prometheus_metrics",
243 + 9332: "network_exporter",
244 + 9333: "vault_pki_exporter",
245 + 9334: "ejabberd_exporter",
246 + 9335: "nexsan_exporter",
247 + 9336: "mediacom_internet_usage_exporter",
248 + 9337: "mqttgateway",
249 + 9339: "aws_s3_exporter",
250 + 9340: "financial_quotes_exporter",
251 + 9341: "slurm_exporter",
252 + 9342: "frr_exporter",
253 + 9343: "gridserver_exporter",
254 + 9344: "mqtt_exporter",
255 + 9345: "ruckus_smartzone_exporter",
256 + 9346: "ping_exporter",
257 + 9347: "junos_exporter",
258 + 9348: "bigquery_exporter",
259 + 9349: "configurable_elasticsearch_query_exporter",
260 + 9350: "thousandeyes_exporter",
261 + 9351: "wal-e_wal-g_exporter",
262 + 9352: "nature_remo_exporter",
263 + 9353: "ceph_exporter",
264 + 9354: "deluge_exporter",
265 + 9355: "nightwatchjs_exporter",
266 + 9356: "pacemaker_exporter",
267 + 9357: "p1_exporter",
268 + 9358: "performance_counters_exporter",
269 + 9359: "sidekiq_prometheus",
270 + 9360: "powershell_exporter",
271 + 9361: "scaleway_sd_exporter",
272 + 9362: "cisco_exporter",
273 + // Netdata has clickhouse collector.
274 + // CH itself exposes messy Prometheus metrics: camelCase names, appends instances to names instead of labels.
275 + //9363: "clickhouse",
276 9364: "continent8_exporter",
277 9365: "cumulus_linux_exporter",
278 9366: "haproxy_stick_table_exporter",
src/go/collectors/go.d.plugin/config/go.d.conf
+1
@@ -20,6 +20,7 @@ modules:
20 # apache: yes
21 # bind: yes
22 # chrony: yes
23 +# clickhouse: yes
24 # cockroachdb: yes
25 # consul: yes
26 # coredns: yes
src/go/collectors/go.d.plugin/config/go.d/clickhouse.conf new
+6
@@ -0,0 +1,6 @@
1 +## All available configuration options, their descriptions and default values:
2 +## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/clickhouse#readme
3 +
4 +#jobs:
5 +# - name: local
6 +# url: http://127.0.0.1:8123
src/go/collectors/go.d.plugin/config/go.d/sd/net_listeners.conf
+7
@@ -22,6 +22,8 @@ classify:
22 expr: '{{ and (eq .Port "7072") (glob .Cmdline "*cassandra*") }}'
23 - tags: "chrony"
24 expr: '{{ and (eq .Port "323") (eq .Comm "chronyd") }}'
25 + - tags: "clickhouse"
26 + expr: '{{ and (eq .Port "8123") (eq .Comm "clickhouse-server") }}'
27 - tags: "cockroachdb"
28 expr: '{{ and (eq .Port "8080") (eq .Comm "cockroach") }}'
29 - tags: "consul"
@@ -142,6 +144,11 @@ compose:
144 module: chrony
145 name: local
146 address: {{.Address}}
147 + - selector: "clickhouse"
148 + template: |
149 + module: clickhouse
150 + name: local
151 + url: http://{{.Address}}
152 - selector: "cockroachdb"
153 template: |
154 module: cockroachdb
src/go/collectors/go.d.plugin/modules/clickhouse/charts.go new
+953
@@ -0,0 +1,953 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "fmt"
7 + "strings"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/agent/module"
10 +)
11 +
12 +const (
13 + prioConnections = module.Priority + iota
14 +
15 + prioSlowReads
16 + prioReadBackoff
17 +
18 + prioMemoryUsage
19 +
20 + prioDiskSpaceUsage
21 +
22 + prioQueries
23 + prioSelectQueries
24 + prioInsertQueries
25 + prioQueriesPreempted
26 + prioQueriesMemoryLimitExceeded
27 +
28 + prioQueriesLatency
29 + prioSelectQueriesLatency
30 + prioInsertQueriesLatency
31 +
32 + prioIO
33 + prioIOPS
34 + prioIOErrors
35 + prioIOSeeks
36 + prioIOFileOpens
37 +
38 + prioDatabaseTableSize
39 + prioDatabaseTableParts
40 + prioDatabaseTableRows
41 +
42 + prioReplicatedPartsCurrentActivity
43 + prioReadOnlyReplica
44 + prioReplicatedDataLoss
45 + prioReplicatedPartFetches
46 + prioReplicatedPartFetchesOfMerged
47 + prioReplicatedPartMerges
48 +
49 + prioInsertedBytes
50 + prioInsertedRows
51 + prioRejectedInserts
52 + prioDelayedInserts
53 + prioDelayedInsertsThrottleTime
54 +
55 + prioSelectedBytes
56 + prioSelectedRows
57 + prioSelectedParts
58 + prioSelectedRanges
59 + prioSelectedMarks
60 +
61 + prioMerges
62 + prioMergesLatency
63 + prioMergedUncompressedBytes
64 + prioMergedRows
65 +
66 + prioMergeTreeDataWriterRows
67 + prioMergeTreeDataWriterUncompressedBytes
68 + prioMergeTreeDataWriterCompressedBytes
69 +
70 + prioUncompressedCacheRequests
71 + prioMarkCacheRequests
72 +
73 + prioParts
74 +
75 + prioDistributedSend
76 + prioDistributedConnectionTries
77 + prioDistributedConnectionFailTry
78 + prioDistributedConnectionFailAtAll
79 +
80 + prioDistributedFilesToInsert
81 + prioDistributedRejectedInserts
82 + prioDistributedDelayedInserts
83 + prioDistributedDelayedInsertsMilliseconds
84 + prioDistributedSyncInsertionTimeoutExceeded
85 + prioDistributedAsyncInsertionFailures
86 +
87 + prioUptime
88 +)
89 +
90 +var chCharts = module.Charts{
91 + chartConnections.Copy(),
92 +
93 + chartMemoryUsage.Copy(),
94 +
95 + chartSlowReads.Copy(),
96 + chartReadBackoff.Copy(),
97 +
98 + chartQueries.Copy(),
99 + chartSelectQueries.Copy(),
100 + chartInsertQueries.Copy(),
101 + chartQueriesPreempted.Copy(),
102 + chartQueriesMemoryLimitExceeded.Copy(),
103 +
104 + chartQueriesLatency.Copy(),
105 + chartSelectQueriesLatency.Copy(),
106 + chartInsertQueriesLatency.Copy(),
107 +
108 + chartFileDescriptorIO.Copy(),
109 + chartFileDescriptorIOPS.Copy(),
110 + chartFileDescriptorIOErrors.Copy(),
111 + chartIOSeeks.Copy(),
112 + chartIOFileOpens.Copy(),
113 +
114 + chartReplicatedPartsActivity.Copy(),
115 + chartReadonlyReplica.Copy(),
116 + chartReplicatedDataLoss.Copy(),
117 + chartReplicatedPartFetches.Copy(),
118 + chartReplicatedPartMerges.Copy(),
119 + chartReplicatedPartFetchesOfMerged.Copy(),
120 +
121 + chartInsertedRows.Copy(),
122 + chartInsertedBytes.Copy(),
123 + chartRejectedInserts.Copy(),
124 + chartDelayedInserts.Copy(),
125 + chartDelayedInsertsThrottleTime.Copy(),
126 +
127 + chartSelectedRows.Copy(),
128 + chartSelectedBytes.Copy(),
129 + chartSelectedParts.Copy(),
130 + chartSelectedRanges.Copy(),
131 + chartSelectedMarks.Copy(),
132 +
133 + chartMerges.Copy(),
134 + chartMergesLatency.Copy(),
135 + chartMergedUncompressedBytes.Copy(),
136 + chartMergedRows.Copy(),
137 +
138 + chartMergeTreeDataWriterInsertedRows.Copy(),
139 + chartMergeTreeDataWriterUncompressedBytes.Copy(),
140 + chartMergeTreeDataWriterCompressedBytes.Copy(),
141 +
142 + chartUncompressedCacheRequests.Copy(),
143 + chartMarkCacheRequests.Copy(),
144 +
145 + chartPartsCount.Copy(),
146 +
147 + chartDistributedConnections.Copy(),
148 + chartDistributedConnectionAttempts.Copy(),
149 + chartDistributedConnectionFailRetries.Copy(),
150 + chartDistributedConnectionFailExhaustedRetries.Copy(),
151 +
152 + chartDistributedFilesToInsert.Copy(),
153 + chartDistributedRejectedInserts.Copy(),
154 + chartDistributedDelayedInserts.Copy(),
155 + chartDistributedDelayedInsertsLatency.Copy(),
156 + chartDistributedSyncInsertionTimeoutExceeded.Copy(),
157 + chartDistributedAsyncInsertionFailures.Copy(),
158 +
159 + chartUptime.Copy(),
160 +}
161 +
162 +var (
163 + chartConnections = module.Chart{
164 + ID: "connections",
165 + Title: "Connections",
166 + Units: "connections",
167 + Fam: "conns",
168 + Ctx: "clickhouse.connections",
169 + Priority: prioConnections,
170 + Dims: module.Dims{
171 + {ID: "metrics_TCPConnection", Name: "tcp"},
172 + {ID: "metrics_HTTPConnection", Name: "http"},
173 + {ID: "metrics_MySQLConnection", Name: "mysql"},
174 + {ID: "metrics_PostgreSQLConnection", Name: "postgresql"},
175 + {ID: "metrics_InterserverConnection", Name: "interserver"},
176 + },
177 + }
178 +)
179 +
180 +var (
181 + chartSlowReads = module.Chart{
182 + ID: "slow_reads",
183 + Title: "Slow reads from a file",
184 + Units: "reads/s",
185 + Fam: "slow reads",
186 + Ctx: "clickhouse.slow_reads",
187 + Priority: prioSlowReads,
188 + Dims: module.Dims{
189 + {ID: "events_SlowRead", Name: "slow"},
190 + },
191 + }
192 + chartReadBackoff = module.Chart{
193 + ID: "read_backoff",
194 + Title: "Read backoff events",
195 + Units: "events/s",
196 + Fam: "slow reads",
197 + Ctx: "clickhouse.read_backoff",
198 + Priority: prioReadBackoff,
199 + Dims: module.Dims{
200 + {ID: "events_ReadBackoff", Name: "read_backoff"},
201 + },
202 + }
203 +)
204 +
205 +var (
206 + chartMemoryUsage = module.Chart{
207 + ID: "memory_usage",
208 + Title: "Memory usage",
209 + Units: "bytes",
210 + Fam: "mem",
211 + Ctx: "clickhouse.memory_usage",
212 + Priority: prioMemoryUsage,
213 + Type: module.Area,
214 + Dims: module.Dims{
215 + {ID: "metrics_MemoryTracking", Name: "used"},
216 + },
217 + }
218 +)
219 +
220 +var diskChartsTmpl = module.Charts{
221 + diskSpaceUsageChartTmpl.Copy(),
222 +}
223 +
224 +var (
225 + diskSpaceUsageChartTmpl = module.Chart{
226 + ID: "disk_%s_space_usage",
227 + Title: "Disk space usage",
228 + Units: "bytes",
229 + Fam: "disk space",
230 + Ctx: "clickhouse.disk_space_usage",
231 + Type: module.Stacked,
232 + Priority: prioDiskSpaceUsage,
233 + Dims: module.Dims{
234 + {ID: "disk_%s_free_space_bytes", Name: "free"},
235 + {ID: "disk_%s_used_space_bytes", Name: "used"},
236 + },
237 + }
238 +)
239 +
240 +var (
241 + chartQueries = module.Chart{
242 + ID: "queries",
243 + Title: "Queries",
244 + Units: "queries/s",
245 + Fam: "queries",
246 + Ctx: "clickhouse.queries",
247 + Priority: prioQueries,
248 + Type: module.Stacked,
249 + Dims: module.Dims{
250 + {ID: "events_SuccessfulQuery", Name: "successful", Algo: module.Incremental},
251 + {ID: "events_FailedQuery", Name: "failed", Algo: module.Incremental},
252 + },
253 + }
254 + chartSelectQueries = module.Chart{
255 + ID: "select_queries",
256 + Title: "Select queries",
257 + Units: "selects/s",
258 + Fam: "queries",
259 + Ctx: "clickhouse.select_queries",
260 + Priority: prioSelectQueries,
261 + Type: module.Stacked,
262 + Dims: module.Dims{
263 + {ID: "events_SuccessfulSelectQuery", Name: "successful", Algo: module.Incremental},
264 + {ID: "events_FailedSelectQuery", Name: "failed", Algo: module.Incremental},
265 + },
266 + }
267 + chartInsertQueries = module.Chart{
268 + ID: "insert_queries",
269 + Title: "Insert queries",
270 + Units: "inserts/s",
271 + Fam: "queries",
272 + Ctx: "clickhouse.insert_queries",
273 + Priority: prioInsertQueries,
274 + Type: module.Stacked,
275 + Dims: module.Dims{
276 + {ID: "events_SuccessfulInsertQuery", Name: "successful", Algo: module.Incremental},
277 + {ID: "events_FailedInsertQuery", Name: "failed", Algo: module.Incremental},
278 + },
279 + }
280 + chartQueriesPreempted = module.Chart{
281 + ID: "queries_preempted",
282 + Title: "Queries waiting due to priority",
283 + Units: "queries",
284 + Fam: "queries",
285 + Ctx: "clickhouse.queries_preempted",
286 + Priority: prioQueriesPreempted,
287 + Dims: module.Dims{
288 + {ID: "metrics_QueryPreempted", Name: "preempted"},
289 + },
290 + }
291 + chartQueriesMemoryLimitExceeded = module.Chart{
292 + ID: "queries_memory_limit_exceeded",
293 + Title: "Memory limit exceeded for query",
294 + Units: "queries/s",
295 + Fam: "queries",
296 + Ctx: "clickhouse.queries_memory_limit_exceeded",
297 + Priority: prioQueriesMemoryLimitExceeded,
298 + Dims: module.Dims{
299 + {ID: "events_QueryMemoryLimitExceeded", Name: "mem_limit_exceeded"},
300 + },
301 + }
302 +)
303 +
304 +var (
305 + chartQueriesLatency = module.Chart{
306 + ID: "queries_latency",
307 + Title: "Queries latency",
308 + Units: "microseconds",
309 + Fam: "query latency",
310 + Ctx: "clickhouse.queries_latency",
311 + Priority: prioQueriesLatency,
312 + Dims: module.Dims{
313 + {ID: "events_QueryTimeMicroseconds", Name: "queries_time", Algo: module.Incremental},
314 + },
315 + }
316 + chartSelectQueriesLatency = module.Chart{
317 + ID: "select_queries_latency",
318 + Title: "Select queries latency",
319 + Units: "microseconds",
320 + Fam: "query latency",
321 + Ctx: "clickhouse.select_queries_latency",
322 + Priority: prioSelectQueriesLatency,
323 + Dims: module.Dims{
324 + {ID: "events_SelectQueryTimeMicroseconds", Name: "selects_time", Algo: module.Incremental},
325 + },
326 + }
327 + chartInsertQueriesLatency = module.Chart{
328 + ID: "insert_queries_latency",
329 + Title: "Insert queries latency",
330 + Units: "microseconds",
331 + Fam: "query latency",
332 + Ctx: "clickhouse.insert_queries_latency",
333 + Priority: prioInsertQueriesLatency,
334 + Dims: module.Dims{
335 + {ID: "events_InsertQueryTimeMicroseconds", Name: "inserts_time", Algo: module.Incremental},
336 + },
337 + }
338 +)
339 +
340 +var (
341 + chartFileDescriptorIO = module.Chart{
342 + ID: "file_descriptor_io",
343 + Title: "Read and written data",
344 + Units: "bytes/s",
345 + Fam: "io",
346 + Ctx: "clickhouse.io",
347 + Priority: prioIO,
348 + Type: module.Area,
349 + Dims: module.Dims{
350 + {ID: "events_ReadBufferFromFileDescriptorReadBytes", Name: "reads", Algo: module.Incremental},
351 + {ID: "events_WriteBufferFromFileDescriptorWriteBytes", Name: "writes", Mul: -1, Algo: module.Incremental},
352 + },
353 + }
354 + chartFileDescriptorIOPS = module.Chart{
355 + ID: "file_descriptor_iops",
356 + Title: "Read and write operations",
357 + Units: "ops/s",
358 + Fam: "io",
359 + Ctx: "clickhouse.iops",
360 + Priority: prioIOPS,
361 + Dims: module.Dims{
362 + {ID: "events_ReadBufferFromFileDescriptorRead", Name: "reads", Algo: module.Incremental},
363 + {ID: "events_WriteBufferFromFileDescriptorWrite", Name: "writes", Mul: -1, Algo: module.Incremental},
364 + },
365 + }
366 + chartFileDescriptorIOErrors = module.Chart{
367 + ID: "file_descriptor_io_errors",
368 + Title: "Read and write errors",
369 + Units: "errors/s",
370 + Fam: "io",
371 + Ctx: "clickhouse.io_errors",
372 + Priority: prioIOErrors,
373 + Dims: module.Dims{
374 + {ID: "events_ReadBufferFromFileDescriptorReadFailed", Name: "read", Algo: module.Incremental},
375 + {ID: "events_WriteBufferFromFileDescriptorWriteFailed", Name: "write", Algo: module.Incremental},
376 + },
377 + }
378 + chartIOSeeks = module.Chart{
379 + ID: "io_seeks",
380 + Title: "lseek function calls",
381 + Units: "ops/s",
382 + Fam: "io",
383 + Ctx: "clickhouse.io_seeks",
384 + Priority: prioIOSeeks,
385 + Dims: module.Dims{
386 + {ID: "events_Seek", Name: "lseek", Algo: module.Incremental},
387 + },
388 + }
389 + chartIOFileOpens = module.Chart{
390 + ID: "io_file_opens",
391 + Title: "File opens",
392 + Units: "ops/s",
393 + Fam: "io",
394 + Ctx: "clickhouse.io_file_opens",
395 + Priority: prioIOFileOpens,
396 + Dims: module.Dims{
397 + {ID: "events_FileOpen", Name: "file_open", Algo: module.Incremental},
398 + },
399 + }
400 +)
401 +
402 +var tableChartsTmpl = module.Charts{
403 + tableSizeChartTmpl.Copy(),
404 + tablePartsChartTmpl.Copy(),
405 + tableRowsChartTmpl.Copy(),
406 +}
407 +
408 +var (
409 + tableSizeChartTmpl = module.Chart{
410 + ID: "table_%s_database_%s_size",
411 + Title: "Table size",
412 + Units: "bytes",
413 + Fam: "tables",
414 + Ctx: "clickhouse.database_table_size",
415 + Type: module.Area,
416 + Priority: prioDatabaseTableSize,
417 + Dims: module.Dims{
418 + {ID: "table_%s_database_%s_size_bytes", Name: "size"},
419 + },
420 + }
421 + tablePartsChartTmpl = module.Chart{
422 + ID: "table_%s_database_%s_parts",
423 + Title: "Table parts",
424 + Units: "parts",
425 + Fam: "tables",
426 + Ctx: "clickhouse.database_table_parts",
427 + Priority: prioDatabaseTableParts,
428 + Dims: module.Dims{
429 + {ID: "table_%s_database_%s_parts", Name: "parts"},
430 + },
431 + }
432 + tableRowsChartTmpl = module.Chart{
433 + ID: "table_%s_database_%s_rows",
434 + Title: "Table rows",
435 + Units: "rows",
436 + Fam: "tables",
437 + Ctx: "clickhouse.database_table_rows",
438 + Priority: prioDatabaseTableRows,
439 + Dims: module.Dims{
440 + {ID: "table_%s_database_%s_rows", Name: "rows"},
441 + },
442 + }
443 +)
444 +
445 +var (
446 + chartReplicatedPartsActivity = module.Chart{
447 + ID: "replicated_parts_activity",
448 + Title: "Replicated parts current activity",
449 + Units: "parts",
450 + Fam: "replicas",
451 + Ctx: "clickhouse.replicated_parts_current_activity",
452 + Priority: prioReplicatedPartsCurrentActivity,
453 + Dims: module.Dims{
454 + {ID: "metrics_ReplicatedFetch", Name: "fetch"},
455 + {ID: "metrics_ReplicatedSend", Name: "send"},
456 + {ID: "metrics_ReplicatedChecks", Name: "check"},
457 + },
458 + }
459 + chartReadonlyReplica = module.Chart{
460 + ID: "readonly_replica",
461 + Title: "Replicated tables in readonly state",
462 + Units: "tables",
463 + Fam: "replicas",
464 + Ctx: "clickhouse.replicated_readonly_tables",
465 + Priority: prioReadOnlyReplica,
466 + Dims: module.Dims{
467 + {ID: "metrics_ReadonlyReplica", Name: "read_only"},
468 + },
469 + }
470 + chartReplicatedDataLoss = module.Chart{
471 + ID: "replicated_data_loss",
472 + Title: "Replicated data loss",
473 + Units: "events/s",
474 + Fam: "replicas",
475 + Ctx: "clickhouse.replicated_data_loss",
476 + Priority: prioReplicatedDataLoss,
477 + Dims: module.Dims{
478 + {ID: "events_ReplicatedDataLoss", Name: "data_loss", Algo: module.Incremental},
479 + },
480 + }
481 + chartReplicatedPartFetches = module.Chart{
482 + ID: "replicated_part_fetches",
483 + Title: "Replicated part fetches",
484 + Units: "fetches/s",
485 + Fam: "replicas",
486 + Ctx: "clickhouse.replicated_part_fetches",
487 + Priority: prioReplicatedPartFetches,
488 + Dims: module.Dims{
489 + {ID: "events_ReplicatedPartFetches", Name: "successful", Algo: module.Incremental},
490 + {ID: "events_ReplicatedPartFailedFetches", Name: "failed", Algo: module.Incremental},
491 + },
492 + }
493 + chartReplicatedPartFetchesOfMerged = module.Chart{
494 + ID: "replicated_part_fetches_of_merged",
495 + Title: "Replicated part fetches of merged",
496 + Units: "fetches/s",
497 + Fam: "replicas",
498 + Ctx: "clickhouse.replicated_part_fetches_of_merged",
499 + Priority: prioReplicatedPartFetchesOfMerged,
500 + Dims: module.Dims{
501 + {ID: "events_ReplicatedPartFetchesOfMerged", Name: "merged", Algo: module.Incremental},
502 + },
503 + }
504 + chartReplicatedPartMerges = module.Chart{
505 + ID: "replicated_part_merges",
506 + Title: "Replicated part merges",
507 + Units: "merges/s",
508 + Fam: "replicas",
509 + Ctx: "clickhouse.replicated_part_merges",
510 + Priority: prioReplicatedPartMerges,
511 + Dims: module.Dims{
512 + {ID: "events_ReplicatedPartMerges", Name: "merges", Algo: module.Incremental},
513 + },
514 + }
515 +)
516 +
517 +var (
518 + chartInsertedBytes = module.Chart{
519 + ID: "inserted_bytes",
520 + Title: "Inserted data",
521 + Units: "bytes/s",
522 + Fam: "inserts",
523 + Ctx: "clickhouse.inserted_bytes",
524 + Priority: prioInsertedBytes,
525 + Type: module.Area,
526 + Dims: module.Dims{
527 + {ID: "events_InsertedBytes", Name: "inserted", Algo: module.Incremental},
528 + },
529 + }
530 + chartInsertedRows = module.Chart{
531 + ID: "inserted_rows",
532 + Title: "Inserted rows",
533 + Units: "rows/s",
534 + Fam: "inserts",
535 + Ctx: "clickhouse.inserted_rows",
536 + Priority: prioInsertedRows,
537 + Dims: module.Dims{
538 + {ID: "events_InsertedRows", Name: "inserted", Algo: module.Incremental},
539 + },
540 + }
541 + chartRejectedInserts = module.Chart{
542 + ID: "rejected_inserts",
543 + Title: "Rejected inserts",
544 + Units: "inserts/s",
545 + Fam: "inserts",
546 + Ctx: "clickhouse.rejected_inserts",
547 + Priority: prioRejectedInserts,
548 + Dims: module.Dims{
549 + {ID: "events_RejectedInserts", Name: "rejected", Algo: module.Incremental},
550 + },
551 + }
552 + chartDelayedInserts = module.Chart{
553 + ID: "delayed_inserts",
554 + Title: "Delayed inserts",
555 + Units: "inserts/s",
556 + Fam: "inserts",
557 + Ctx: "clickhouse.delayed_inserts",
558 + Priority: prioDelayedInserts,
559 + Dims: module.Dims{
560 + {ID: "events_DelayedInserts", Name: "delayed", Algo: module.Incremental},
561 + },
562 + }
563 + chartDelayedInsertsThrottleTime = module.Chart{
564 + ID: "delayed_inserts_throttle_time",
565 + Title: "Delayed inserts throttle time",
566 + Units: "milliseconds",
567 + Fam: "inserts",
568 + Ctx: "clickhouse.delayed_inserts_throttle_time",
569 + Priority: prioDelayedInsertsThrottleTime,
570 + Dims: module.Dims{
571 + {ID: "events_DelayedInsertsMilliseconds", Name: "delayed_inserts_throttle_time", Algo: module.Incremental},
572 + },
573 + }
574 +)
575 +
576 +var (
577 + chartSelectedBytes = module.Chart{
578 + ID: "selected_bytes",
579 + Title: "Selected data",
580 + Units: "bytes/s",
581 + Fam: "selects",
582 + Ctx: "clickhouse.selected_bytes",
583 + Priority: prioSelectedBytes,
584 + Type: module.Area,
585 + Dims: module.Dims{
586 + {ID: "events_SelectedBytes", Name: "selected", Algo: module.Incremental},
587 + },
588 + }
589 + chartSelectedRows = module.Chart{
590 + ID: "selected_rows",
591 + Title: "Selected rows",
592 + Units: "rows/s",
593 + Fam: "selects",
594 + Ctx: "clickhouse.selected_rows",
595 + Priority: prioSelectedRows,
596 + Dims: module.Dims{
597 + {ID: "events_SelectedRows", Name: "selected", Algo: module.Incremental},
598 + },
599 + }
600 + chartSelectedParts = module.Chart{
601 + ID: "selected_parts",
602 + Title: "Selected parts",
603 + Units: "parts/s",
604 + Fam: "selects",
605 + Ctx: "clickhouse.selected_parts",
606 + Priority: prioSelectedParts,
607 + Dims: module.Dims{
608 + {ID: "events_SelectedParts", Name: "selected", Algo: module.Incremental},
609 + },
610 + }
611 + chartSelectedRanges = module.Chart{
612 + ID: "selected_ranges",
613 + Title: "Selected ranges",
614 + Units: "ranges/s",
615 + Fam: "selects",
616 + Ctx: "clickhouse.selected_ranges",
617 + Priority: prioSelectedRanges,
618 + Dims: module.Dims{
619 + {ID: "events_SelectedRanges", Name: "selected", Algo: module.Incremental},
620 + },
621 + }
622 + chartSelectedMarks = module.Chart{
623 + ID: "selected_marks",
624 + Title: "Selected marks",
625 + Units: "marks/s",
626 + Fam: "selects",
627 + Ctx: "clickhouse.selected_marks",
628 + Priority: prioSelectedMarks,
629 + Dims: module.Dims{
630 + {ID: "events_SelectedMarks", Name: "selected", Algo: module.Incremental},
631 + },
632 + }
633 +)
634 +
635 +var (
636 + chartMerges = module.Chart{
637 + ID: "merges",
638 + Title: "Merge operations",
639 + Units: "ops/s",
640 + Fam: "merges",
641 + Ctx: "clickhouse.merges",
642 + Priority: prioMerges,
643 + Dims: module.Dims{
644 + {ID: "events_Merge", Name: "merge", Algo: module.Incremental},
645 + },
646 + }
647 + chartMergesLatency = module.Chart{
648 + ID: "merges_latency",
649 + Title: "Time spent for background merges",
650 + Units: "milliseconds",
651 + Fam: "merges",
652 + Ctx: "clickhouse.merges_latency",
653 + Priority: prioMergesLatency,
654 + Dims: module.Dims{
655 + {ID: "events_MergesTimeMilliseconds", Name: "merges_time", Algo: module.Incremental},
656 + },
657 + }
658 + chartMergedUncompressedBytes = module.Chart{
659 + ID: "merged_uncompressed_bytes",
660 + Title: "Uncompressed data read for background merges",
661 + Units: "bytes/s",
662 + Fam: "merges",
663 + Ctx: "clickhouse.merged_uncompressed_bytes",
664 + Priority: prioMergedUncompressedBytes,
665 + Type: module.Area,
666 + Dims: module.Dims{
667 + {ID: "events_MergedUncompressedBytes", Name: "merged_uncompressed", Algo: module.Incremental},
668 + },
669 + }
670 + chartMergedRows = module.Chart{
671 + ID: "merged_rows",
672 + Title: "Merged rows",
673 + Units: "rows/s",
674 + Fam: "merges",
675 + Ctx: "clickhouse.merged_rows",
676 + Priority: prioMergedRows,
677 + Dims: module.Dims{
678 + {ID: "events_MergedRows", Name: "merged", Algo: module.Incremental},
679 + },
680 + }
681 +)
682 +
683 +var (
684 + chartMergeTreeDataWriterInsertedRows = module.Chart{
685 + ID: "merge_tree_data_writer_inserted_rows",
686 + Title: "Rows INSERTed to MergeTree tables",
687 + Units: "rows/s",
688 + Fam: "merge tree",
689 + Ctx: "clickhouse.merge_tree_data_writer_inserted_rows",
690 + Priority: prioMergeTreeDataWriterRows,
691 + Dims: module.Dims{
692 + {ID: "events_MergeTreeDataWriterRows", Name: "inserted", Algo: module.Incremental},
693 + },
694 + }
695 + chartMergeTreeDataWriterUncompressedBytes = module.Chart{
696 + ID: "merge_tree_data_writer_uncompressed_bytes",
697 + Title: "Data INSERTed to MergeTree tables",
698 + Units: "bytes/s",
699 + Fam: "merge tree",
700 + Ctx: "clickhouse.merge_tree_data_writer_uncompressed_bytes",
701 + Type: module.Area,
702 + Priority: prioMergeTreeDataWriterUncompressedBytes,
703 + Dims: module.Dims{
704 + {ID: "events_MergeTreeDataWriterUncompressedBytes", Name: "inserted", Algo: module.Incremental},
705 + },
706 + }
707 + chartMergeTreeDataWriterCompressedBytes = module.Chart{
708 + ID: "merge_tree_data_writer_compressed_bytes",
709 + Title: "Data written to disk for data INSERTed to MergeTree tables",
710 + Units: "bytes/s",
711 + Fam: "merge tree",
712 + Ctx: "clickhouse.merge_tree_data_writer_compressed_bytes",
713 + Type: module.Area,
714 + Priority: prioMergeTreeDataWriterCompressedBytes,
715 + Dims: module.Dims{
716 + {ID: "events_MergeTreeDataWriterCompressedBytes", Name: "written", Algo: module.Incremental},
717 + },
718 + }
719 +)
720 +
721 +var (
722 + chartUncompressedCacheRequests = module.Chart{
723 + ID: "uncompressed_cache_requests",
724 + Title: "Uncompressed cache requests",
725 + Units: "requests/s",
726 + Fam: "cache",
727 + Ctx: "clickhouse.uncompressed_cache_requests",
728 + Priority: prioUncompressedCacheRequests,
729 + Dims: module.Dims{
730 + {ID: "events_UncompressedCacheHits", Name: "hits", Algo: module.Incremental},
731 + {ID: "events_UncompressedCacheMisses", Name: "misses", Algo: module.Incremental},
732 + },
733 + }
734 + chartMarkCacheRequests = module.Chart{
735 + ID: "mark_cache_requests",
736 + Title: "Mark cache requests",
737 + Units: "requests/s",
738 + Fam: "cache",
739 + Ctx: "clickhouse.mark_cache_requests",
740 + Priority: prioMarkCacheRequests,
741 + Dims: module.Dims{
742 + {ID: "events_MarkCacheHits", Name: "hits", Algo: module.Incremental},
743 + {ID: "events_MarkCacheMisses", Name: "misses", Algo: module.Incremental},
744 + },
745 + }
746 +)
747 +
748 +var (
749 + chartPartsCount = module.Chart{
750 + ID: "parts_count",
751 + Title: "Parts",
752 + Units: "parts",
753 + Fam: "parts",
754 + Ctx: "clickhouse.parts_count",
755 + Priority: prioParts,
756 + Dims: module.Dims{
757 + {ID: "metrics_PartsTemporary", Name: "temporary"},
758 + {ID: "metrics_PartsPreActive", Name: "pre_active"},
759 + {ID: "metrics_PartsActive", Name: "active"},
760 + {ID: "metrics_PartsDeleting", Name: "deleting"},
761 + {ID: "metrics_PartsDeleteOnDestroy", Name: "delete_on_destroy"},
762 + {ID: "metrics_PartsOutdated", Name: "outdated"},
763 + {ID: "metrics_PartsWide", Name: "wide"},
764 + {ID: "metrics_PartsCompact", Name: "compact"},
765 + },
766 + }
767 +)
768 +
769 +var (
770 + chartDistributedConnections = module.Chart{
771 + ID: "distributes_connections",
772 + Title: "Active distributed connection",
773 + Units: "connections",
774 + Fam: "distributed conns",
775 + Ctx: "clickhouse.distributed_connections",
776 + Priority: prioDistributedSend,
777 + Dims: module.Dims{
778 + {ID: "metrics_DistributedSend", Name: "active"},
779 + },
780 + }
781 + chartDistributedConnectionAttempts = module.Chart{
782 + ID: "distributes_connections_attempts",
783 + Title: "Distributed connection attempts",
784 + Units: "attempts/s",
785 + Fam: "distributed conns",
786 + Ctx: "clickhouse.distributed_connections_attempts",
787 + Priority: prioDistributedConnectionTries,
788 + Dims: module.Dims{
789 + {ID: "events_DistributedConnectionTries", Name: "connection", Algo: module.Incremental},
790 + },
791 + }
792 + chartDistributedConnectionFailRetries = module.Chart{
793 + ID: "distributes_connections_fail_retries",
794 + Title: "Distributed connection fails with retry",
795 + Units: "fails/s",
796 + Fam: "distributed conns",
797 + Ctx: "clickhouse.distributed_connections_fail_retries",
798 + Priority: prioDistributedConnectionFailTry,
799 + Dims: module.Dims{
800 + {ID: "events_DistributedConnectionFailTry", Name: "connection_retry", Algo: module.Incremental},
801 + },
802 + }
803 + chartDistributedConnectionFailExhaustedRetries = module.Chart{
804 + ID: "distributes_connections_fail_exhausted_retries",
805 + Title: "Distributed connection fails after all retries finished",
806 + Units: "fails/s",
807 + Fam: "distributed conns",
808 + Ctx: "clickhouse.distributed_connections_fail_exhausted_retries",
809 + Priority: prioDistributedConnectionFailAtAll,
810 + Dims: module.Dims{
811 + {ID: "events_DistributedConnectionFailAtAll", Name: "connection_retry_exhausted", Algo: module.Incremental},
812 + },
813 + }
814 +)
815 +
816 +var (
817 + chartDistributedFilesToInsert = module.Chart{
818 + ID: "distributes_files_to_insert",
819 + Title: "Pending files to process for asynchronous insertion into Distributed tables",
820 + Units: "files",
821 + Fam: "distributed inserts",
822 + Ctx: "clickhouse.distributed_files_to_insert",
823 + Priority: prioDistributedFilesToInsert,
824 + Dims: module.Dims{
825 + {ID: "metrics_DistributedFilesToInsert", Name: "pending_insertions"},
826 + },
827 + }
828 + chartDistributedRejectedInserts = module.Chart{
829 + ID: "distributes_rejected_inserts",
830 + Title: "Rejected INSERTs to a Distributed table",
831 + Units: "inserts/s",
832 + Fam: "distributed inserts",
833 + Ctx: "clickhouse.distributed_rejected_inserts",
834 + Priority: prioDistributedRejectedInserts,
835 + Dims: module.Dims{
836 + {ID: "events_DistributedRejectedInserts", Name: "rejected", Algo: module.Incremental},
837 + },
838 + }
839 + chartDistributedDelayedInserts = module.Chart{
840 + ID: "distributes_delayed_inserts",
841 + Title: "Delayed INSERTs to a Distributed table",
842 + Units: "inserts/s",
843 + Fam: "distributed inserts",
844 + Ctx: "clickhouse.distributed_delayed_inserts",
845 + Priority: prioDistributedDelayedInserts,
846 + Dims: module.Dims{
847 + {ID: "events_DistributedDelayedInserts", Name: "delayed", Algo: module.Incremental},
848 + },
849 + }
850 + chartDistributedDelayedInsertsLatency = module.Chart{
851 + ID: "distributes_delayed_inserts_latency",
852 + Title: "Time spent while the INSERT of a block to a Distributed table was throttled",
853 + Units: "milliseconds",
854 + Fam: "distributed inserts",
855 + Ctx: "clickhouse.distributed_delayed_inserts_latency",
856 + Priority: prioDistributedDelayedInsertsMilliseconds,
857 + Dims: module.Dims{
858 + {ID: "events_DistributedDelayedInsertsMilliseconds", Name: "delayed_time", Algo: module.Incremental},
859 + },
860 + }
861 + chartDistributedSyncInsertionTimeoutExceeded = module.Chart{
862 + ID: "distributes_sync_insertion_timeout_exceeded",
863 + Title: "Distributed table sync insertions timeouts",
864 + Units: "timeouts/s",
865 + Fam: "distributed inserts",
866 + Ctx: "clickhouse.distributed_sync_insertion_timeout_exceeded",
867 + Priority: prioDistributedSyncInsertionTimeoutExceeded,
868 + Dims: module.Dims{
869 + {ID: "events_DistributedSyncInsertionTimeoutExceeded", Name: "sync_insertion", Algo: module.Incremental},
870 + },
871 + }
872 + chartDistributedAsyncInsertionFailures = module.Chart{
873 + ID: "distributes_async_insertions_failures",
874 + Title: "Distributed table async insertion failures",
875 + Units: "failures/s",
876 + Fam: "distributed inserts",
877 + Ctx: "clickhouse.distributed_async_insertions_failures",
878 + Priority: prioDistributedAsyncInsertionFailures,
879 + Dims: module.Dims{
880 + {ID: "events_DistributedAsyncInsertionFailures", Name: "async_insertions", Algo: module.Incremental},
881 + },
882 + }
883 +)
884 +
885 +var (
886 + chartUptime = module.Chart{
887 + ID: "uptime",
888 + Title: "Uptime",
889 + Units: "seconds",
890 + Fam: "uptime",
891 + Ctx: "clickhouse.uptime",
892 + Priority: prioUptime,
893 + Dims: module.Dims{
894 + {ID: "async_metrics_Uptime", Name: "uptime"},
895 + },
896 + }
897 +)
898 +
899 +func (c *ClickHouse) addDiskCharts(disk *seenDisk) {
900 + charts := diskChartsTmpl.Copy()
901 +
902 + for _, chart := range *charts {
903 + chart.ID = fmt.Sprintf(chart.ID, disk.disk)
904 + chart.Labels = []module.Label{
905 + {Key: "disk_name", Value: disk.disk},
906 + }
907 + for _, dim := range chart.Dims {
908 + dim.ID = fmt.Sprintf(dim.ID, disk.disk)
909 + }
910 + }
911 +
912 + if err := c.Charts().Add(*charts...); err != nil {
913 + c.Warning(err)
914 + }
915 +}
916 +
917 +func (c *ClickHouse) removeDiskCharts(disk *seenDisk) {
918 + px := fmt.Sprintf("disk_%s_", disk.disk)
919 + c.removeCharts(px)
920 +}
921 +
922 +func (c *ClickHouse) addTableCharts(table *seenTable) {
923 + charts := tableChartsTmpl.Copy()
924 +
925 + for _, chart := range *charts {
926 + chart.ID = fmt.Sprintf(chart.ID, table.table, table.db)
927 + chart.Labels = []module.Label{
928 + {Key: "database", Value: table.db},
929 + {Key: "table", Value: table.table},
930 + }
931 + for _, dim := range chart.Dims {
932 + dim.ID = fmt.Sprintf(dim.ID, table.table, table.db)
933 + }
934 + }
935 +
936 + if err := c.Charts().Add(*charts...); err != nil {
937 + c.Warning(err)
938 + }
939 +}
940 +
941 +func (c *ClickHouse) removeTableCharts(table *seenTable) {
942 + px := fmt.Sprintf("table_%s_database_%s_", table.table, table.db)
943 + c.removeCharts(px)
944 +}
945 +
946 +func (c *ClickHouse) removeCharts(prefix string) {
947 + for _, chart := range *c.Charts() {
948 + if strings.HasPrefix(chart.ID, prefix) {
949 + chart.MarkRemove()
950 + chart.MarkNotCreated()
951 + }
952 + }
953 +}
src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse.go new
+123
@@ -0,0 +1,123 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + _ "embed"
7 + "errors"
8 + "net/http"
9 + "time"
10 +
11 + "github.com/netdata/netdata/go/go.d.plugin/agent/module"
12 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
13 +)
14 +
15 +//go:embed "config_schema.json"
16 +var configSchema string
17 +
18 +func init() {
19 + module.Register("clickhouse", module.Creator{
20 + Create: func() module.Module { return New() },
21 + Config: func() any { return &Config{} },
22 + JobConfigSchema: configSchema,
23 + })
24 +}
25 +
26 +func New() *ClickHouse {
27 + return &ClickHouse{
28 + Config: Config{
29 + HTTP: web.HTTP{
30 + Request: web.Request{
31 + URL: "http://127.0.0.1:8123",
32 + },
33 + Client: web.Client{
34 + Timeout: web.Duration(time.Second),
35 + },
36 + },
37 + },
38 + charts: chCharts.Copy(),
39 + seenDisks: make(map[string]*seenDisk),
40 + seenDbTables: make(map[string]*seenTable),
41 + }
42 +}
43 +
44 +type Config struct {
45 + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"`
46 + web.HTTP `yaml:",inline" json:""`
47 +}
48 +
49 +type (
50 + ClickHouse struct {
51 + module.Base
52 + Config `yaml:",inline" json:""`
53 +
54 + charts *module.Charts
55 +
56 + httpClient *http.Client
57 +
58 + seenDisks map[string]*seenDisk
59 + seenDbTables map[string]*seenTable
60 + }
61 + seenDisk struct{ disk string }
62 + seenTable struct{ db, table string }
63 +)
64 +
65 +func (c *ClickHouse) Configuration() any {
66 + return c.Config
67 +}
68 +
69 +func (c *ClickHouse) Init() error {
70 + if err := c.validateConfig(); err != nil {
71 + c.Errorf("config validation: %v", err)
72 + return err
73 + }
74 +
75 + httpClient, err := c.initHTTPClient()
76 + if err != nil {
77 + c.Errorf("init HTTP client: %v", err)
78 + return err
79 + }
80 + c.httpClient = httpClient
81 +
82 + c.Debugf("using URL %s", c.URL)
83 + c.Debugf("using timeout: %s", c.Timeout)
84 +
85 + return nil
86 +}
87 +
88 +func (c *ClickHouse) Check() error {
89 + mx, err := c.collect()
90 + if err != nil {
91 + c.Error(err)
92 + return err
93 + }
94 +
95 + if len(mx) == 0 {
96 + return errors.New("no metrics collected")
97 + }
98 +
99 + return nil
100 +}
101 +
102 +func (c *ClickHouse) Charts() *module.Charts {
103 + return c.charts
104 +}
105 +
106 +func (c *ClickHouse) Collect() map[string]int64 {
107 + mx, err := c.collect()
108 + if err != nil {
109 + c.Error(err)
110 + }
111 +
112 + if len(mx) == 0 {
113 + return nil
114 + }
115 +
116 + return mx
117 +}
118 +
119 +func (c *ClickHouse) Cleanup() {
120 + if c.httpClient != nil {
121 + c.httpClient.CloseIdleConnections()
122 + }
123 +}
src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse_test.go new
+307
@@ -0,0 +1,307 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "net/http"
7 + "net/http/httptest"
8 + "os"
9 + "testing"
10 +
11 + "github.com/netdata/netdata/go/go.d.plugin/agent/module"
12 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
13 +
14 + "github.com/stretchr/testify/assert"
15 + "github.com/stretchr/testify/require"
16 +)
17 +
18 +var (
19 + dataConfigJSON, _ = os.ReadFile("testdata/config.json")
20 + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml")
21 +
22 + dataRespSystemAsyncMetrics, _ = os.ReadFile("testdata/resp_system_async_metrics.csv")
23 + dataRespSystemMetrics, _ = os.ReadFile("testdata/resp_system_metrics.csv")
24 + dataRespSystemEvents, _ = os.ReadFile("testdata/resp_system_events.csv")
25 + dataRespSystemParts, _ = os.ReadFile("testdata/resp_system_parts.csv")
26 + dataRespSystemDisks, _ = os.ReadFile("testdata/resp_system_disks.csv")
27 +)
28 +
29 +func Test_testDataIsValid(t *testing.T) {
30 + for name, data := range map[string][]byte{
31 + "dataConfigJSON": dataConfigJSON,
32 + "dataConfigYAML": dataConfigYAML,
33 + "dataRespSystemAsyncMetrics": dataRespSystemAsyncMetrics,
34 + "dataRespSystemMetrics": dataRespSystemMetrics,
35 + "dataRespSystemEvents": dataRespSystemEvents,
36 + "dataRespSystemParts": dataRespSystemParts,
37 + "dataRespSystemDisks": dataRespSystemDisks,
38 + } {
39 + require.NotNil(t, data, name)
40 + }
41 +}
42 +
43 +func TestClickhouse_ConfigurationSerialize(t *testing.T) {
44 + module.TestConfigurationSerialize(t, &ClickHouse{}, dataConfigJSON, dataConfigYAML)
45 +}
46 +
47 +func TestClickHouse_Init(t *testing.T) {
48 + tests := map[string]struct {
49 + wantFail bool
50 + config Config
51 + }{
52 + "success with default": {
53 + wantFail: false,
54 + config: New().Config,
55 + },
56 + "fail when URL not set": {
57 + wantFail: true,
58 + config: Config{
59 + HTTP: web.HTTP{
60 + Request: web.Request{URL: ""},
61 + },
62 + },
63 + },
64 + }
65 +
66 + for name, test := range tests {
67 + t.Run(name, func(t *testing.T) {
68 + click := New()
69 + click.Config = test.config
70 +
71 + if test.wantFail {
72 + assert.Error(t, click.Init())
73 + } else {
74 + assert.NoError(t, click.Init())
75 + }
76 + })
77 + }
78 +}
79 +
80 +func TestClickHouse_Charts(t *testing.T) {
81 + assert.NotNil(t, New().Charts())
82 +}
83 +
84 +func TestClickHouse_Check(t *testing.T) {
85 + tests := map[string]struct {
86 + wantFail bool
87 + prepare func(t *testing.T) (*ClickHouse, func())
88 + }{
89 + "success on valid response": {
90 + wantFail: false,
91 + prepare: prepareCaseOk,
92 + },
93 + "fails on unexpected response": {
94 + wantFail: true,
95 + prepare: prepareCaseUnexpectedResponse,
96 + },
97 + "fails on connection refused": {
98 + wantFail: true,
99 + prepare: prepareCaseConnectionRefused,
100 + },
101 + }
102 +
103 + for name, test := range tests {
104 + t.Run(name, func(t *testing.T) {
105 + click, cleanup := test.prepare(t)
106 + defer cleanup()
107 +
108 + if test.wantFail {
109 + assert.Error(t, click.Check())
110 + } else {
111 + assert.NoError(t, click.Check())
112 + }
113 + })
114 + }
115 +}
116 +
117 +func TestClickHouse_Collect(t *testing.T) {
118 + tests := map[string]struct {
119 + prepare func(t *testing.T) (*ClickHouse, func())
120 + wantMetrics map[string]int64
121 + }{
122 + "success on valid response": {
123 + prepare: prepareCaseOk,
124 + wantMetrics: map[string]int64{
125 + "async_metrics_Uptime": 64380,
126 + "disk_default_free_space_bytes": 165494767616,
127 + "disk_default_used_space_bytes": 45184565248,
128 + "events_DelayedInserts": 0,
129 + "events_DelayedInsertsMilliseconds": 0,
130 + "events_DistributedAsyncInsertionFailures": 0,
131 + "events_DistributedConnectionFailAtAll": 0,
132 + "events_DistributedConnectionFailTry": 0,
133 + "events_DistributedConnectionTries": 0,
134 + "events_DistributedDelayedInserts": 0,
135 + "events_DistributedDelayedInsertsMilliseconds": 0,
136 + "events_DistributedRejectedInserts": 0,
137 + "events_DistributedSyncInsertionTimeoutExceeded": 0,
138 + "events_FailedInsertQuery": 0,
139 + "events_FailedQuery": 0,
140 + "events_FailedSelectQuery": 0,
141 + "events_FileOpen": 1568962,
142 + "events_InsertQuery": 0,
143 + "events_InsertQueryTimeMicroseconds": 0,
144 + "events_InsertedBytes": 0,
145 + "events_InsertedRows": 0,
146 + "events_MarkCacheHits": 0,
147 + "events_MarkCacheMisses": 0,
148 + "events_Merge": 0,
149 + "events_MergeTreeDataWriterCompressedBytes": 0,
150 + "events_MergeTreeDataWriterRows": 0,
151 + "events_MergeTreeDataWriterUncompressedBytes": 0,
152 + "events_MergedRows": 0,
153 + "events_MergedUncompressedBytes": 0,
154 + "events_MergesTimeMilliseconds": 0,
155 + "events_Query": 0,
156 + "events_QueryMemoryLimitExceeded": 0,
157 + "events_QueryPreempted": 0,
158 + "events_QueryTimeMicroseconds": 0,
159 + "events_ReadBackoff": 0,
160 + "events_ReadBufferFromFileDescriptorRead": 0,
161 + "events_ReadBufferFromFileDescriptorReadBytes": 0,
162 + "events_ReadBufferFromFileDescriptorReadFailed": 0,
163 + "events_RejectedInserts": 0,
164 + "events_ReplicatedDataLoss": 0,
165 + "events_ReplicatedPartFailedFetches": 0,
166 + "events_ReplicatedPartFetches": 0,
167 + "events_ReplicatedPartFetchesOfMerged": 0,
168 + "events_ReplicatedPartMerges": 0,
169 + "events_Seek": 0,
170 + "events_SelectQuery": 0,
171 + "events_SelectQueryTimeMicroseconds": 0,
172 + "events_SelectedBytes": 0,
173 + "events_SelectedMarks": 0,
174 + "events_SelectedParts": 0,
175 + "events_SelectedRanges": 0,
176 + "events_SelectedRows": 0,
177 + "events_SlowRead": 0,
178 + "events_SuccessfulInsertQuery": 0,
179 + "events_SuccessfulQuery": 0,
180 + "events_SuccessfulSelectQuery": 0,
181 + "events_UncompressedCacheHits": 0,
182 + "events_UncompressedCacheMisses": 0,
183 + "events_WriteBufferFromFileDescriptorWrite": 0,
184 + "events_WriteBufferFromFileDescriptorWriteBytes": 0,
185 + "events_WriteBufferFromFileDescriptorWriteFailed": 0,
186 + "metrics_DistributedFilesToInsert": 0,
187 + "metrics_DistributedSend": 0,
188 + "metrics_HTTPConnection": 0,
189 + "metrics_InterserverConnection": 0,
190 + "metrics_MemoryTracking": 1270999152,
191 + "metrics_MySQLConnection": 0,
192 + "metrics_PartsActive": 25,
193 + "metrics_PartsCompact": 233,
194 + "metrics_PartsDeleteOnDestroy": 0,
195 + "metrics_PartsDeleting": 0,
196 + "metrics_PartsOutdated": 284,
197 + "metrics_PartsPreActive": 0,
198 + "metrics_PartsTemporary": 0,
199 + "metrics_PartsWide": 76,
200 + "metrics_PostgreSQLConnection": 0,
201 + "metrics_QueryPreempted": 0,
202 + "metrics_ReadonlyReplica": 0,
203 + "metrics_ReplicatedChecks": 0,
204 + "metrics_ReplicatedFetch": 0,
205 + "metrics_ReplicatedSend": 0,
206 + "metrics_TCPConnection": 1,
207 + "table_asynchronous_metric_log_database_system_parts": 6,
208 + "table_asynchronous_metric_log_database_system_rows": 70377261,
209 + "table_asynchronous_metric_log_database_system_size_bytes": 19113663,
210 + "table_metric_log_database_system_parts": 6,
211 + "table_metric_log_database_system_rows": 162718,
212 + "table_metric_log_database_system_size_bytes": 18302533,
213 + "table_processors_profile_log_database_system_parts": 5,
214 + "table_processors_profile_log_database_system_rows": 20107,
215 + "table_processors_profile_log_database_system_size_bytes": 391629,
216 + "table_query_log_database_system_parts": 5,
217 + "table_query_log_database_system_rows": 761,
218 + "table_query_log_database_system_size_bytes": 196403,
219 + "table_trace_log_database_system_parts": 8,
220 + "table_trace_log_database_system_rows": 1733076,
221 + "table_trace_log_database_system_size_bytes": 28695023,
222 + },
223 + },
224 + "fails on unexpected response": {
225 + prepare: prepareCaseUnexpectedResponse,
226 + },
227 + "fails on connection refused": {
228 + prepare: prepareCaseConnectionRefused,
229 + },
230 + }
231 +
232 + for name, test := range tests {
233 + t.Run(name, func(t *testing.T) {
234 + click, cleanup := test.prepare(t)
235 + defer cleanup()
236 +
237 + mx := click.Collect()
238 +
239 + require.Equal(t, test.wantMetrics, mx)
240 + if len(test.wantMetrics) > 0 {
241 + testMetricsHasAllChartsDims(t, click, mx)
242 + }
243 + })
244 + }
245 +}
246 +
247 +func testMetricsHasAllChartsDims(t *testing.T, click *ClickHouse, mx map[string]int64) {
248 + for _, chart := range *click.Charts() {
249 + if chart.Obsolete {
250 + continue
251 + }
252 + for _, dim := range chart.Dims {
253 + _, ok := mx[dim.ID]
254 + assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID)
255 + }
256 + }
257 +}
258 +
259 +func prepareCaseOk(t *testing.T) (*ClickHouse, func()) {
260 + t.Helper()
261 + srv := httptest.NewServer(http.HandlerFunc(
262 + func(w http.ResponseWriter, r *http.Request) {
263 + switch r.URL.Query().Get("query") {
264 + case querySystemEvents:
265 + _, _ = w.Write(dataRespSystemEvents)
266 + case querySystemMetrics:
267 + _, _ = w.Write(dataRespSystemMetrics)
268 + case querySystemAsyncMetrics:
269 + _, _ = w.Write(dataRespSystemAsyncMetrics)
270 + case querySystemParts:
271 + _, _ = w.Write(dataRespSystemParts)
272 + case querySystemDisks:
273 + _, _ = w.Write(dataRespSystemDisks)
274 + default:
275 + w.WriteHeader(http.StatusNotFound)
276 + }
277 + }))
278 +
279 + click := New()
280 + click.URL = srv.URL
281 + require.NoError(t, click.Init())
282 +
283 + return click, srv.Close
284 +}
285 +
286 +func prepareCaseUnexpectedResponse(t *testing.T) (*ClickHouse, func()) {
287 + t.Helper()
288 + srv := httptest.NewServer(http.HandlerFunc(
289 + func(w http.ResponseWriter, r *http.Request) {
290 + _, _ = w.Write([]byte("hello and\n goodbye"))
291 + }))
292 +
293 + click := New()
294 + click.URL = srv.URL
295 + require.NoError(t, click.Init())
296 +
297 + return click, srv.Close
298 +}
299 +
300 +func prepareCaseConnectionRefused(t *testing.T) (*ClickHouse, func()) {
301 + t.Helper()
302 + click := New()
303 + click.URL = "http://127.0.0.1:65001/stat"
304 + require.NoError(t, click.Init())
305 +
306 + return click, func() {}
307 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect.go new
+91
@@ -0,0 +1,91 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "encoding/csv"
7 + "fmt"
8 + "io"
9 + "net/http"
10 + "net/url"
11 + "slices"
12 +)
13 +
14 +func (c *ClickHouse) collect() (map[string]int64, error) {
15 + mx := make(map[string]int64)
16 +
17 + if err := c.collectSystemEvents(mx); err != nil {
18 + return nil, err
19 + }
20 + if err := c.collectSystemMetrics(mx); err != nil {
21 + return nil, err
22 + }
23 + if err := c.collectSystemAsyncMetrics(mx); err != nil {
24 + return nil, err
25 + }
26 + if err := c.collectSystemParts(mx); err != nil {
27 + return nil, err
28 + }
29 + if err := c.collectSystemDisks(mx); err != nil {
30 + return nil, err
31 + }
32 +
33 + return mx, nil
34 +}
35 +
36 +func (c *ClickHouse) doOKDecodeCSV(req *http.Request, assign func(column, value string, lineEnd bool)) error {
37 + resp, err := c.httpClient.Do(req)
38 + if err != nil {
39 + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err)
40 + }
41 + defer closeBody(resp)
42 +
43 + if resp.StatusCode != http.StatusOK {
44 + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode)
45 + }
46 +
47 + return readCSVResponseData(resp.Body, assign)
48 +}
49 +
50 +func readCSVResponseData(reader io.Reader, assign func(column, value string, lineEnd bool)) error {
51 + r := csv.NewReader(reader)
52 + r.ReuseRecord = true
53 +
54 + var columns []string
55 +
56 + for {
57 + record, err := r.Read()
58 + if err != nil {
59 + if err == io.EOF {
60 + break
61 + }
62 + return err
63 + }
64 +
65 + if len(columns) == 0 {
66 + columns = slices.Clone(record)
67 + continue
68 + }
69 +
70 + if len(columns) != len(record) {
71 + return fmt.Errorf("column count mismatch: %d vs %d", len(columns), len(record))
72 + }
73 +
74 + for i, l := 0, len(record); i < l; i++ {
75 + assign(columns[i], record[i], i == l-1)
76 + }
77 + }
78 +
79 + return nil
80 +}
81 +
82 +func makeURLQuery(q string) string {
83 + return url.Values{"query": {q}}.Encode()
84 +}
85 +
86 +func closeBody(resp *http.Response) {
87 + if resp != nil && resp.Body != nil {
88 + _, _ = io.Copy(io.Discard, resp.Body)
89 + _ = resp.Body.Close()
90 + }
91 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_async_metrics.go new
+54
@@ -0,0 +1,54 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "errors"
7 + "strconv"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
10 +)
11 +
12 +const querySystemAsyncMetrics = `
13 +SELECT
14 + metric,
15 + value
16 +FROM
17 + system.asynchronous_metrics where metric like 'Uptime' FORMAT CSVWithNames
18 +`
19 +
20 +func (c *ClickHouse) collectSystemAsyncMetrics(mx map[string]int64) error {
21 + req, _ := web.NewHTTPRequest(c.Request)
22 + req.URL.RawQuery = makeURLQuery(querySystemAsyncMetrics)
23 +
24 + want := map[string]bool{
25 + "Uptime": true,
26 + }
27 +
28 + px := "async_metrics_"
29 + var metric string
30 + var n int
31 +
32 + err := c.doOKDecodeCSV(req, func(column, value string, lineEnd bool) {
33 + switch column {
34 + case "metric":
35 + metric = value
36 + case "value":
37 + if !want[metric] {
38 + return
39 + }
40 + n++
41 + if v, err := strconv.ParseFloat(value, 64); err == nil {
42 + mx[px+metric] = int64(v)
43 + }
44 + }
45 + })
46 + if err != nil {
47 + return err
48 + }
49 + if n == 0 {
50 + return errors.New("no system async metrics data returned")
51 + }
52 +
53 + return nil
54 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_disks.go new
+82
@@ -0,0 +1,82 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "strconv"
7 +
8 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
9 +)
10 +
11 +const querySystemDisks = `
12 +SELECT
13 + name,
14 + sum(free_space) as free_space,
15 + sum(total_space) as total_space
16 +FROM
17 + system.disks
18 +GROUP BY
19 + name FORMAT CSVWithNames
20 +`
21 +
22 +type diskStats struct {
23 + name string
24 + totalBytes int64
25 + freeBytes int64
26 +}
27 +
28 +func (c *ClickHouse) collectSystemDisks(mx map[string]int64) error {
29 + req, _ := web.NewHTTPRequest(c.Request)
30 + req.URL.RawQuery = makeURLQuery(querySystemDisks)
31 +
32 + seen := make(map[string]*diskStats)
33 +
34 + getDisk := func(name string) *diskStats {
35 + s, ok := seen[name]
36 + if !ok {
37 + s = &diskStats{name: name}
38 + seen[name] = s
39 + }
40 + return s
41 + }
42 +
43 + var name string
44 +
45 + err := c.doOKDecodeCSV(req, func(column, value string, lineEnd bool) {
46 + switch column {
47 + case "name":
48 + name = value
49 + case "free_space":
50 + v, _ := strconv.ParseInt(value, 10, 64)
51 + getDisk(name).freeBytes = v
52 + case "total_space":
53 + v, _ := strconv.ParseInt(value, 10, 64)
54 + getDisk(name).totalBytes = v
55 + }
56 + })
57 + if err != nil {
58 + return err
59 + }
60 +
61 + for _, disk := range seen {
62 + if _, ok := c.seenDisks[disk.name]; !ok {
63 + v := &seenDisk{disk: disk.name}
64 + c.seenDisks[disk.name] = v
65 + c.addDiskCharts(v)
66 + }
67 +
68 + px := "disk_" + disk.name + "_"
69 +
70 + mx[px+"free_space_bytes"] = disk.freeBytes
71 + mx[px+"used_space_bytes"] = disk.totalBytes - disk.freeBytes
72 + }
73 +
74 + for k, v := range c.seenDisks {
75 + if _, ok := seen[k]; !ok {
76 + delete(c.seenDisks, k)
77 + c.removeDiskCharts(v)
78 + }
79 + }
80 +
81 + return nil
82 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_events.go new
+120
@@ -0,0 +1,120 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "errors"
7 + "strconv"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
10 +)
11 +
12 +const querySystemEvents = `
13 +SELECT
14 + event,
15 + value
16 +FROM
17 + system.events FORMAT CSVWithNames
18 +`
19 +
20 +func (c *ClickHouse) collectSystemEvents(mx map[string]int64) error {
21 + req, _ := web.NewHTTPRequest(c.Request)
22 + req.URL.RawQuery = makeURLQuery(querySystemEvents)
23 +
24 + px := "events_"
25 + var event string
26 + var n int
27 +
28 + err := c.doOKDecodeCSV(req, func(column, value string, lineEnd bool) {
29 + switch column {
30 + case "event":
31 + event = value
32 + case "value":
33 + if !wantSystemEvents[event] {
34 + return
35 + }
36 + n++
37 + if v, err := strconv.ParseInt(value, 10, 64); err == nil {
38 + mx[px+event] = v
39 + }
40 + }
41 + })
42 + if err != nil {
43 + return err
44 + }
45 + if n == 0 {
46 + return errors.New("no system events data returned")
47 + }
48 +
49 + // CH doesn't expose events with 0 values
50 + for k := range wantSystemEvents {
51 + k = px + k
52 + if _, ok := mx[k]; !ok {
53 + mx[k] = 0
54 + }
55 + }
56 +
57 + mx["events_SuccessfulQuery"] = mx["events_Query"] - mx["events_FailedQuery"]
58 + mx["events_SuccessfulSelectQuery"] = mx["events_SelectQuery"] - mx["events_FailedSelectQuery"]
59 + mx["events_SuccessfulInsertQuery"] = mx["events_InsertQuery"] - mx["events_FailedInsertQuery"]
60 +
61 + return nil
62 +}
63 +
64 +var wantSystemEvents = map[string]bool{
65 + "SlowRead": true,
66 + "ReadBackoff": true,
67 + "Query": true,
68 + "FailedQuery": true,
69 + "QueryTimeMicroseconds": true,
70 + "SelectQuery": true,
71 + "FailedSelectQuery": true,
72 + "SelectQueryTimeMicroseconds": true,
73 + "InsertQuery": true,
74 + "FailedInsertQuery": true,
75 + "InsertQueryTimeMicroseconds": true,
76 + "QueryPreempted": true,
77 + "QueryMemoryLimitExceeded": true,
78 + "InsertedRows": true,
79 + "InsertedBytes": true,
80 + "DelayedInserts": true,
81 + "DelayedInsertsMilliseconds": true,
82 + "RejectedInserts": true,
83 + "SelectedRows": true,
84 + "SelectedBytes": true,
85 + "SelectedParts": true,
86 + "SelectedRanges": true,
87 + "SelectedMarks": true,
88 + "Merge": true,
89 + "MergedRows": true,
90 + "MergedUncompressedBytes": true,
91 + "MergesTimeMilliseconds": true,
92 + "MergeTreeDataWriterRows": true,
93 + "MergeTreeDataWriterUncompressedBytes": true,
94 + "MergeTreeDataWriterCompressedBytes": true,
95 + "UncompressedCacheHits": true,
96 + "UncompressedCacheMisses": true,
97 + "MarkCacheHits": true,
98 + "MarkCacheMisses": true,
99 + "Seek": true,
100 + "FileOpen": true,
101 + "ReadBufferFromFileDescriptorReadBytes": true,
102 + "WriteBufferFromFileDescriptorWriteBytes": true,
103 + "ReadBufferFromFileDescriptorRead": true,
104 + "WriteBufferFromFileDescriptorWrite": true,
105 + "ReadBufferFromFileDescriptorReadFailed": true,
106 + "WriteBufferFromFileDescriptorWriteFailed": true,
107 + "DistributedConnectionTries": true,
108 + "DistributedConnectionFailTry": true,
109 + "DistributedConnectionFailAtAll": true,
110 + "DistributedRejectedInserts": true,
111 + "DistributedDelayedInserts": true,
112 + "DistributedDelayedInsertsMilliseconds": true,
113 + "DistributedSyncInsertionTimeoutExceeded": true,
114 + "DistributedAsyncInsertionFailures": true,
115 + "ReplicatedDataLoss": true,
116 + "ReplicatedPartFetches": true,
117 + "ReplicatedPartFailedFetches": true,
118 + "ReplicatedPartMerges": true,
119 + "ReplicatedPartFetchesOfMerged": true,
120 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_metrics.go new
+74
@@ -0,0 +1,74 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "errors"
7 + "strconv"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
10 +)
11 +
12 +const querySystemMetrics = `
13 +SELECT
14 + metric,
15 + value
16 +FROM
17 + system.metrics FORMAT CSVWithNames
18 +`
19 +
20 +func (c *ClickHouse) collectSystemMetrics(mx map[string]int64) error {
21 + req, _ := web.NewHTTPRequest(c.Request)
22 + req.URL.RawQuery = makeURLQuery(querySystemMetrics)
23 +
24 + px := "metrics_"
25 + var metric string
26 + var n int
27 +
28 + err := c.doOKDecodeCSV(req, func(column, value string, lineEnd bool) {
29 + switch column {
30 + case "metric":
31 + metric = value
32 + case "value":
33 + if !wantSystemMetrics[metric] {
34 + return
35 + }
36 + n++
37 + if v, err := strconv.ParseInt(value, 10, 64); err == nil {
38 + mx[px+metric] = v
39 + }
40 + }
41 + })
42 + if err != nil {
43 + return err
44 + }
45 + if n == 0 {
46 + return errors.New("no system metrics data returned")
47 + }
48 +
49 + return nil
50 +}
51 +
52 +var wantSystemMetrics = map[string]bool{
53 + "TCPConnection": true,
54 + "HTTPConnection": true,
55 + "MySQLConnection": true,
56 + "PostgreSQLConnection": true,
57 + "InterserverConnection": true,
58 + "MemoryTracking": true,
59 + "QueryPreempted": true,
60 + "ReplicatedFetch": true,
61 + "ReplicatedSend": true,
62 + "ReplicatedChecks": true,
63 + "ReadonlyReplica": true,
64 + "PartsTemporary": true,
65 + "PartsPreActive": true,
66 + "PartsActive": true,
67 + "PartsDeleting": true,
68 + "PartsDeleteOnDestroy": true,
69 + "PartsOutdated": true,
70 + "PartsWide": true,
71 + "PartsCompact": true,
72 + "DistributedSend": true,
73 + "DistributedFilesToInsert": true,
74 +}
src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_parts.go new
+98
@@ -0,0 +1,98 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "fmt"
7 + "strconv"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
10 +)
11 +
12 +const querySystemParts = `
13 +SELECT
14 + database,
15 + table,
16 + sum(bytes) as bytes,
17 + count() as parts,
18 + sum(rows) as rows
19 +FROM
20 + system.parts
21 +WHERE
22 + active = 1
23 +GROUP BY
24 + database,
25 + table FORMAT CSVWithNames
26 +`
27 +
28 +type tableStats struct {
29 + database string
30 + table string
31 + bytes int64
32 + parts int64
33 + rows int64
34 +}
35 +
36 +func (c *ClickHouse) collectSystemParts(mx map[string]int64) error {
37 + req, _ := web.NewHTTPRequest(c.Request)
38 + req.URL.RawQuery = makeURLQuery(querySystemParts)
39 +
40 + seen := make(map[string]*tableStats)
41 +
42 + getTable := func(db, table string) *tableStats {
43 + k := table + db
44 + s, ok := seen[k]
45 + if !ok {
46 + s = &tableStats{database: db, table: table}
47 + seen[k] = s
48 + }
49 + return s
50 + }
51 +
52 + var database, table string
53 +
54 + err := c.doOKDecodeCSV(req, func(column, value string, lineEnd bool) {
55 + switch column {
56 + case "database":
57 + database = value
58 + case "table":
59 + table = value
60 + case "bytes":
61 + v, _ := strconv.ParseInt(value, 10, 64)
62 + getTable(database, table).bytes = v
63 + case "parts":
64 + v, _ := strconv.ParseInt(value, 10, 64)
65 + getTable(database, table).parts = v
66 + case "rows":
67 + v, _ := strconv.ParseInt(value, 10, 64)
68 + getTable(database, table).rows = v
69 + }
70 + })
71 + if err != nil {
72 + return err
73 + }
74 +
75 + for _, table := range seen {
76 + k := table.table + table.database
77 + if _, ok := c.seenDbTables[k]; !ok {
78 + v := &seenTable{db: table.database, table: table.table}
79 + c.seenDbTables[k] = v
80 + c.addTableCharts(v)
81 + }
82 +
83 + px := fmt.Sprintf("table_%s_database_%s_", table.table, table.database)
84 +
85 + mx[px+"size_bytes"] = table.bytes
86 + mx[px+"parts"] = table.parts
87 + mx[px+"rows"] = table.rows
88 + }
89 +
90 + for k, v := range c.seenDbTables {
91 + if _, ok := seen[k]; !ok {
92 + delete(c.seenDbTables, k)
93 + c.removeTableCharts(v)
94 + }
95 + }
96 +
97 + return nil
98 +}
src/go/collectors/go.d.plugin/modules/clickhouse/config_schema.json new
+177
@@ -0,0 +1,177 @@
1 +{
2 + "jsonSchema": {
3 + "$schema": "http://json-schema.org/draft-07/schema#",
4 + "title": "ClickHouse collector configuration.",
5 + "type": "object",
6 + "properties": {
7 + "update_every": {
8 + "title": "Update every",
9 + "description": "Data collection interval, measured in seconds.",
10 + "type": "integer",
11 + "minimum": 1,
12 + "default": 1
13 + },
14 + "url": {
15 + "title": "URL",
16 + "description": "The base URL of the ClickHouse server.",
17 + "type": "string",
18 + "default": "http://127.0.0.1:8123",
19 + "format": "uri"
20 + },
21 + "timeout": {
22 + "title": "Timeout",
23 + "description": "The timeout in seconds for the HTTP request.",
24 + "type": "number",
25 + "minimum": 0.5,
26 + "default": 1
27 + },
28 + "not_follow_redirects": {
29 + "title": "Not follow redirects",
30 + "description": "If set, the client will not follow HTTP redirects automatically.",
31 + "type": "boolean"
32 + },
33 + "username": {
34 + "title": "Username",
35 + "description": "The username for basic authentication.",
36 + "type": "string",
37 + "sensitive": true
38 + },
39 + "password": {
40 + "title": "Password",
41 + "description": "The password for basic authentication.",
42 + "type": "string",
43 + "sensitive": true
44 + },
45 + "proxy_url": {
46 + "title": "Proxy URL",
47 + "description": "The URL of the proxy server.",
48 + "type": "string"
49 + },
50 + "proxy_username": {
51 + "title": "Proxy username",
52 + "description": "The username for proxy authentication.",
53 + "type": "string",
54 + "sensitive": true
55 + },
56 + "proxy_password": {
57 + "title": "Proxy password",
58 + "description": "The password for proxy authentication.",
59 + "type": "string",
60 + "sensitive": true
61 + },
62 + "headers": {
63 + "title": "Headers",
64 + "description": "Additional HTTP headers to include in the request.",
65 + "type": [
66 + "object",
67 + "null"
68 + ],
69 + "additionalProperties": {
70 + "type": "string"
71 + }
72 + },
73 + "tls_skip_verify": {
74 + "title": "Skip TLS verification",
75 + "description": "If set, TLS certificate verification will be skipped.",
76 + "type": "boolean"
77 + },
78 + "tls_ca": {
79 + "title": "TLS CA",
80 + "description": "The path to the CA certificate file for TLS verification.",
81 + "type": "string",
82 + "pattern": "^$|^/"
83 + },
84 + "tls_cert": {
85 + "title": "TLS certificate",
86 + "description": "The path to the client certificate file for TLS authentication.",
87 + "type": "string",
88 + "pattern": "^$|^/"
89 + },
90 + "tls_key": {
91 + "title": "TLS key",
92 + "description": "The path to the client key file for TLS authentication.",
93 + "type": "string",
94 + "pattern": "^$|^/"
95 + },
96 + "body": {
97 + "title": "Body",
98 + "type": "string"
99 + },
100 + "method": {
101 + "title": "Method",
102 + "type": "string"
103 + }
104 + },
105 + "required": [
106 + "url"
107 + ],
108 + "additionalProperties": false,
109 + "patternProperties": {
110 + "^name$": {}
111 + }
112 + },
113 + "uiSchema": {
114 + "uiOptions": {
115 + "fullPage": true
116 + },
117 + "body": {
118 + "ui:widget": "hidden"
119 + },
120 + "method": {
121 + "ui:widget": "hidden"
122 + },
123 + "timeout": {
124 + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
125 + },
126 + "password": {
127 + "ui:widget": "password"
128 + },
129 + "proxy_password": {
130 + "ui:widget": "password"
131 + },
132 + "ui:flavour": "tabs",
133 + "ui:options": {
134 + "tabs": [
135 + {
136 + "title": "Base",
137 + "fields": [
138 + "update_every",
139 + "url",
140 + "timeout",
141 + "not_follow_redirects"
142 + ]
143 + },
144 + {
145 + "title": "Auth",
146 + "fields": [
147 + "username",
148 + "password"
149 + ]
150 + },
151 + {
152 + "title": "TLS",
153 + "fields": [
154 + "tls_skip_verify",
155 + "tls_ca",
156 + "tls_cert",
157 + "tls_key"
158 + ]
159 + },
160 + {
161 + "title": "Proxy",
162 + "fields": [
163 + "proxy_url",
164 + "proxy_username",
165 + "proxy_password"
166 + ]
167 + },
168 + {
169 + "title": "Headers",
170 + "fields": [
171 + "headers"
172 + ]
173 + }
174 + ]
175 + }
176 + }
177 +}
src/go/collectors/go.d.plugin/modules/clickhouse/init.go new
+21
@@ -0,0 +1,21 @@
1 +// SPDX-License-Identifier: GPL-3.0-or-later
2 +
3 +package clickhouse
4 +
5 +import (
6 + "errors"
7 + "net/http"
8 +
9 + "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
10 +)
11 +
12 +func (c *ClickHouse) validateConfig() error {
13 + if c.URL == "" {
14 + return errors.New("url not set")
15 + }
16 + return nil
17 +}
18 +
19 +func (c *ClickHouse) initHTTPClient() (*http.Client, error) {
20 + return web.NewHTTPClient(c.Client)
21 +}
src/go/collectors/go.d.plugin/modules/clickhouse/metadata.yaml new
+565
@@ -0,0 +1,565 @@
1 +plugin_name: go.d.plugin
2 +modules:
3 + - meta:
4 + id: collector-go.d.plugin-clickhouse
5 + plugin_name: go.d.plugin
6 + module_name: clickhouse
7 + monitored_instance:
8 + name: ClickHouse
9 + link: https://clickhouse.com/
10 + icon_filename: clickhouse.svg
11 + categories:
12 + - data-collection.database-servers
13 + keywords:
14 + - database
15 + related_resources:
16 + integrations:
17 + list: []
18 + info_provided_to_referring_integrations:
19 + description: ""
20 + most_popular: false
21 + overview:
22 + data_collection:
23 + metrics_description: |
24 + This collector retrieves performance data from ClickHouse for connections, queries, resources, replication, IO, and data operations (inserts, selects, merges) using HTTP requests and ClickHouse system tables. It monitors your ClickHouse server's health and activity.
25 + method_description: |
26 + It sends HTTP requests to the ClickHouse [HTTP interface](https://clickhouse.com/docs/en/interfaces/http), executing SELECT queries to retrieve data from various system tables.
27 + Specifically, it collects metrics from the following tables:
28 +
29 + - system.metrics
30 + - systemd.async_metrics
31 + - system.events
32 + - system.disks
33 + - system.parts
34 + supported_platforms:
35 + include: []
36 + exclude: []
37 + multi_instance: true
38 + additional_permissions:
39 + description: ""
40 + default_behavior:
41 + auto_detection:
42 + description: |
43 + By default, it detects ClickHouse instances running on localhost that are listening on port 8123.
44 + On startup, it tries to collect metrics from:
45 +
46 + - http://127.0.0.1:8123
47 + limits:
48 + description: ""
49 + performance_impact:
50 + description: ""
51 + setup:
52 + prerequisites:
53 + list: []
54 + configuration:
55 + file:
56 + name: go.d/clickhouse.conf
57 + options:
58 + description: |
59 + The following options can be defined globally: update_every, autodetection_retry.
60 + folding:
61 + title: Config options
62 + enabled: true
63 + list:
64 + - name: update_every
65 + description: Data collection frequency.
66 + default_value: 1
67 + required: false
68 + - name: autodetection_retry
69 + description: Recheck interval in seconds. Zero means no recheck will be scheduled.
70 + default_value: 0
71 + required: false
72 + - name: url
73 + description: Server URL.
74 + default_value: http://127.0.0.1:8123
75 + required: true
76 + - name: timeout
77 + description: HTTP request timeout.
78 + default_value: 1
79 + required: false
80 + - name: username
81 + description: Username for basic HTTP authentication.
82 + default_value: ""
83 + required: false
84 + - name: password
85 + description: Password for basic HTTP authentication.
86 + default_value: ""
87 + required: false
88 + - name: proxy_url
89 + description: Proxy URL.
90 + default_value: ""
91 + required: false
92 + - name: proxy_username
93 + description: Username for proxy basic HTTP authentication.
94 + default_value: ""
95 + required: false
96 + - name: proxy_password
97 + description: Password for proxy basic HTTP authentication.
98 + default_value: ""
99 + required: false
100 + - name: method
101 + description: HTTP request method.
102 + default_value: "GET"
103 + required: false
104 + - name: body
105 + description: HTTP request body.
106 + default_value: ""
107 + required: false
108 + - name: headers
109 + description: HTTP request headers.
110 + default_value: ""
111 + required: false
112 + - name: not_follow_redirects
113 + description: Redirect handling policy. Controls whether the client follows redirects.
114 + default_value: no
115 + required: false
116 + - name: tls_skip_verify
117 + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check.
118 + default_value: no
119 + required: false
120 + - name: tls_ca
121 + description: Certification authority that the client uses when verifying the server's certificates.
122 + default_value: ""
123 + required: false
124 + - name: tls_cert
125 + description: Client TLS certificate.
126 + default_value: ""
127 + required: false
128 + - name: tls_key
129 + description: Client TLS key.
130 + default_value: ""
131 + required: false
132 + examples:
133 + folding:
134 + title: Config
135 + enabled: true
136 + list:
137 + - name: Basic
138 + folding:
139 + enabled: false
140 + description: A basic example configuration.
141 + config: |
142 + jobs:
143 + - name: local
144 + url: http://127.0.0.1:8123
145 + - name: HTTP authentication
146 + description: Basic HTTP authentication.
147 + config: |
148 + jobs:
149 + - name: local
150 + url: http://127.0.0.1:8123
151 + username: username
152 + password: password
153 + - name: HTTPS with self-signed certificate
154 + description: ClickHouse with enabled HTTPS and self-signed certificate.
155 + config: |
156 + jobs:
157 + - name: local
158 + url: https://127.0.0.1:8123
159 + tls_skip_verify: yes
160 + - name: Multi-instance
161 + description: |
162 + > **Note**: When you define multiple jobs, their names must be unique.
163 +
164 + Collecting metrics from local and remote instances.
165 + config: |
166 + jobs:
167 + - name: local
168 + url: http://127.0.0.1:8123
169 +
170 + - name: remote
171 + url: http://192.0.2.1:8123
172 + troubleshooting:
173 + problems:
174 + list: []
175 + alerts: []
176 + metrics:
177 + folding:
178 + title: Metrics
179 + enabled: false
180 + description: ""
181 + availability: []
182 + scopes:
183 + - name: global
184 + description: These metrics refer to the entire monitored application.
185 + labels: []
186 + metrics:
187 + - name: clickhouse.connections
188 + description: Connections
189 + unit: connections
190 + chart_type: line
191 + dimensions:
192 + - name: tcp
193 + - name: http
194 + - name: mysql
195 + - name: postgresql
196 + - name: interserver
197 + - name: clickhouse.slow_reads
198 + description: Slow reads from a file
199 + unit: reads/s
200 + chart_type: line
201 + dimensions:
202 + - name: slow
203 + - name: clickhouse.read_backoff
204 + description: Read backoff events
205 + unit: events/s
206 + chart_type: line
207 + dimensions:
208 + - name: read_backoff
209 + - name: clickhouse.memory_usage
210 + description: Memory usage
211 + unit: bytes
212 + chart_type: area
213 + dimensions:
214 + - name: used
215 + - name: clickhouse.queries
216 + description: Queries
217 + unit: queries/s
218 + chart_type: stacked
219 + dimensions:
220 + - name: successful
221 + - name: failed
222 + - name: clickhouse.select_queries
223 + description: Select queries
224 + unit: selects/s
225 + chart_type: stacked
226 + dimensions:
227 + - name: successful
228 + - name: failed
229 + - name: clickhouse.insert_queries
230 + description: Insert queries
231 + unit: inserts/s
232 + chart_type: stacked
233 + dimensions:
234 + - name: successful
235 + - name: failed
236 + - name: clickhouse.queries_preempted
237 + description: Queries waiting due to priority
238 + unit: queries
239 + chart_type: line
240 + dimensions:
241 + - name: preempted
242 + - name: clickhouse.queries_memory_limit_exceeded
243 + description: Memory limit exceeded for query
244 + unit: queries/s
245 + chart_type: line
246 + dimensions:
247 + - name: mem_limit_exceeded
248 + - name: clickhouse.queries_latency
249 + description: Queries latency
250 + unit: microseconds
251 + chart_type: line
252 + dimensions:
253 + - name: queries_time
254 + - name: clickhouse.select_queries_latency
255 + description: Select queries latency
256 + unit: microseconds
257 + chart_type: line
258 + dimensions:
259 + - name: selects_time
260 + - name: clickhouse.insert_queries_latency
261 + description: Insert queries latency
262 + unit: microseconds
263 + chart_type: line
264 + dimensions:
265 + - name: inserts_time
266 + - name: clickhouse.io
267 + description: Read and written data
268 + unit: bytes/s
269 + chart_type: area
270 + dimensions:
271 + - name: reads
272 + - name: writes
273 + - name: clickhouse.iops
274 + description: Read and write operations
275 + unit: ops/s
276 + chart_type: line
277 + dimensions:
278 + - name: reads
279 + - name: writes
280 + - name: clickhouse.io_errors
281 + description: Read and write errors
282 + unit: errors/s
283 + chart_type: line
284 + dimensions:
285 + - name: read
286 + - name: write
287 + - name: clickhouse.io_seeks
288 + description: lseek function calls
289 + unit: ops/s
290 + chart_type: line
291 + dimensions:
292 + - name: lseek
293 + - name: clickhouse.io_file_opens
294 + description: File opens
295 + unit: ops/s
296 + chart_type: line
297 + dimensions:
298 + - name: file_open
299 + - name: clickhouse.replicated_parts_current_activity
300 + description: Replicated parts current activity
301 + unit: parts
302 + chart_type: line
303 + dimensions:
304 + - name: fetch
305 + - name: send
306 + - name: check
307 + - name: clickhouse.replicated_readonly_tables
308 + description: Replicated tables in readonly state
309 + unit: tables
310 + chart_type: line
311 + dimensions:
312 + - name: read_only
313 + - name: clickhouse.replicated_data_loss
314 + description: Replicated data loss
315 + unit: events
316 + chart_type: line
317 + dimensions:
318 + - name: data_loss
319 + - name: clickhouse.replicated_part_fetches
320 + description: Replicated part fetches
321 + unit: fetches/s
322 + chart_type: line
323 + dimensions:
324 + - name: successful
325 + - name: failed
326 + - name: clickhouse.inserted_rows
327 + description: Inserted rows
328 + unit: rows/s
329 + chart_type: line
330 + dimensions:
331 + - name: inserted
332 + - name: clickhouse.inserted_bytes
333 + description: Inserted data
334 + unit: bytes/s
335 + chart_type: area
336 + dimensions:
337 + - name: inserted
338 + - name: clickhouse.rejected_inserts
339 + description: Rejected inserts
340 + unit: inserts/s
341 + chart_type: line
342 + dimensions:
343 + - name: rejected
344 + - name: clickhouse.delayed_inserts
345 + description: Delayed inserts
346 + unit: inserts/s
347 + chart_type: line
348 + dimensions:
349 + - name: delayed
350 + - name: clickhouse.delayed_inserts_throttle_time
351 + description: Delayed inserts throttle time
352 + unit: milliseconds
353 + chart_type: line
354 + dimensions:
355 + - name: delayed_inserts_throttle_time
356 + - name: clickhouse.selected_bytes
357 + description: Selected data
358 + unit: bytes/s
359 + chart_type: area
360 + dimensions:
361 + - name: selected
362 + - name: clickhouse.selected_rows
363 + description: Selected rows
364 + unit: rows/s
365 + chart_type: line
366 + dimensions:
367 + - name: selected
368 + - name: clickhouse.selected_parts
369 + description: Selected parts
370 + unit: parts/s
371 + chart_type: line
372 + dimensions:
373 + - name: selected
374 + - name: clickhouse.selected_ranges
375 + description: Selected ranges
376 + unit: ranges/s
377 + chart_type: line
378 + dimensions:
379 + - name: selected
380 + - name: clickhouse.selected_marks
381 + description: Selected marks
382 + unit: marks/s
383 + chart_type: line
384 + dimensions:
385 + - name: selected
386 + - name: clickhouse.merges
387 + description: Merge operations
388 + unit: ops/s
389 + chart_type: line
390 + dimensions:
391 + - name: merge
392 + - name: clickhouse.merges_latency
393 + description: Time spent for background merges
394 + unit: milliseconds
395 + chart_type: line
396 + dimensions:
397 + - name: merges_time
398 + - name: clickhouse.merged_uncompressed_bytes
399 + description: Uncompressed data read for background merges
400 + unit: bytes/s
401 + chart_type: area
402 + dimensions:
403 + - name: merged_uncompressed
404 + - name: clickhouse.merged_rows
405 + description: Merged rows
406 + unit: rows/s
407 + chart_type: line
408 + dimensions:
409 + - name: merged
410 + - name: clickhouse.merge_tree_data_writer_inserted_rows
411 + description: Rows INSERTed to MergeTree tables
412 + unit: rows/s
413 + chart_type: line
414 + dimensions:
415 + - name: inserted
416 + - name: clickhouse.merge_tree_data_writer_uncompressed_bytes
417 + description: Data INSERTed to MergeTree tables
418 + unit: bytes/s
419 + chart_type: area
420 + dimensions:
421 + - name: inserted
422 + - name: clickhouse.merge_tree_data_writer_compressed_bytes
423 + description: Data written to disk for data INSERTed to MergeTree tables
424 + unit: bytes/s
425 + chart_type: area
426 + dimensions:
427 + - name: written
428 + - name: clickhouse.uncompressed_cache_requests
429 + description: Uncompressed cache requests
430 + unit: requests/s
431 + chart_type: line
432 + dimensions:
433 + - name: hits
434 + - name: misses
435 + - name: clickhouse.mark_cache_requests
436 + description: Mark cache requests
437 + unit: requests/s
438 + chart_type: line
439 + dimensions:
440 + - name: hits
441 + - name: misses
442 + - name: clickhouse.parts_count
443 + description: Parts
444 + unit: parts
445 + chart_type: line
446 + dimensions:
447 + - name: temporary
448 + - name: pre_active
449 + - name: active
450 + - name: deleting
451 + - name: delete_on_destroy
452 + - name: outdated
453 + - name: wide
454 + - name: compact
455 + - name: distributed_connections
456 + description: Active distributed connection
457 + unit: connections
458 + chart_type: line
459 + dimensions:
460 + - name: active
461 + - name: distributed_connections_attempts
462 + description: Distributed connection attempts
463 + unit: attempts/s
464 + chart_type: line
465 + dimensions:
466 + - name: connection
467 + - name: distributed_connections_fail_retries
468 + description: Distributed connection fails with retry
469 + unit: fails/s
470 + chart_type: line
471 + dimensions:
472 + - name: connection_retry
473 + - name: distributed_connections_fail_exhausted_retries
474 + description: Distributed connection fails after all retries finished
475 + unit: fails/s
476 + chart_type: line
477 + dimensions:
478 + - name: connection_retry_exhausted
479 + - name: distributed_files_to_insert
480 + description: Pending files to process for asynchronous insertion into Distributed tables
481 + unit: files
482 + chart_type: line
483 + dimensions:
484 + - name: pending_insertions
485 + - name: distributed_rejected_inserts
486 + description: Rejected INSERTs to a Distributed table
487 + unit: inserts/s
488 + chart_type: line
489 + dimensions:
490 + - name: rejected
491 + - name: distributed_delayed_inserts
492 + description: Delayed INSERTs to a Distributed table
493 + unit: inserts/s
494 + chart_type: line
495 + dimensions:
496 + - name: delayed
497 + - name: distributed_delayed_inserts_latency
498 + description: Time spent while the INSERT of a block to a Distributed table was throttled
499 + unit: milliseconds
500 + chart_type: line
501 + dimensions:
502 + - name: delayed_time
503 + - name: distributed_sync_insertion_timeout_exceeded
504 + description: Distributed table sync insertions timeouts
505 + unit: timeouts/s
506 + chart_type: line
507 + dimensions:
508 + - name: sync_insertion
509 + - name: distributed_async_insertions_failures
510 + description: Distributed table async insertion failures
511 + unit: failures/s
512 + chart_type: line
513 + dimensions:
514 + - name: async_insertions
515 + - name: clickhouse.uptime
516 + description: Uptime
517 + unit: seconds
518 + chart_type: line
519 + dimensions:
520 + - name: uptime
521 + - name: disk
522 + description: These metrics refer to the Disk.
523 + labels:
524 + - name: disk_name
525 + description: Name of the disk as defined in the [server configuration](https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-multiple-volumes_configure).
526 + metrics:
527 + - name: clickhouse.disk_space_usage
528 + description: Disk space usage
529 + unit: bytes
530 + chart_type: stacked
531 + dimensions:
532 + - name: free
533 + - name: used
534 + - name: table
535 + description: These metrics refer to the Database Table.
536 + labels:
537 + - name: database
538 + description: Name of the database.
539 + - name: table
540 + description: Name of the table.
541 + metrics:
542 + - name: clickhouse.database_table_size
543 + description: Table size
544 + unit: bytes
545 + chart_type: area
546 + dimensions:
547 + - name: size
548 + - name: clickhouse.database_table_parts
549 + description: Table parts
550 + unit: parts
551 + chart_type: line
552 + dimensions:
553 + - name: parts
554 + - name: clickhouse.database_table_parts
555 + description: Table parts
556 + unit: parts
557 + chart_type: line
558 + dimensions:
559 + - name: parts
560 + - name: clickhouse.database_table_rows
561 + description: Table rows
562 + unit: rows
563 + chart_type: line
564 + dimensions:
565 + - name: rows
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.json new
+20
@@ -0,0 +1,20 @@
1 +{
2 + "update_every": 123,
3 + "url": "ok",
4 + "body": "ok",
5 + "method": "ok",
6 + "headers": {
7 + "ok": "ok"
8 + },
9 + "username": "ok",
10 + "password": "ok",
11 + "proxy_url": "ok",
12 + "proxy_username": "ok",
13 + "proxy_password": "ok",
14 + "timeout": 123.123,
15 + "not_follow_redirects": true,
16 + "tls_ca": "ok",
17 + "tls_cert": "ok",
18 + "tls_key": "ok",
19 + "tls_skip_verify": true
20 +}
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.yaml new
+17
@@ -0,0 +1,17 @@
1 +update_every: 123
2 +url: "ok"
3 +body: "ok"
4 +method: "ok"
5 +headers:
6 + ok: "ok"
7 +username: "ok"
8 +password: "ok"
9 +proxy_url: "ok"
10 +proxy_username: "ok"
11 +proxy_password: "ok"
12 +timeout: 123.123
13 +not_follow_redirects: yes
14 +tls_ca: "ok"
15 +tls_cert: "ok"
16 +tls_key: "ok"
17 +tls_skip_verify: yes
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_async_metrics.csv new
+434
@@ -0,0 +1,434 @@
1 +"metric","value"
2 +"AsynchronousMetricsCalculationTimeSpent",0.003263409
3 +"NumberOfDetachedByUserParts",0
4 +"NumberOfDetachedParts",0
5 +"AsynchronousHeavyMetricsCalculationTimeSpent",1.6e-7
6 +"TotalPrimaryKeyBytesInMemoryAllocated",342740
7 +"TotalPartsOfMergeTreeTablesSystem",26
8 +"TotalRowsOfMergeTreeTablesSystem",72275588
9 +"TotalBytesOfMergeTreeTablesSystem",66552963
10 +"TotalRowsOfMergeTreeTables",72275588
11 +"TotalBytesOfMergeTreeTables",66552963
12 +"NumberOfDatabases",4
13 +"MaxPartCountForPartition",7
14 +"ReplicasSumMergesInQueue",0
15 +"ReplicasSumInsertsInQueue",0
16 +"ReplicasSumQueueSize",0
17 +"ReplicasMaxInsertsInQueue",0
18 +"ReplicasMaxQueueSize",0
19 +"DiskUnreserved_default",165498056704
20 +"DiskAvailable_default",165498056704
21 +"DiskUsed_default",45181276160
22 +"FilesystemLogsPathAvailableINodes",12209636
23 +"FilesystemLogsPathUsedBytes",45181276160
24 +"FilesystemLogsPathAvailableBytes",165498056704
25 +"FilesystemLogsPathTotalBytes",210679332864
26 +"FilesystemMainPathUsedINodes",847436
27 +"FilesystemMainPathAvailableBytes",165498056704
28 +"AsynchronousHeavyMetricsUpdateInterval",120.000112
29 +"HashTableStatsCacheMisses",35
30 +"OSNiceTimeCPU2",0
31 +"Uptime",64380.292003818
32 +"FilesystemCacheBytes",0
33 +"OSSoftIrqTimeCPU0",0.0199978602289555
34 +"QueryCacheEntries",0
35 +"QueryCacheBytes",0
36 +"IndexMarkCacheBytes",0
37 +"OSNiceTimeCPU10",0
38 +"UncompressedCacheCells",0
39 +"UncompressedCacheBytes",0
40 +"IndexUncompressedCacheCells",0
41 +"HTTPThreads",1
42 +"InterserverThreads",0
43 +"PageCacheBytes",0
44 +"OSSoftIrqTimeCPU3",0
45 +"VMNumMaps",3034
46 +"BlockWriteTime_sr0",0
47 +"NetworkSendDrop_veth22b9458",0
48 +"NetworkSendBytes_veth22b9458",0
49 +"CPUFrequencyMHz_11",2000
50 +"NetworkReceiveDrop_veth22b9458",0
51 +"OSSystemTimeCPU13",0
52 +"NetworkReceiveBytes_veth22b9458",0
53 +"BlockWriteOps_dm-0",0
54 +"NetworkSendErrors_vethe1fd940",0
55 +"OSGuestNiceTimeCPU9",0
56 +"NetworkSendPackets_vethe1fd940",0
57 +"BlockReadMerges_dm-0",0
58 +"NetworkSendBytes_vethe1fd940",0
59 +"NetworkReceiveDrop_vethe1fd940",0
60 +"OSUserTimeCPU5",0
61 +"NetworkSendDrop_veth0cdb608",0
62 +"NetworkReceiveErrors_veth0cdb608",0
63 +"CPUFrequencyMHz_2",2000
64 +"OSGuestNiceTime",0
65 +"NetworkReceivePackets_veth0cdb608",0
66 +"CompiledExpressionCacheCount",5
67 +"NetworkSendDrop_veth8415c5c",0
68 +"NetworkReceiveErrors_veth8415c5c",0
69 +"OSUserTimeCPU9",0
70 +"NetworkReceivePackets_veth8415c5c",0
71 +"NetworkReceiveBytes_veth8415c5c",0
72 +"NetworkSendPackets_vethfa2b7f2",0
73 +"NetworkSendErrors_vethb608e1b",0
74 +"OSNiceTimeCPU8",0
75 +"NetworkReceiveDrop_vethb608e1b",0
76 +"OSIOWaitTimeCPU7",0
77 +"NetworkReceiveErrors_vethe1fd940",0
78 +"NetworkReceiveErrors_vethb608e1b",0
79 +"CompiledExpressionCacheBytes",65536
80 +"NetworkSendDrop_vethfa2b7f2",0
81 +"IndexUncompressedCacheBytes",0
82 +"CPUFrequencyMHz_12",2000
83 +"NetworkSendBytes_vethfa2b7f2",0
84 +"NetworkReceiveDrop_vethfa2b7f2",0
85 +"NetworkSendErrors_veth0cdb608",0
86 +"OSSystemTimeCPU7",0
87 +"NetworkReceivePackets_vethfa2b7f2",0
88 +"OSThreadsTotal",1432
89 +"NetworkSendBytes_docker0",0
90 +"NetworkReceiveDrop_docker0",0
91 +"OSIOWaitTimeCPU2",0
92 +"NetworkReceiveBytes_vethb608e1b",0
93 +"OSIOWaitTimeCPU10",0
94 +"NetworkReceiveBytes_vethfa2b7f2",0
95 +"jemalloc.epoch",64382
96 +"NetworkReceiveErrors_docker0",0
97 +"OSGuestNiceTimeCPU6",0
98 +"NetworkSendDrop_br-392a8d0e2863",0
99 +"OSStealTimeCPU13",0
100 +"NetworkSendErrors_br-392a8d0e2863",0
101 +"NetworkSendBytes_br-392a8d0e2863",0
102 +"NetworkReceiveBytes_veth0cdb608",0
103 +"NetworkReceiveBytes_br-392a8d0e2863",0
104 +"NetworkSendDrop_dummy0",0
105 +"jemalloc.retained",94481276928
106 +"NetworkSendPackets_dummy0",0
107 +"NetworkSendBytes_dummy0",0
108 +"OSStealTimeCPU3",0
109 +"NetworkReceiveErrors_dummy0",0
110 +"NetworkReceivePackets_dummy0",0
111 +"NetworkReceiveBytes_dummy0",0
112 +"NetworkReceiveBytes_vethe1fd940",0
113 +"OSUserTimeCPU6",0
114 +"NetworkSendDrop_ens18",0
115 +"NetworkSendErrors_ens18",0
116 +"OSNiceTimeNormalized",0
117 +"NetworkReceiveErrors_ens18",0
118 +"BlockQueueTime_sr0",0
119 +"FilesystemCacheFiles",0
120 +"BlockActiveTime_dm-0",0
121 +"BlockActiveTime_sr0",0
122 +"BlockInFlightOps_sr0",0
123 +"BlockDiscardTime_sr0",0
124 +"OSGuestNiceTimeCPU1",0
125 +"BlockReadBytes_sr0",0
126 +"BlockDiscardMerges_sr0",0
127 +"BlockReadMerges_sr0",0
128 +"OSSoftIrqTimeCPU1",0
129 +"BlockDiscardTime_dm-0",0
130 +"OSUserTimeCPU7",0.00999893011447775
131 +"BlockWriteBytes_dm-0",0
132 +"BlockReadBytes_dm-0",0
133 +"OSContextSwitches",5242
134 +"FilesystemMainPathAvailableINodes",12209636
135 +"BlockDiscardOps_dm-0",0
136 +"BlockWriteTime_dm-0",0
137 +"BlockQueueTime_sda",0
138 +"OSIrqTimeCPU11",0
139 +"BlockActiveTime_sda",0
140 +"OSIrqTimeCPU4",0
141 +"NetworkSendPackets_ens18",3
142 +"BlockDiscardTime_sda",0
143 +"Jitter",0.000107
144 +"BlockReadBytes_sda",0
145 +"BlockDiscardMerges_sda",0
146 +"NetworkSendErrors_veth8415c5c",0
147 +"BlockReadMerges_sda",0
148 +"NetworkSendPackets_br-392a8d0e2863",0
149 +"BlockDiscardOps_sda",0
150 +"BlockWriteOps_sda",0
151 +"OSSystemTimeCPU8",0
152 +"CPUFrequencyMHz_15",2000
153 +"CPUFrequencyMHz_14",2000
154 +"OSNiceTimeCPU9",0
155 +"NetworkReceivePackets_veth22b9458",0
156 +"BlockWriteOps_sr0",0
157 +"BlockWriteTime_sda",0
158 +"OSGuestTimeCPU6",0
159 +"NetworkReceiveBytes_ens18",442
160 +"CPUFrequencyMHz_10",2000
161 +"BlockReadOps_sr0",0
162 +"CPUFrequencyMHz_7",2000
163 +"CPUFrequencyMHz_13",2000
164 +"CPUFrequencyMHz_6",2000
165 +"CPUFrequencyMHz_5",2000
166 +"BlockDiscardOps_sr0",0
167 +"NetworkReceiveErrors_vethfa2b7f2",0
168 +"CPUFrequencyMHz_4",2000
169 +"CPUFrequencyMHz_3",2000
170 +"CPUFrequencyMHz_1",2000
171 +"OSNiceTimeCPU6",0
172 +"NetworkSendPackets_vethb608e1b",0
173 +"CPUFrequencyMHz_0",2000
174 +"OSGuestNiceTimeCPU0",0
175 +"OSMemoryFreePlusCached",28217331712
176 +"TCPThreads",1
177 +"OSStealTimeCPU6",0
178 +"OSMemoryCached",9402826752
179 +"OSMemoryBuffers",1473716224
180 +"OSMemoryAvailable",29864460288
181 +"MemoryDataAndStack",101636190208
182 +"OSUserTimeCPU11",0
183 +"ReplicasMaxMergesInQueue",0
184 +"OSGuestTimeNormalized",0
185 +"OSSoftIrqTimeNormalized",0.0012498662643097187
186 +"OSGuestNiceTimeCPU13",0
187 +"OSIrqTimeNormalized",0
188 +"OSUserTimeCPU4",0
189 +"OSIOWaitTimeNormalized",0
190 +"OSIdleTimeNormalized",0.9892691482011424
191 +"OSSystemTimeNormalized",0.004999465057238875
192 +"BlockWriteBytes_sr0",0
193 +"NetworkReceivePackets_docker0",0
194 +"OSUserTimeNormalized",0.0024997325286194375
195 +"OSSystemTime",0.079991440915822
196 +"NetworkReceivePackets_br-392a8d0e2863",0
197 +"OSProcessesCreated",7
198 +"OSInterrupts",2971
199 +"BlockWriteMerges_sr0",0
200 +"OSProcessesRunning",7
201 +"BlockInFlightOps_sda",0
202 +"CPUFrequencyMHz_9",2000
203 +"OSGuestTimeCPU5",0
204 +"OSNiceTimeCPU13",0
205 +"TotalPartsOfMergeTreeTables",26
206 +"OSGuestTimeCPU15",0
207 +"OSStealTimeCPU15",0
208 +"OSIrqTimeCPU15",0
209 +"OSGuestTimeCPU10",0
210 +"OSStealTimeCPU1",0
211 +"OSSystemTimeCPU15",0
212 +"OSNiceTimeCPU15",0
213 +"PageCachePinnedBytes",0
214 +"OSUserTimeCPU15",0
215 +"OSSoftIrqTimeCPU14",0
216 +"OSIdleTimeCPU14",0.999893011447775
217 +"OSIdleTimeCPU1",0.9898940813332973
218 +"OSSoftIrqTimeCPU13",0
219 +"OSStealTimeCPU12",0
220 +"OSIdleTimeCPU13",0.9898940813332973
221 +"NetworkSendBytes_veth0cdb608",0
222 +"MemoryResidentMax",15751659520
223 +"OSIdleTimeCPU15",0.999893011447775
224 +"OSGuestNiceTimeCPU5",0
225 +"OSGuestNiceTimeCPU12",0
226 +"OSIrqTime",0
227 +"OSGuestTimeCPU9",0
228 +"OSGuestTimeCPU12",0
229 +"OSSoftIrqTimeCPU12",0
230 +"OSIdleTime",15.828306371218279
231 +"OSSoftIrqTimeCPU7",0
232 +"OSUserTimeCPU2",0
233 +"OSIdleTimeCPU12",0.9898940813332973
234 +"OSGuestTimeCPU2",0
235 +"OSSystemTimeCPU12",0.00999893011447775
236 +"OSSystemTimeCPU10",0.00999893011447775
237 +"OSGuestTimeCPU11",0
238 +"OSStealTimeCPU11",0
239 +"OSSoftIrqTimeCPU11",0
240 +"OSIOWaitTimeCPU11",0
241 +"BlockQueueTime_dm-0",0
242 +"OSIdleTimeCPU11",0.999893011447775
243 +"OSIrqTimeCPU8",0
244 +"OSNiceTimeCPU11",0
245 +"OSStealTimeCPU10",0
246 +"NetworkReceivePackets_vethb608e1b",0
247 +"NetworkReceiveErrors_br-392a8d0e2863",0
248 +"OSNiceTimeCPU14",0
249 +"NetworkSendPackets_veth22b9458",0
250 +"OSSystemTimeCPU2",0
251 +"OSSoftIrqTimeCPU10",0
252 +"ReplicasMaxRelativeDelay",0
253 +"OSIrqTimeCPU10",0
254 +"MMapCacheCells",0
255 +"OSIrqTimeCPU9",0
256 +"NetworkReceiveDrop_veth0cdb608",0
257 +"OSIrqTimeCPU1",0
258 +"OSIrqTimeCPU14",0
259 +"OSIrqTimeCPU13",0
260 +"NetworkSendDrop_docker0",0
261 +"OSIdleTimeCPU10",0.9798951512188194
262 +"OSGuestTimeCPU14",0
263 +"OSUserTimeCPU13",0
264 +"OSIOWaitTimeCPU14",0
265 +"OSStealTimeCPU9",0
266 +"NetworkReceiveErrors_veth22b9458",0
267 +"NetworkReceiveDrop_dummy0",0
268 +"OSSoftIrqTimeCPU9",0
269 +"OSIOWaitTimeCPU9",0
270 +"OSIdleTimeCPU9",0.999893011447775
271 +"OSGuestTimeCPU3",0
272 +"OSIOWaitTimeCPU13",0
273 +"BlockReadTime_sr0",0
274 +"OSSoftIrqTimeCPU15",0
275 +"OSIOWaitTimeCPU12",0
276 +"OSGuestTimeCPU8",0
277 +"OSStealTimeCPU8",0
278 +"OSUserTimeCPU0",0
279 +"OSIdleTimeCPU8",0.9798951512188194
280 +"OSGuestNiceTimeCPU4",0
281 +"OSUserTimeCPU8",0.00999893011447775
282 +"OSSystemTimeCPU9",0
283 +"PrometheusThreads",1
284 +"NetworkSendErrors_veth22b9458",0
285 +"OSMemoryTotal",33652854784
286 +"OSGuestNiceTimeCPU7",0
287 +"OSStealTimeCPU7",0
288 +"BlockReadOps_dm-0",0
289 +"OSStealTimeCPU14",0
290 +"OSGuestNiceTimeCPU8",0
291 +"NetworkReceivePackets_vethe1fd940",0
292 +"OSIdleTimeCPU7",0.9898940813332973
293 +"OSSoftIrqTimeCPU8",0
294 +"OSNiceTimeCPU7",0
295 +"OSIOWaitTimeCPU8",0
296 +"OSIOWaitTimeCPU6",0
297 +"NetworkSendBytes_vethb608e1b",0
298 +"NetworkSendBytes_ens18",714
299 +"OSIdleTimeCPU3",0.9898940813332973
300 +"OSGuestNiceTimeCPU11",0
301 +"jemalloc.background_thread.num_threads",0
302 +"BlockReadTime_sda",0
303 +"OSSoftIrqTimeCPU6",0
304 +"OSSoftIrqTimeCPU2",0
305 +"OSGuestNiceTimeCPU2",0
306 +"OSUserTimeCPU12",0
307 +"LoadAverage5",0.22
308 +"OSGuestNiceTimeCPU10",0
309 +"jemalloc.background_thread.num_runs",0
310 +"FilesystemLogsPathUsedINodes",847436
311 +"OSIrqTimeCPU6",0
312 +"OSIrqTimeCPU7",0
313 +"HashTableStatsCacheHits",124
314 +"OSNiceTimeCPU0",0
315 +"CPUFrequencyMHz_8",2000
316 +"MarkCacheBytes",76560
317 +"FilesystemMainPathTotalINodes",13057072
318 +"NetworkSendPackets_veth0cdb608",0
319 +"NetworkReceiveDrop_br-392a8d0e2863",0
320 +"OSStealTimeNormalized",0
321 +"NetworkReceiveDrop_veth8415c5c",0
322 +"BlockDiscardBytes_sr0",0
323 +"OSSystemTimeCPU5",0.00999893011447775
324 +"OSUptime",1444727.52
325 +"FilesystemLogsPathTotalINodes",13057072
326 +"NetworkSendPackets_veth8415c5c",0
327 +"OSStealTimeCPU4",0
328 +"OSSoftIrqTimeCPU4",0
329 +"NetworkSendErrors_vethfa2b7f2",0
330 +"NetworkSendBytes_veth8415c5c",0
331 +"MemoryShared",333160448
332 +"OSGuestTimeCPU4",0
333 +"jemalloc.metadata",265969056
334 +"OSGuestNiceTimeCPU15",0
335 +"NumberOfTablesSystem",100
336 +"OSSystemTimeCPU11",0
337 +"OSIdleTimeCPU4",0.9898940813332973
338 +"IndexMarkCacheFiles",0
339 +"OSIOWaitTimeCPU15",0
340 +"OSNiceTimeCPU4",0
341 +"jemalloc.arenas.all.pactive",113928
342 +"OSUserTimeCPU1",0
343 +"NetworkReceivePackets_ens18",3
344 +"OSIrqTimeCPU3",0
345 +"OSIOWaitTimeCPU3",0
346 +"OSUserTime",0.039995720457911
347 +"OSIdleTimeCPU5",0.9898940813332973
348 +"OSOpenFiles",3008
349 +"OSIrqTimeCPU5",0
350 +"PostgreSQLThreads",0
351 +"OSUserTimeCPU10",0
352 +"TotalPrimaryKeyBytesInMemory",74202
353 +"OSIrqTimeCPU2",0
354 +"jemalloc.mapped",1036132352
355 +"BlockWriteMerges_dm-0",0
356 +"OSMemoryFreeWithoutCached",18814504960
357 +"DiskTotal_default",210679332864
358 +"OSGuestNiceTimeCPU3",0
359 +"OSIrqTimeCPU12",0
360 +"OSIOWaitTimeCPU5",0
361 +"OSNiceTimeCPU1",0
362 +"NetworkReceiveDrop_ens18",0
363 +"jemalloc.active",466649088
364 +"OSNiceTimeCPU12",0
365 +"OSGuestNiceTimeNormalized",0
366 +"OSSystemTimeCPU14",0
367 +"OSSoftIrqTimeCPU5",0
368 +"BlockReadTime_dm-0",0
369 +"MemoryResident",1279381504
370 +"BlockDiscardMerges_dm-0",0
371 +"OSGuestTimeCPU0",0
372 +"NetworkSendDrop_vethe1fd940",0
373 +"MemoryVirtual",102527639552
374 +"OSSystemTimeCPU3",0.00999893011447775
375 +"OSNiceTimeCPU3",0
376 +"FilesystemMainPathUsedBytes",45181276160
377 +"OSUserTimeCPU14",0
378 +"OSSoftIrqTime",0.0199978602289555
379 +"jemalloc.metadata_thp",0
380 +"OSStealTimeCPU0",0
381 +"OSSystemTimeCPU0",0
382 +"OSGuestNiceTimeCPU14",0
383 +"OSStealTimeCPU2",0
384 +"OSSystemTimeCPU1",0
385 +"BlockInFlightOps_dm-0",0
386 +"OSSystemTimeCPU6",0.02999679034343325
387 +"VMMaxMapCount",262144
388 +"NetworkSendPackets_docker0",0
389 +"OSUserTimeCPU3",0.00999893011447775
390 +"OSGuestTime",0
391 +"OSNiceTimeCPU5",0
392 +"OSIOWaitTimeCPU1",0
393 +"OSIOWaitTime",0
394 +"jemalloc.arenas.all.pmuzzy",0
395 +"NetworkSendErrors_docker0",0
396 +"OSNiceTime",0
397 +"LoadAverage15",0.24
398 +"OSIdleTimeCPU0",0.9898940813332973
399 +"MarkCacheFiles",54
400 +"OSIOWaitTimeCPU4",0
401 +"BlockWriteMerges_sda",0
402 +"NumberOfTables",128
403 +"OSIrqTimeCPU0",0
404 +"jemalloc.arenas.all.muzzy_purged",0
405 +"NetworkSendDrop_vethb608e1b",0
406 +"OSProcessesBlocked",0
407 +"jemalloc.allocated",412954608
408 +"NetworkSendErrors_dummy0",0
409 +"ReplicasMaxAbsoluteDelay",0
410 +"OSThreadsRunnable",8
411 +"OSStealTimeCPU5",0
412 +"LoadAverage1",0.18
413 +"OSGuestTimeCPU7",0
414 +"BlockDiscardBytes_sda",0
415 +"jemalloc.arenas.all.pdirty",60698
416 +"OSIdleTimeCPU6",0.9698962211043417
417 +"OSSystemTimeCPU4",0
418 +"OSStealTime",0
419 +"MemoryCode",283267072
420 +"AsynchronousMetricsUpdateInterval",1.000107
421 +"NetworkReceiveBytes_docker0",0
422 +"BlockDiscardBytes_dm-0",0
423 +"jemalloc.arenas.all.dirty_purged",363559728
424 +"HashTableStatsCacheEntries",9
425 +"MySQLThreads",0
426 +"FilesystemMainPathTotalBytes",210679332864
427 +"jemalloc.resident",960614400
428 +"OSGuestTimeCPU13",0
429 +"jemalloc.background_thread.run_intervals",0
430 +"BlockReadOps_sda",0
431 +"OSIOWaitTimeCPU0",0
432 +"OSIdleTimeCPU2",0.9898940813332973
433 +"BlockWriteBytes_sda",0
434 +"OSGuestTimeCPU1",0
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_disks.csv new
+2
@@ -0,0 +1,2 @@
1 +"name","free_space","total_space"
2 +"default",165494767616,210679332864
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_events.csv new
+102
@@ -0,0 +1,102 @@
1 +"event","value"
2 +"Query", 94
3 +"SelectQuery", 94
4 +"InitialQuery", 94
5 +"QueriesWithSubqueries", 174
6 +"SelectQueriesWithSubqueries", 174
7 +"FailedQuery", 4
8 +"FailedSelectQuery", 4
9 +"QueryTimeMicroseconds", 870752
10 +"SelectQueryTimeMicroseconds", 870752
11 +"FileOpen",1568962
12 +"Seek", 27585
13 +"ReadBufferFromFileDescriptorRead", 8578903
14 +"ReadBufferFromFileDescriptorReadBytes", 29425788980
15 +"WriteBufferFromFileDescriptorWrite", 1413953
16 +"WriteBufferFromFileDescriptorWriteBytes", 19290175707
17 +"ReadCompressedBytes", 17765217623
18 +"CompressedReadBufferBlocks", 22044981
19 +"CompressedReadBufferBytes", 639439855526
20 +"OpenedFileCacheHits", 138
21 +"OpenedFileCacheMisses",346495
22 +"OpenedFileCacheMicroseconds", 307462
23 +"IOBufferAllocs", 4887901
24 +"IOBufferAllocBytes", 1142983723070
25 +"ArenaAllocChunks", 196
26 +"ArenaAllocBytes", 1556480
27 +"FunctionExecute", 8055228
28 +"TableFunctionExecute", 41
29 +"MarkCacheHits", 229
30 +"MarkCacheMisses", 54
31 +"CreatedReadBufferOrdinary",346633
32 +"DiskReadElapsedMicroseconds", 64340828296
33 +"DiskWriteElapsedMicroseconds", 33066436
34 +"NetworkReceiveElapsedMicroseconds", 17548931930
35 +"NetworkSendElapsedMicroseconds", 3313835
36 +"NetworkReceiveBytes", 2121500
37 +"NetworkSendBytes", 5492910494
38 +"InsertedRows", 28386169
39 +"InsertedBytes", 1104809236
40 +"CompileFunction", 5
41 +"CompileExpressionsMicroseconds",134487
42 +"CompileExpressionsBytes", 65536
43 +"ExternalProcessingFilesTotal", 605
44 +"SelectedParts", 68
45 +"SelectedRanges", 68
46 +"SelectedMarks", 836
47 +"SelectedRows", 29975411
48 +"SelectedBytes", 1127243995
49 +"WaitMarksLoadMicroseconds", 2823449
50 +"LoadedMarksCount", 31080118
51 +"LoadedMarksMemoryBytes",48212328
52 +"Merge", 3929781
53 +"MergedRows", 30485884752
54 +"MergedUncompressedBytes", 641315961578
55 +"MergesTimeMilliseconds", 4586438
56 +"MergeTreeDataWriterRows", 28386169
57 +"MergeTreeDataWriterUncompressedBytes", 1104809236
58 +"MergeTreeDataWriterCompressedBytes", 1127957207
59 +"MergeTreeDataWriterBlocks", 25840
60 +"MergeTreeDataWriterBlocksAlreadySorted", 16671
61 +"MergeTreeDataWriterSortingBlocksMicroseconds",7881192
62 +"MergeTreeDataWriterMergingBlocksMicroseconds", 30988
63 +"InsertedCompactParts", 25840
64 +"MergedIntoWideParts", 11349
65 +"MergedIntoCompactParts", 3132
66 +"ContextLock", 1727098
67 +"ContextLockWaitMicroseconds", 4763
68 +"RWLockAcquiredReadLocks", 322474
69 +"RWLockReadersWaitMilliseconds", 660
70 +"PartsLockHoldMicroseconds", 23499086
71 +"PartsLockWaitMicroseconds",13947
72 +"RealTimeMicroseconds", 5484454350
73 +"UserTimeMicroseconds", 4588286964
74 +"SystemTimeMicroseconds", 890356522
75 +"MemoryAllocatorPurge", 2
76 +"MemoryAllocatorPurgeTimeMicroseconds", 135392
77 +"SoftPageFaults", 71033079
78 +"OSCPUWaitMicroseconds", 1028066
79 +"OSCPUVirtualTimeMicroseconds", 5475763006
80 +"OSReadBytes", 8192
81 +"OSWriteBytes",20749721600
82 +"OSReadChars", 17832770560
83 +"OSWriteChars", 17947151360
84 +"QueryProfilerRuns", 7153
85 +"ThreadPoolReaderPageCacheHit", 428
86 +"ThreadPoolReaderPageCacheHitBytes", 8568656
87 +"ThreadPoolReaderPageCacheHitElapsedMicroseconds", 11635
88 +"SynchronousReadWaitMicroseconds", 11965
89 +"MainConfigLoads", 1
90 +"AggregationOptimizedEqualRangesOfKeys", 17
91 +"ServerStartupMilliseconds",463
92 +"AsyncLoaderWaitMicroseconds", 65377
93 +"LogTrace", 285068
94 +"LogDebug", 171106
95 +"LogInfo", 47
96 +"LogWarning", 2
97 +"LogError", 52
98 +"InterfaceHTTPSendBytes", 37853
99 +"InterfaceHTTPReceiveBytes", 72018
100 +"InterfaceNativeReceiveBytes", 11646
101 +"InterfacePrometheusSendBytes",3817434
102 +"InterfacePrometheusReceiveBytes", 2037836
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_metrics.csv new
+283
@@ -0,0 +1,283 @@
1 +"metric","value"
2 +"Query",1
3 +"Merge",0
4 +"Move",0
5 +"PartMutation",0
6 +"ReplicatedFetch",0
7 +"ReplicatedSend",0
8 +"ReplicatedChecks",0
9 +"BackgroundMergesAndMutationsPoolTask",0
10 +"BackgroundMergesAndMutationsPoolSize",64
11 +"BackgroundFetchesPoolTask",0
12 +"BackgroundFetchesPoolSize",32
13 +"BackgroundCommonPoolTask",0
14 +"BackgroundCommonPoolSize",16
15 +"BackgroundMovePoolTask",0
16 +"BackgroundMovePoolSize",16
17 +"BackgroundSchedulePoolTask",0
18 +"BackgroundSchedulePoolSize",512
19 +"BackgroundBufferFlushSchedulePoolTask",0
20 +"BackgroundBufferFlushSchedulePoolSize",16
21 +"BackgroundDistributedSchedulePoolTask",0
22 +"BackgroundDistributedSchedulePoolSize",16
23 +"BackgroundMessageBrokerSchedulePoolTask",0
24 +"BackgroundMessageBrokerSchedulePoolSize",16
25 +"CacheDictionaryUpdateQueueBatches",0
26 +"CacheDictionaryUpdateQueueKeys",0
27 +"DiskSpaceReservedForMerge",0
28 +"DistributedSend",0
29 +"QueryPreempted",0
30 +"TCPConnection",1
31 +"MySQLConnection",0
32 +"HTTPConnection",0
33 +"InterserverConnection",0
34 +"PostgreSQLConnection",0
35 +"OpenFileForRead",14
36 +"OpenFileForWrite",0
37 +"TotalTemporaryFiles",0
38 +"TemporaryFilesForSort",0
39 +"TemporaryFilesForAggregation",0
40 +"TemporaryFilesForJoin",0
41 +"TemporaryFilesUnknown",0
42 +"Read",2
43 +"RemoteRead",0
44 +"Write",0
45 +"NetworkReceive",0
46 +"NetworkSend",0
47 +"SendScalars",0
48 +"SendExternalTables",0
49 +"QueryThread",0
50 +"ReadonlyReplica",0
51 +"MemoryTracking",1270999152
52 +"MergesMutationsMemoryTracking",0
53 +"EphemeralNode",0
54 +"ZooKeeperSession",0
55 +"ZooKeeperWatch",0
56 +"ZooKeeperRequest",0
57 +"DelayedInserts",0
58 +"ContextLockWait",0
59 +"StorageBufferRows",0
60 +"StorageBufferBytes",0
61 +"DictCacheRequests",0
62 +"Revision",54486
63 +"VersionInteger",24005001
64 +"RWLockWaitingReaders",0
65 +"RWLockWaitingWriters",0
66 +"RWLockActiveReaders",1
67 +"RWLockActiveWriters",0
68 +"GlobalThread",714
69 +"GlobalThreadActive",651
70 +"GlobalThreadScheduled",651
71 +"LocalThread",0
72 +"LocalThreadActive",0
73 +"LocalThreadScheduled",0
74 +"MergeTreeDataSelectExecutorThreads",0
75 +"MergeTreeDataSelectExecutorThreadsActive",0
76 +"MergeTreeDataSelectExecutorThreadsScheduled",0
77 +"BackupsThreads",0
78 +"BackupsThreadsActive",0
79 +"BackupsThreadsScheduled",0
80 +"RestoreThreads",0
81 +"RestoreThreadsActive",0
82 +"RestoreThreadsScheduled",0
83 +"MarksLoaderThreads",0
84 +"MarksLoaderThreadsActive",0
85 +"MarksLoaderThreadsScheduled",0
86 +"IOPrefetchThreads",0
87 +"IOPrefetchThreadsActive",0
88 +"IOPrefetchThreadsScheduled",0
89 +"IOWriterThreads",0
90 +"IOWriterThreadsActive",0
91 +"IOWriterThreadsScheduled",0
92 +"IOThreads",0
93 +"IOThreadsActive",0
94 +"IOThreadsScheduled",0
95 +"ThreadPoolRemoteFSReaderThreads",0
96 +"ThreadPoolRemoteFSReaderThreadsActive",0
97 +"ThreadPoolRemoteFSReaderThreadsScheduled",0
98 +"ThreadPoolFSReaderThreads",0
99 +"ThreadPoolFSReaderThreadsActive",0
100 +"ThreadPoolFSReaderThreadsScheduled",0
101 +"BackupsIOThreads",0
102 +"BackupsIOThreadsActive",0
103 +"BackupsIOThreadsScheduled",0
104 +"DiskObjectStorageAsyncThreads",0
105 +"DiskObjectStorageAsyncThreadsActive",0
106 +"StorageHiveThreads",0
107 +"StorageHiveThreadsActive",0
108 +"StorageHiveThreadsScheduled",0
109 +"TablesLoaderBackgroundThreads",0
110 +"TablesLoaderBackgroundThreadsActive",0
111 +"TablesLoaderBackgroundThreadsScheduled",0
112 +"TablesLoaderForegroundThreads",0
113 +"TablesLoaderForegroundThreadsActive",0
114 +"TablesLoaderForegroundThreadsScheduled",0
115 +"DatabaseOnDiskThreads",0
116 +"DatabaseOnDiskThreadsActive",0
117 +"DatabaseOnDiskThreadsScheduled",0
118 +"DatabaseCatalogThreads",0
119 +"DatabaseCatalogThreadsActive",0
120 +"DatabaseCatalogThreadsScheduled",0
121 +"DestroyAggregatesThreads",0
122 +"DestroyAggregatesThreadsActive",0
123 +"DestroyAggregatesThreadsScheduled",0
124 +"HashedDictionaryThreads",0
125 +"HashedDictionaryThreadsActive",0
126 +"HashedDictionaryThreadsScheduled",0
127 +"CacheDictionaryThreads",0
128 +"CacheDictionaryThreadsActive",0
129 +"CacheDictionaryThreadsScheduled",0
130 +"ParallelFormattingOutputFormatThreads",0
131 +"ParallelFormattingOutputFormatThreadsActive",0
132 +"ParallelFormattingOutputFormatThreadsScheduled",0
133 +"ParallelParsingInputFormatThreads",0
134 +"ParallelParsingInputFormatThreadsActive",0
135 +"ParallelParsingInputFormatThreadsScheduled",0
136 +"MergeTreeBackgroundExecutorThreads",48
137 +"MergeTreeBackgroundExecutorThreadsActive",48
138 +"MergeTreeBackgroundExecutorThreadsScheduled",48
139 +"AsynchronousInsertThreads",0
140 +"AsynchronousInsertThreadsActive",0
141 +"AsynchronousInsertThreadsScheduled",0
142 +"AsynchronousInsertQueueSize",0
143 +"AsynchronousInsertQueueBytes",0
144 +"StartupSystemTablesThreads",0
145 +"StartupSystemTablesThreadsActive",0
146 +"StartupSystemTablesThreadsScheduled",0
147 +"AggregatorThreads",0
148 +"AggregatorThreadsActive",0
149 +"AggregatorThreadsScheduled",0
150 +"DDLWorkerThreads",0
151 +"DDLWorkerThreadsActive",0
152 +"DDLWorkerThreadsScheduled",0
153 +"StorageDistributedThreads",0
154 +"StorageDistributedThreadsActive",0
155 +"StorageDistributedThreadsScheduled",0
156 +"DistributedInsertThreads",0
157 +"DistributedInsertThreadsActive",0
158 +"DistributedInsertThreadsScheduled",0
159 +"StorageS3Threads",0
160 +"StorageS3ThreadsActive",0
161 +"StorageS3ThreadsScheduled",0
162 +"ObjectStorageS3Threads",0
163 +"ObjectStorageS3ThreadsActive",0
164 +"ObjectStorageS3ThreadsScheduled",0
165 +"ObjectStorageAzureThreads",0
166 +"ObjectStorageAzureThreadsActive",0
167 +"ObjectStorageAzureThreadsScheduled",0
168 +"MergeTreePartsLoaderThreads",0
169 +"MergeTreePartsLoaderThreadsActive",0
170 +"MergeTreePartsLoaderThreadsScheduled",0
171 +"MergeTreeOutdatedPartsLoaderThreads",0
172 +"MergeTreeOutdatedPartsLoaderThreadsActive",0
173 +"MergeTreeOutdatedPartsLoaderThreadsScheduled",0
174 +"MergeTreeUnexpectedPartsLoaderThreads",0
175 +"MergeTreeUnexpectedPartsLoaderThreadsActive",0
176 +"MergeTreeUnexpectedPartsLoaderThreadsScheduled",0
177 +"MergeTreePartsCleanerThreads",0
178 +"MergeTreePartsCleanerThreadsActive",0
179 +"MergeTreePartsCleanerThreadsScheduled",0
180 +"DatabaseReplicatedCreateTablesThreads",0
181 +"DatabaseReplicatedCreateTablesThreadsActive",0
182 +"DatabaseReplicatedCreateTablesThreadsScheduled",0
183 +"IDiskCopierThreads",0
184 +"IDiskCopierThreadsActive",0
185 +"IDiskCopierThreadsScheduled",0
186 +"SystemReplicasThreads",0
187 +"SystemReplicasThreadsActive",0
188 +"SystemReplicasThreadsScheduled",0
189 +"RestartReplicaThreads",0
190 +"RestartReplicaThreadsActive",0
191 +"RestartReplicaThreadsScheduled",0
192 +"QueryPipelineExecutorThreads",0
193 +"QueryPipelineExecutorThreadsActive",0
194 +"QueryPipelineExecutorThreadsScheduled",0
195 +"ParquetDecoderThreads",0
196 +"ParquetDecoderThreadsActive",0
197 +"ParquetDecoderThreadsScheduled",0
198 +"ParquetEncoderThreads",0
199 +"ParquetEncoderThreadsActive",0
200 +"ParquetEncoderThreadsScheduled",0
201 +"DWARFReaderThreads",0
202 +"DWARFReaderThreadsActive",0
203 +"DWARFReaderThreadsScheduled",0
204 +"OutdatedPartsLoadingThreads",0
205 +"OutdatedPartsLoadingThreadsActive",0
206 +"OutdatedPartsLoadingThreadsScheduled",0
207 +"DistributedBytesToInsert",0
208 +"BrokenDistributedBytesToInsert",0
209 +"DistributedFilesToInsert",0
210 +"BrokenDistributedFilesToInsert",0
211 +"TablesToDropQueueSize",0
212 +"MaxDDLEntryID",0
213 +"MaxPushedDDLEntryID",0
214 +"PartsTemporary",0
215 +"PartsPreCommitted",0
216 +"PartsCommitted",25
217 +"PartsPreActive",0
218 +"PartsActive",25
219 +"AttachedDatabase",5
220 +"AttachedTable",128
221 +"PartsOutdated",284
222 +"PartsDeleting",0
223 +"PartsDeleteOnDestroy",0
224 +"PartsWide",76
225 +"PartsCompact",233
226 +"MMappedFiles",2
227 +"MMappedFileBytes",498055184
228 +"AsynchronousReadWait",0
229 +"PendingAsyncInsert",0
230 +"KafkaConsumers",0
231 +"KafkaConsumersWithAssignment",0
232 +"KafkaProducers",0
233 +"KafkaLibrdkafkaThreads",0
234 +"KafkaBackgroundReads",0
235 +"KafkaConsumersInUse",0
236 +"KafkaWrites",0
237 +"KafkaAssignedPartitions",0
238 +"FilesystemCacheReadBuffers",0
239 +"CacheFileSegments",0
240 +"CacheDetachedFileSegments",0
241 +"FilesystemCacheSize",0
242 +"FilesystemCacheSizeLimit",0
243 +"FilesystemCacheElements",0
244 +"FilesystemCacheDownloadQueueElements",0
245 +"FilesystemCacheDelayedCleanupElements",0
246 +"FilesystemCacheHoldFileSegments",0
247 +"AsyncInsertCacheSize",0
248 +"S3Requests",0
249 +"KeeperAliveConnections",0
250 +"KeeperOutstandingRequets",0
251 +"ThreadsInOvercommitTracker",0
252 +"IOUringPendingEvents",0
253 +"IOUringInFlightEvents",0
254 +"ReadTaskRequestsSent",0
255 +"MergeTreeReadTaskRequestsSent",0
256 +"MergeTreeAllRangesAnnouncementsSent",0
257 +"CreatedTimersInQueryProfiler",166
258 +"ActiveTimersInQueryProfiler",2
259 +"RefreshableViews",0
260 +"RefreshingViews",0
261 +"StorageBufferFlushThreads",0
262 +"StorageBufferFlushThreadsActive",0
263 +"StorageBufferFlushThreadsScheduled",0
264 +"SharedMergeTreeThreads",0
265 +"SharedMergeTreeThreadsActive",0
266 +"SharedMergeTreeThreadsScheduled",0
267 +"SharedMergeTreeFetch",0
268 +"CacheWarmerBytesInProgress",0
269 +"DistrCacheOpenedConnections",0
270 +"DistrCacheUsedConnections",0
271 +"DistrCacheReadRequests",0
272 +"DistrCacheWriteRequests",0
273 +"DistrCacheServerConnections",0
274 +"StorageConnectionsStored",0
275 +"StorageConnectionsTotal",0
276 +"DiskConnectionsStored",0
277 +"DiskConnectionsTotal",0
278 +"HTTPConnectionsStored",0
279 +"HTTPConnectionsTotal",0
280 +"AddressesActive",0
281 +"AddressesBanned",0
282 +"FilteringMarksWithPrimaryKey",0
283 +"FilteringMarksWithSecondaryKeys",0
src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_parts.csv new
+6
@@ -0,0 +1,6 @@
1 +"database","table","bytes","parts","rows"
2 +"system","processors_profile_log",391629,5,20107
3 +"system","metric_log",18302533,6,162718
4 +"system","query_log",196403,5,761
5 +"system","asynchronous_metric_log",19113663,6,70377261
6 +"system","trace_log",28695023,8,1733076
src/go/collectors/go.d.plugin/modules/init.go
+1
@@ -9,6 +9,7 @@ import (
9 _ "github.com/netdata/netdata/go/go.d.plugin/modules/bind"
10 _ "github.com/netdata/netdata/go/go.d.plugin/modules/cassandra"
11 _ "github.com/netdata/netdata/go/go.d.plugin/modules/chrony"
12 + _ "github.com/netdata/netdata/go/go.d.plugin/modules/clickhouse"
13 _ "github.com/netdata/netdata/go/go.d.plugin/modules/cockroachdb"
14 _ "github.com/netdata/netdata/go/go.d.plugin/modules/consul"
15 _ "github.com/netdata/netdata/go/go.d.plugin/modules/coredns"
src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml
-27
@@ -1014,33 +1014,6 @@ modules:
1014 - title: Install Exporter
1015 description: |
1016 Install [Citrix NetScaler Exporter](https://github.com/rokett/Citrix-NetScaler-Exporter) by following the instructions mentioned in the exporter README.
1017 - - <<: *module
1018 - meta:
1019 - <<: *meta
1020 - id: collector-go.d.plugin-prometheus-clickhouse
1021 - most_popular: false
1022 - community: true
1023 - monitored_instance:
1024 - name: ClickHouse
1025 - link: https://github.com/ClickHouse/ClickHouse
1026 - icon_filename: clickhouse.svg
1027 - categories:
1028 - - data-collection.database-servers
1029 - keywords: []
1030 - overview:
1031 - <<: *overview
1032 - data_collection:
1033 - metrics_description: |
1034 - Monitor ClickHouse database metrics for efficient data storage and query performance.
1035 - method_description: |
1036 - Metrics are gathered by periodically sending HTTP requests to the ClickHouse built-in Prometheus exporter.
1037 - setup:
1038 - <<: *setup
1039 - prerequisites:
1040 - list:
1041 - - title: Configure built-in Prometheus exporter
1042 - description: |
1043 - To configure the built-in Prometheus exporter, follow the [official documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#server_configuration_parameters-prometheus).
1017 - <<: *module
1018 meta:
1019 <<: *meta