Support ClickHouse server monitoring & Support service hierarchy (#11966)

This commit is contained in:
Chen Ziyan 2024-03-07 09:41:39 +08:00 committed by GitHub
parent 6d8524f39e
commit 00ccaceb27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 4040 additions and 3 deletions

View File

@ -648,6 +648,8 @@ jobs:
config: test/e2e-v2/cases/pulsar/e2e.yaml
- name: RocketMQ
config: test/e2e-v2/cases/rocketmq/e2e.yaml
- name: ClickHouse
config: test/e2e-v2/cases/clickhouse/clickhouse-prometheus-endpoint/e2e.yaml
- name: UI Menu BanyanDB
config: test/e2e-v2/cases/menu/banyandb/e2e.yaml

View File

@ -68,6 +68,10 @@
* Add Service Hierarchy auto matching layer relationships (upper -> lower) as following:
- KAFKA -> K8S_SERVICE
- VIRTUAL_MQ -> KAFKA
* Support ClickHouse server monitoring.
* Add Service Hierarchy auto matching layer relationships (upper -> lower) as following:
- CLICKHOUSE -> K8S_SERVICE
- VIRTUAL_DATABASE -> CLICKHOUSE
#### UI

View File

@ -31,6 +31,9 @@ If you want to customize it according to your own needs, please refer to [Servic
| VIRTUAL_MQ | RABBITMQ | [VIRTUAL_MQ On RABBITMQ](#virtual_mq-on-rabbitmq) |
| VIRTUAL_MQ | ROCKETMQ | [VIRTUAL_MQ On K8S_SERVICE](#virtual_mq-on-rocketmq) |
| VIRTUAL_MQ | KAFKA | [VIRTUAL_MQ On KAFKA](#virtual_mq-on-kafka) |
| VIRTUAL_MQ | RABBITMQ | [VIRTUAL_MQ On RABBITMQ](#virtual_mq-on-rabbitmq) |
| CLICKHOUSE | K8S_SERVICE | [CLICKHOUSE On K8S_SERVICE](#clickhouse-on-k8s_service) |
| VIRTUAL_DATABASE | CLICKHOUSE | [VIRTUAL_DATABASE On CLICKHOUSE](#virtual_database-on-clickhouse) |
- The following sections will describe the **default matching rules** in detail and use the `upper-layer On lower-layer` format.
- The example service name are based on SkyWalking [Showcase](https://github.com/apache/skywalking-showcase) default deployment.
@ -180,6 +183,22 @@ If you want to customize it according to your own needs, please refer to [Servic
- VIRTUAL_MQ.service.name: `kafka.skywalking-showcase.svc.cluster.local:9092`
- KAFKA.service.name: `kafka::rocketmq.skywalking-showcase`
#### CLICKHOUSE On K8S_SERVICE
- Rule name: `short-name`
- Groovy script: `{ (u, l) -> u.shortName == l.shortName }`
- Description: CLICKHOUSE.service.shortName == K8S_SERVICE.service.shortName
- Matched Example:
- CLICKHOUSE.service.name: `clickhouse::clickhouse.skywalking-showcase`
- K8S_SERVICE.service.name: `skywalking-showcase::clickhouse.skywalking-showcase`
#### VIRTUAL_DATABASE On CLICKHOUSE
- Rule name: `lower-short-name-with-fqdn`
- Groovy script: `{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }`
- Description: VIRTUAL_DATABASE.service.shortName remove port == CLICKHOUSE.service.shortName with fqdn suffix
- Matched Example:
- VIRTUAL_DATABASE.service.name: `clickhouse.skywalking-showcase.svc.cluster.local:8123`
- CLICKHOUSE.service.name: `clickhouse::clickhouse.skywalking-showcase`
### Build Through Specific Agents
Use agent tech involved(such as eBPF) and deployment tools(such as operator and agent injector) detect the service hierarchy relations.

View File

@ -0,0 +1,140 @@
# ClickHouse monitoring
## ClickHouse server performance from built-in metrics data
SkyWalking leverages ClickHouse built-in metrics data since v20.1.2.4. It leverages OpenTelemetry Collector to transfer
the metrics to
[OpenTelemetry receiver](opentelemetry-receiver.md) and into the [Meter System](./../../concepts-and-designs/meter.md).
### Data flow
1. Configure ClickHouse to expose metrics data for scraping from Prometheus.
2. OpenTelemetry Collector fetches metrics from ClickeHouse server through Prometheus endpoint, and pushes metrics to SkyWalking OAP Server via
OpenTelemetry gRPC exporter.
3. The SkyWalking OAP Server parses the expression with [MAL](../../concepts-and-designs/mal.md) to
filter/calculate/aggregate and store the results.
### Set up
1. Set
up [built-in prometheus endpoint](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#prometheus)
.
2. Set up [OpenTelemetry Collector ](https://opentelemetry.io/docs/collector/getting-started/#docker). For details on
Prometheus Receiver in OpenTelemetry Collector, refer
to [here](../../../../test/e2e-v2/cases/mysql/prometheus-mysql-exporter/otel-collector-config.yaml).
3. Config SkyWalking [OpenTelemetry receiver](opentelemetry-receiver.md).
### ClickHouse Monitoring
ClickHouse monitoring provides monitoring of the metrics 、events and asynchronous_metrics of the ClickHouse server.
ClickHouse cluster is cataloged as a `Layer: CLICKHOUSE` `Service` in OAP. Each ClickHouse server is cataloged as
an `Instance` in OAP.
#### ClickHouse Instance Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | ---------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | ----------- |
| CpuUsage | count | meter_clickhouse_instance_cpu_usage | CPU time spent seen by OS per second(according to ClickHouse.system.dashboard.CPU Usage (cores)). | ClickHouse |
| MemoryUsage | percentage | meter_clickhouse_instance_memory_usage | Total amount of memory (bytes) allocated by the server/ total amount of OS memory. | ClickHouse |
| MemoryAvailable | percentage | meter_clickhouse_instance_memory_available | Total amount of memory (bytes) available for program / total amount of OS memory. | ClickHouse |
| Uptime | sec | meter_clickhouse_instance_uptime | The server uptime in seconds. It includes the time spent for server initialization before accepting connections. | ClickHouse |
| Version | string | meter_clickhouse_instance_version | Version of the server in a single integer number in base-1000. | ClickHouse |
| FileOpen | count | meter_clickhouse_instance_file_open | Number of files opened. | ClickHouse |
#### ClickHouse Network Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- | ----------- |
| TcpConnections | count | meter_clickhouse_instance_tcp_connections<br/>meter_clickhouse_tcp_connections | Number of connections to TCP server. | ClickHouse |
| MysqlConnections | count | meter_clickhouse_instance_mysql_connections<br/>meter_clickhouse_mysql_connections | Number of client connections using MySQL protocol. | ClickHouse |
| HttpConnections | count | meter_clickhouse_instance_http_connections<br/>meter_clickhouse_mysql_connections | Number of connections to HTTP server. | ClickHouse |
| InterserverConnections | count | meter_clickhouse_instance_interserver_connections<br/>meter_clickhouse_interserver_connections | Number of connections from other replicas to fetch parts. | ClickHouse |
| PostgresqlConnections | count | meter_clickhouse_instance_postgresql_connections<br/>meter_clickhouse_postgresql_connections | Number of client connections using PostgreSQL protocol. | ClickHouse |
| ReceiveBytes | bytes | meter_clickhouse_instance_network_receive_bytes<br/>meter_clickhouse_network_receive_bytes | Total number of bytes received from network. | ClickHouse |
| SendBytes | bytes | meter_clickhouse_instance_network_send_bytes<br/>meter_clickhouse_network_send_bytes | Total number of bytes send to network. | ClickHouse |
#### ClickHouse Query Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------- |
| QueryCount | count | meter_clickhouse_instance_query<br/>meter_clickhouse_query | Number of executing queries. | ClickHouse |
| SelectQueryCount | count | meter_clickhouse_instance_query_select<br/>meter_clickhouse_query_select | Number of executing queries, but only for SELECT queries. | ClickHouse |
| InsertQueryCount | count | meter_clickhouse_instance_query_insert<br/>meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
| SelectQueryRate | count/sec | meter_clickhouse_instance_query_select_rate<br/>meter_clickhouse_query_select_rate | Number of SELECT queries per second. | ClickHouse |
| InsertQueryRate | count/sec | meter_clickhouse_instance_query_insert_rate<br/>meter_clickhouse_query_insert_rate | Number of INSERT queries per second. | ClickHouse |
| Querytime | microsec | meter_clickhouse_instance_querytime_microseconds<br/>meter_clickhouse_querytime_microseconds | Total time of all queries. | ClickHouse |
| SelectQuerytime | microsec | meter_clickhouse_instance_querytime_select_microseconds<br/>meter_clickhouse_querytime_select_microseconds | Total time of SELECT queries. | ClickHouse |
| InsertQuerytime | microsec | meter_clickhouse_instance_querytime_insert_microseconds<br/>meter_clickhouse_querytime_insert_microseconds | Total time of INSERT queries. | ClickHouse |
| OtherQuerytime | microsec | meter_clickhouse_instance_querytime_other_microseconds<br/>meter_clickhouse_querytime_other_microseconds | Total time of queries that are not SELECT or INSERT. | ClickHouse |
| QuerySlowCount | count | meter_clickhouse_instance_query_slow<br/>meter_clickhouse_query_slow | Number of reads from a file that were slow. | ClickHouse |
#### ClickHouse Insertion Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ------------------ | ----- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| InsertQueryCount | count | meter_clickhouse_instance_query_insert<br/>meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
| InsertedRowCount | count | meter_clickhouse_instance_inserted_rows<br/>meter_clickhouse_inserted_rows | Number of rows INSERTed to all tables. | ClickHouse |
| InsertedBytes | bytes | meter_clickhouse_instance_inserted_bytes<br/>meter_clickhouse_inserted_bytes | Number of bytes INSERTed to all tables. | ClickHouse |
| DelayedInsertCount | count | meter_clickhouse_instance_delayed_insert<br/>meter_clickhouse_delayed_insert | Number of times the INSERT of a block to a MergeTree table was throttled due to high number of active data parts for partition. | ClickHouse |
#### ClickHouse Replicas Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | ----- | ---------------------------------------------------------------------------------- | ------------------------------------------------ | ----------- |
| ReplicatedChecks | count | meter_clickhouse_instance_replicated_checks<br/>meter_clickhouse_replicated_checks | Number of data parts checking for consistency. | ClickHouse |
| ReplicatedFetch | count | meter_clickhouse_instance_replicated_fetch<br/>meter_clickhouse_replicated_fetch | Number of data parts being fetched from replica. | ClickHouse |
| ReplicatedSend | count | meter_clickhouse_instance_replicated_send<br/>meter_clickhouse_replicated_send | Number of data parts being sent to replicas. | ClickHouse |
#### ClickHouse MergeTree Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| BackgroundMergeCount | count | meter_clickhouse_instance_background_merge<br/>meter_clickhouse_background_merge | Number of executing background merges. | ClickHouse |
| MergeRows | count | meter_clickhouse_instance_merge_rows<br/>meter_clickhouse_merge_rows | Rows read for background merges. This is the number of rows before merge. | ClickHouse |
| MergeUncompressedBytes | bytes | meter_clickhouse_instance_merge_uncompressed_bytes<br/>meter_clickhouse_merge_uncompressed_bytes | Uncompressed bytes (for columns as they stored in memory) that was read for background merges. This is the number before merge. | ClickHouse |
| MoveCount | count | meter_clickhouse_instance_move<br/>meter_clickhouse_move | Number of currently executing moves. | ClickHouse |
| PartsActive | Count | meter_clickhouse_instance_parts_active<br/>meter_clickhouse_parts_active | Active data part, used by current and upcoming SELECTs. | ClickHouse |
| MutationsCount | count | meter_clickhouse_instance_mutations<br/>meter_clickhouse_mutations | Number of mutations (ALTER DELETE/UPDATE). | ClickHouse |
#### ClickHouse Kafka Table Engine Supported Metrics
When [table engine](https://clickhouse.com/docs/en/engines/table-engines/integrations/kafka) works
with [Apache Kafka](http://kafka.apache.org/).
Kafka lets you:
- Publish or subscribe to data flows.
- Organize fault-tolerant storage.
- Process streams as they become available.
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ----------------- | ----- | -------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------- |
| KafkaMessagesRead | count | meter_clickhouse_instance_kafka_messages_read<br/>meter_clickhouse_kafka_messages_read | Number of Kafka messages already processed by ClickHouse. | ClickHouse |
| KafkaWrites | count | meter_clickhouse_instance_kafka_writes<br/>meter_clickhouse_kafka_writes | Number of writes (inserts) to Kafka tables. | ClickHouse |
| KafkaConsumers | count | meter_clickhouse_instance_kafka_consumers<br/>meter_clickhouse_kafka_consumers | Number of active Kafka consumers. | ClickHouse |
| KafkProducers | count | meter_clickhouse_instance_kafka_producers<br/>meter_clickhouse_kafka_producers | Number of active Kafka producer created. | ClickHouse |
#### ClickHouse ZooKeeper Supported Metrics
ClickHouse uses ZooKeeper for storing metadata of replicas when using replicated tables. If replicated tables are not
used, this section of parameters can be omitted.
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| --------------------- | ----- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------- |
| ZookeeperSession | count | meter_clickhouse_instance_zookeeper_session<br/>meter_clickhouse_zookeeper_session | Number of sessions (connections) to ZooKeeper. | ClickHouse |
| ZookeeperWatch | count | meter_clickhouse_instance_zookeeper_watch<br/>meter_clickhouse_zookeeper_watch | Number of watches (event subscriptions) in ZooKeeper. | ClickHouse |
| ZookeeperBytesSent | bytes | meter_clickhouse_instance_zookeeper_bytes_sent<br/>meter_clickhouse_zookeeper_bytes_sent | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
| ZookeeperBytesReceive | bytes | meter_clickhouse_instance_zookeeper_bytes_received<br/>meter_clickhouse_zookeeper_bytes_received | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
### ClickHouse Keeper Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ------------------------ | ----- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ----------- |
| KeeperAliveConnections | count | meter_clickhouse_instance_keeper_connections_alive<br/>meter_clickhouse_keeper_connections_alive | Number of alive connections for embedded ClickHouse Keeper. | ClickHouse |
| KeeperOutstandingRequets | count | meter_clickhouse_instance_keeper_outstanding_requests<br/>meter_clickhouse_keeper_outstanding_requests| Number of outstanding requests for embedded ClickHouse Keeper. | ClickHouse |
### Customizations
You can customize your own metrics/expression/dashboard panel. The metrics definition and expression rules are found
in `/config/otel-rules/clickhouse`. The ClickHouse dashboard panel configurations are found
in `/config/ui-initialized-templates/clickhouse`.

134
docs/en/swip/SWIP-5.md Normal file
View File

@ -0,0 +1,134 @@
# Support ClickHouse Monitoring
## Motivation
ClickHouse is a high-performance, column-oriented SQL database management system (DBMS) for online analytical processing (OLAP). It is available as both an [open-source software](https://github.com/ClickHouse/ClickHouse) and a [cloud offering](https://clickhouse.com/cloud).
Now I want to add ClickHouse monitoring via the OpenTelemetry Collector which fetches metrics from it's own HTTP endpoint to expose metrics data for [Prometheus](https://prometheus.io/) (since ClickHouse v20.1.2.4). Clickhouse Exporter used only for old ClickHouse versions, modern versions have embedded prometheus endpoint.
## Architecture Graph
There is no significant architecture-level change.
## Proposed Changes
`ClickHouse` expose own metrics via HTTP endpoint to opentelemetry collector, using skyWalking openTelemetry receiver to fetch these metrics.
The exposed metrics are from the [system.metrics](https://clickhouse.com/docs/en/operations/system-tables/metrics#system_tables-metrics) table / the [system.events](https://clickhouse.com/docs/en/operations/system-tables/events#system_tables-events) table / the [system.asynchronous_metrics](https://clickhouse.com/docs/en/operations/system-tables/asynchronous_metrics#system_tables-asynchronous_metrics) table.
### ClickHouse Instance Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | ---------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | ----------- |
| CpuUsage | count | meter_clickhouse_instance_cpu_usage | CPU time spent seen by OS per second(according to ClickHouse.system.dashboard.CPU Usage (cores)). | ClickHouse |
| MemoryUsage | percentage | meter_clickhouse_instance_memory_usage | Total amount of memory (bytes) allocated by the server/ total amount of OS memory. | ClickHouse |
| MemoryAvailable | percentage | meter_clickhouse_instance_memory_available | Total amount of memory (bytes) available for program / total amount of OS memory. | ClickHouse |
| Uptime | sec | meter_clickhouse_instance_uptime | The server uptime in seconds. It includes the time spent for server initialization before accepting connections. | ClickHouse |
| Version | string | meter_clickhouse_instance_version | Version of the server in a single integer number in base-1000. | ClickHouse |
| FileOpen | count | meter_clickhouse_instance_file_open | Number of files opened. | ClickHouse |
### ClickHouse Network Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- | ----------- |
| TcpConnections | count | meter_clickhouse_instance_tcp_connections<br/>meter_clickhouse_tcp_connections | Number of connections to TCP server. | ClickHouse |
| MysqlConnections | count | meter_clickhouse_instance_mysql_connections<br/>meter_clickhouse_mysql_connections | Number of client connections using MySQL protocol. | ClickHouse |
| HttpConnections | count | meter_clickhouse_instance_http_connections<br/>meter_clickhouse_mysql_connections | Number of connections to HTTP server. | ClickHouse |
| InterserverConnections | count | meter_clickhouse_instance_interserver_connections<br/>meter_clickhouse_interserver_connections | Number of connections from other replicas to fetch parts. | ClickHouse |
| PostgresqlConnections | count | meter_clickhouse_instance_postgresql_connections<br/>meter_clickhouse_postgresql_connections | Number of client connections using PostgreSQL protocol. | ClickHouse |
| ReceiveBytes | bytes | meter_clickhouse_instance_network_receive_bytes<br/>meter_clickhouse_network_receive_bytes | Total number of bytes received from network. | ClickHouse |
| SendBytes | bytes | meter_clickhouse_instance_network_send_bytes<br/>meter_clickhouse_network_send_bytes | Total number of bytes send to network. | ClickHouse |
### ClickHouse Query Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------- |
| QueryCount | count | meter_clickhouse_instance_query<br/>meter_clickhouse_query | Number of executing queries. | ClickHouse |
| SelectQueryCount | count | meter_clickhouse_instance_query_select<br/>meter_clickhouse_query_select | Number of executing queries, but only for SELECT queries. | ClickHouse |
| InsertQueryCount | count | meter_clickhouse_instance_query_insert<br/>meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
| SelectQueryRate | count/sec | meter_clickhouse_instance_query_select_rate<br/>meter_clickhouse_query_select_rate | Number of SELECT queries per second. | ClickHouse |
| InsertQueryRate | count/sec | meter_clickhouse_instance_query_insert_rate<br/>meter_clickhouse_query_insert_rate | Number of INSERT queries per second. | ClickHouse |
| Querytime | microsec | meter_clickhouse_instance_querytime_microseconds<br/>meter_clickhouse_querytime_microseconds | Total time of all queries. | ClickHouse |
| SelectQuerytime | microsec | meter_clickhouse_instance_querytime_select_microseconds<br/>meter_clickhouse_querytime_select_microseconds | Total time of SELECT queries. | ClickHouse |
| InsertQuerytime | microsec | meter_clickhouse_instance_querytime_insert_microseconds<br/>meter_clickhouse_querytime_insert_microseconds | Total time of INSERT queries. | ClickHouse |
| OtherQuerytime | microsec | meter_clickhouse_instance_querytime_other_microseconds<br/>meter_clickhouse_querytime_other_microseconds | Total time of queries that are not SELECT or INSERT. | ClickHouse |
| QuerySlowCount | count | meter_clickhouse_instance_query_slow<br/>meter_clickhouse_query_slow | Number of reads from a file that were slow. | ClickHouse |
### ClickHouse Insertion Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ------------------ | ----- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| InsertQueryCount | count | meter_clickhouse_instance_query_insert<br/>meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
| InsertedRowCount | count | meter_clickhouse_instance_inserted_rows<br/>meter_clickhouse_inserted_rows | Number of rows INSERTed to all tables. | ClickHouse |
| InsertedBytes | bytes | meter_clickhouse_instance_inserted_bytes<br/>meter_clickhouse_inserted_bytes | Number of bytes INSERTed to all tables. | ClickHouse |
| DelayedInsertCount | count | meter_clickhouse_instance_delayed_insert<br/>meter_clickhouse_delayed_insert | Number of times the INSERT of a block to a MergeTree table was throttled due to high number of active data parts for partition. | ClickHouse |
### ClickHouse Replicas Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------- | ----- | ------------------------------------------------------------ | ------------------------------------------------ | ----------- |
| ReplicatedChecks | count | meter_clickhouse_instance_replicated_checks<br/>meter_clickhouse_replicated_checks | Number of data parts checking for consistency. | ClickHouse |
| ReplicatedFetch | count | meter_clickhouse_instance_replicated_fetch<br/>meter_clickhouse_replicated_fetch | Number of data parts being fetched from replica. | ClickHouse |
| ReplicatedSend | count | meter_clickhouse_instance_replicated_send<br/>meter_clickhouse_replicated_send | Number of data parts being sent to replicas. | ClickHouse |
### ClickHouse MergeTree Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| BackgroundMergeCount | count | meter_clickhouse_instance_background_merge<br/>meter_clickhouse_background_merge | Number of executing background merges. | ClickHouse |
| MergeRows | count | meter_clickhouse_instance_merge_rows<br/>meter_clickhouse_merge_rows | Rows read for background merges. This is the number of rows before merge. | ClickHouse |
| MergeUncompressedBytes | bytes | meter_clickhouse_instance_merge_uncompressed_bytes<br/>meter_clickhouse_merge_uncompressed_bytes | Uncompressed bytes (for columns as they stored in memory) that was read for background merges. This is the number before merge. | ClickHouse |
| MoveCount | count | meter_clickhouse_instance_move<br/>meter_clickhouse_move | Number of currently executing moves. | ClickHouse |
| PartsActive | Count | meter_clickhouse_instance_parts_active<br/>meter_clickhouse_parts_active | Active data part, used by current and upcoming SELECTs. | ClickHouse |
| MutationsCount | count | meter_clickhouse_instance_mutations<br/>meter_clickhouse_mutations | Number of mutations (ALTER DELETE/UPDATE). | ClickHouse |
### ClickHouse Kafka Table Engine Supported Metrics
When [table engine](https://clickhouse.com/docs/en/engines/table-engines/integrations/kafka) works
with [Apache Kafka](http://kafka.apache.org/).
Kafka lets you:
- Publish or subscribe to data flows.
- Organize fault-tolerant storage.
- Process streams as they become available.
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ----------------- | ----- | -------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------- |
| KafkaMessagesRead | count | meter_clickhouse_instance_kafka_messages_read<br/>meter_clickhouse_kafka_messages_read | Number of Kafka messages already processed by ClickHouse. | ClickHouse |
| KafkaWrites | count | meter_clickhouse_instance_kafka_writes<br/>meter_clickhouse_kafka_writes | Number of writes (inserts) to Kafka tables. | ClickHouse |
| KafkaConsumers | count | meter_clickhouse_instance_kafka_consumers<br/>meter_clickhouse_kafka_consumers | Number of active Kafka consumers. | ClickHouse |
| KafkProducers | count | meter_clickhouse_instance_kafka_producers<br/>meter_clickhouse_kafka_producers | Number of active Kafka producer created. | ClickHouse |
### ClickHouse ZooKeeper Supported Metrics
ClickHouse uses ZooKeeper for storing metadata of replicas when using replicated tables. If replicated tables are not
used, this section of parameters can be omitted.
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| --------------------- | ----- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------- |
| ZookeeperSession | count | meter_clickhouse_instance_zookeeper_session<br/>meter_clickhouse_zookeeper_session | Number of sessions (connections) to ZooKeeper. | ClickHouse |
| ZookeeperWatch | count | meter_clickhouse_instance_zookeeper_watch<br/>meter_clickhouse_zookeeper_watch | Number of watches (event subscriptions) in ZooKeeper. | ClickHouse |
| ZookeeperBytesSent | bytes | meter_clickhouse_instance_zookeeper_bytes_sent<br/>meter_clickhouse_zookeeper_bytes_sent | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
| ZookeeperBytesReceive | bytes | meter_clickhouse_instance_zookeeper_bytes_received<br/>meter_clickhouse_zookeeper_bytes_received | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
### ClickHouse Keeper Supported Metrics
[ClickHouse Keeper](https://clickhouse.com/docs/en/guides/sre/keeper/clickhouse-keeper) provides the coordination system for data replication and distributed DDL queries execution. ClickHouse Keeper is compatible with ZooKeeper.
ClickHouse Keeper can work in embedded mode or standalone cluster mode, the metrics below are for embedded mode.
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
| ------------------------ | ----- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ----------- |
| KeeperAliveConnections | count | meter_clickhouse_instance_keeper_connections_alive<br/>meter_clickhouse_keeper_connections_alive | Number of alive connections for embedded ClickHouse Keeper. | ClickHouse |
| KeeperOutstandingRequets | count | meter_clickhouse_instance_keeper_outstanding_requests<br/>meter_clickhouse_keeper_outstanding_requests| Number of outstanding requests for embedded ClickHouse Keeper. | ClickHouse |
## Imported Dependencies libs and their licenses.
No new dependency.
## Compatibility
no breaking changes.
## General usage docs

View File

@ -68,9 +68,11 @@ All accepted and proposed SWIPs could be found in [here](https://github.com/apac
## Known SWIPs
Next SWIP Number: 4
Next SWIP Number: 5
### Accepted SWIPs
- [SWIP-5 Support ClickHouse Monitoring](SWIP-5.md)
- [SWIP-4 Support available layers of service in the topology](SWIP-4.md)
- [SWIP-3 Support RocketMQ Monitoring](SWIP-3.md)
- [SWIP-2 Collecting and Gathering Kubernetes Monitoring Data](SWIP-2.md)

View File

@ -218,7 +218,12 @@ public enum Layer {
/**
* A cloud native messaging and streaming platform, making it simple to build event-driven applications.
*/
ROCKETMQ(35, true);
ROCKETMQ(35, true),
/**
* A high-performance, column-oriented SQL database management system (DBMS) for online analytical processing (OLAP).
*/
CLICKHOUSE(36, true);
private final int value;
/**

View File

@ -73,6 +73,7 @@ public class UITemplateInitializer {
Layer.BOOKKEEPER.name(),
Layer.NGINX.name(),
Layer.ROCKETMQ.name(),
Layer.CLICKHOUSE.name(),
"custom"
};
private final UITemplateManagementService uiTemplateManagementService;

View File

@ -353,7 +353,7 @@ receiver-otel:
selector: ${SW_OTEL_RECEIVER:default}
default:
enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"otlp-metrics,otlp-logs"}
enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*"}
enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*,clickhouse/*"}
receiver-zipkin:
selector: ${SW_RECEIVER_ZIPKIN:-}

View File

@ -54,9 +54,13 @@ hierarchy:
KAFKA:
K8S_SERVICE: short-name
CLICKHOUSE:
K8S_SERVICE: short-name
VIRTUAL_DATABASE:
MYSQL: lower-short-name-with-fqdn
POSTGRESQL: lower-short-name-with-fqdn
CLICKHOUSE: lower-short-name-with-fqdn
VIRTUAL_MQ:
ROCKETMQ: lower-short-name-with-fqdn
@ -91,6 +95,7 @@ layer-levels:
APISIX: 2
NGINX: 2
ROCKETMQ: 2
CLICKHOUSE: 2
RABBITMQ: 2
KAFKA: 2

View File

@ -0,0 +1,178 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This will parse a textual representation of a duration. The formats
# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS}
# with days considered to be exactly 24 hours.
# <p>
# Examples:
# <pre>
# "PT20.345S" -- parses as "20.345 seconds"
# "PT15M" -- parses as "15 minutes" (where a minute is 60 seconds)
# "PT10H" -- parses as "10 hours" (where an hour is 3600 seconds)
# "P2D" -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
# "P2DT3H4M" -- parses as "2 days, 3 hours and 4 minutes"
# "P-6H3M" -- parses as "-6 hours and +3 minutes"
# "-P6H3M" -- parses as "-6 hours and -3 minutes"
# "-P-6H+3M" -- parses as "+6 hours and -3 minutes"
# </pre>
filter: "{ tags -> tags.job_name == 'clickhouse-monitoring' }" # The OpenTelemetry job name
expSuffix: tag({tags -> tags.host_name = 'clickhouse::' + tags.host_name}).instance(['host_name'], ['service_instance_id'], Layer.CLICKHOUSE)
metricPrefix: meter_clickhouse
metricsRules:
# Version of the server in a single integer number in base-1000.
- name: instance_version
exp: ClickHouseMetrics_VersionInteger
# CPU time spent seen by OS.
- name: instance_cpu_usage
exp: ClickHouseProfileEvents_OSCPUVirtualTimeMicroseconds.increase('PT1M')/60
# The percentage of memory (bytes) allocated by the server.
- name: instance_memory_usage
exp: ClickHouseMetrics_MemoryTracking / ClickHouseAsyncMetrics_OSMemoryTotal * 100
# The percentage of memory available to be used by programs.
- name: instance_memory_available
exp: ClickHouseAsyncMetrics_OSMemoryAvailable / ClickHouseAsyncMetrics_OSMemoryTotal * 100
# The server uptime in seconds. It includes the time spent for server initialization before accepting connections.
- name: instance_uptime
exp: ClickHouseAsyncMetrics_Uptime
# Number of files opened per minute.
- name: instance_file_open
exp: ClickHouseProfileEvents_FileOpen.increase('PT1M')
# Network
# Number of connections to TCP server.
- name: instance_tcp_connections
exp: ClickHouseMetrics_TCPConnection
# Number of client connections using MySQL protocol.
- name: instance_mysql_connections
exp: ClickHouseMetrics_MySQLConnection
# Number of connections to HTTP server.
- name: instance_http_connections
exp: ClickHouseMetrics_HTTPConnection
# Number of connections from other replicas to fetch parts.
- name: instance_interserver_connections
exp: ClickHouseMetrics_InterserverConnection
# Number of client connections using PostgreSQL protocol.
- name: instance_postgresql_connections
exp: ClickHouseMetrics_PostgreSQLConnection
# Total number of bytes received from network.
- name: instance_network_receive_bytes
exp: ClickHouseProfileEvents_NetworkReceiveBytes.increase('PT1M')
# Total number of bytes send to network.
- name: instance_network_send_bytes
exp: ClickHouseProfileEvents_NetworkSendBytes.increase('PT1M')
# Query
# Number of executing queries
- name: instance_query
exp: ClickHouseProfileEvents_Query.increase('PT1M')
# Number of executing queries, but only for SELECT queries.
- name: instance_query_select
exp: ClickHouseProfileEvents_SelectQuery.increase('PT1M')
# Number of executing queries, but only for INSERT queries.
- name: instance_query_insert
exp: ClickHouseProfileEvents_InsertQuery.increase('PT1M')
# Number of SELECT queries per second.
- name: instance_query_select_rate
exp: ClickHouseProfileEvents_SelectQuery.rate('PT1M')
# Number of INSERT queries per second.
- name: instance_query_insert_rate
exp: ClickHouseProfileEvents_InsertQuery.rate('PT1M')
# Total time of all queries
- name: instance_querytime_microseconds
exp: ClickHouseProfileEvents_QueryTimeMicroseconds.increase('PT1M')
# Total time of SELECT queries.
- name: instance_querytime_select_microseconds
exp: ClickHouseProfileEvents_SelectQueryTimeMicroseconds.increase('PT1M')
# Total time of INSERT queries.
- name: instance_querytime_insert_microseconds
exp: ClickHouseProfileEvents_InsertQueryTimeMicroseconds.increase('PT1M')
# Total time of queries that are not SELECT or INSERT.
- name: instance_querytime_other_microseconds
exp: ClickHouseProfileEvents_OtherQueryTimeMicroseconds.increase('PT1M')
# Number of reads from a file that were slow.
- name: instance_query_slow
exp: ClickHouseProfileEvents_SlowRead.rate('PT1M')
# Insertion
# Number of rows INSERTed to all tables.
- name: instance_inserted_rows
exp: ClickHouseProfileEvents_InsertedRows.rate('PT1M')
# Number of bytes INSERTed to all tables.
- name: instance_inserted_bytes
exp: ClickHouseProfileEvents_InsertedBytes.rate('PT1M')
# Number of times the INSERT of a block to a MergeTree table was throttled due to high number of active data parts for partition.
- name: instance_delayed_inserts
exp: ClickHouseProfileEvents_DelayedInserts.rate('PT1M')
# Replicas
# Number of data parts checking for consistency.
- name: instance_replicated_checks
exp: ClickHouseMetrics_ReplicatedChecks
# Number of data parts being fetched from replica.
- name: instance_replicated_fetch
exp: ClickHouseMetrics_ReplicatedFetch
# Number of data parts being sent to replicas.
- name: instance_replicated_send
exp: ClickHouseMetrics_ReplicatedSend
# MergeTree
# Number of executing background merges.
- name: instance_background_merge
exp: ClickHouseMetrics_Merge
# Rows read for background merges. This is the number of rows before merge.
- name: instance_merge_rows
exp: ClickHouseProfileEvents_MergedRows.increase('PT1M')
# Uncompressed bytes (for columns as they stored in memory) that was read for background merges. This is the number before merge.
- name : instance_merge_uncompressed_bytes
exp: ClickHouseProfileEvents_MergedUncompressedBytes.increase('PT1M')
# Number of currently executing moves.
- name: instance_move
exp: ClickHouseMetrics_Move
# Active data part, used by current and upcoming SELECTs.
- name: instance_parts_active
exp: ClickHouseMetrics_PartsActive
# Number of mutations (ALTER DELETE/UPDATE).
- name: instance_mutations
exp: ClickHouseMetrics_PartMutation
# Kafka Table Engine
# Number of Kafka messages already processed by ClickHouse.
- name: instance_kafka_messages_read
exp: ClickHouseProfileEvents_KafkaMessagesRead.rate('PT1M')
# Number of writes (inserts) to Kafka tables.
- name: instance_kafka_writes
exp: ClickHouseProfileEvents_KafkaWrites.rate('PT1M')
# Number of active Kafka consumers.
- name: instance_kafka_consumers
exp: ClickHouseMetrics_KafkaConsumers
# Number of active Kafka producer created.
- name: instance_kafka_producers
exp: ClickHouseMetrics_KafkaProducers
# Zookeeper
# Number of sessions (connections) to ZooKeeper. Should be no more than one, because using more than one connection to ZooKeeper may lead to bugs due to lack of linearizability (stale reads) that ZooKeeper consistency model allows.
- name: instance_zookeeper_session
exp: ClickHouseMetrics_ZooKeeperSession
# Number of watches (event subscriptions) in ZooKeeper.
- name: instance_zookeeper_watch
exp: ClickHouseMetrics_ZooKeeperWatch
# Number of bytes send over network while communicating with ZooKeeper.
- name: instance_zookeeper_bytes_sent
exp: ClickHouseProfileEvents_ZooKeeperBytesSent.rate('PT1M')
# Number of bytes received over network while communicating with ZooKeeper.
- name: instance_zookeeper_bytes_received
exp: ClickHouseProfileEvents_ZooKeeperBytesReceived.rate('PT1M')
# ClickHouse Keeper
# Number of alive connections for embedded ClickHouse Keeper.
- name: instance_keeper_connections_alive
exp: ClickHouseMetrics_KeeperAliveConnections
# Number of outstanding requests for embedded ClickHouse Keeper.
- name: instance_keeper_outstanding_requests
exp: ClickHouseMetrics_KeeperOutstandingRequets

View File

@ -0,0 +1,162 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This will parse a textual representation of a duration. The formats
# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS}
# with days considered to be exactly 24 hours.
# <p>
# Examples:
# <pre>
# "PT20.345S" -- parses as "20.345 seconds"
# "PT15M" -- parses as "15 minutes" (where a minute is 60 seconds)
# "PT10H" -- parses as "10 hours" (where an hour is 3600 seconds)
# "P2D" -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
# "P2DT3H4M" -- parses as "2 days, 3 hours and 4 minutes"
# "P-6H3M" -- parses as "-6 hours and +3 minutes"
# "-P6H3M" -- parses as "-6 hours and -3 minutes"
# "-P-6H+3M" -- parses as "+6 hours and -3 minutes"
# </pre>
filter: "{ tags -> tags.job_name == 'clickhouse-monitoring' }" # The OpenTelemetry job name
expSuffix: tag({tags -> tags.host_name = 'clickhouse::' + tags.host_name}).service(['host_name'] , Layer.CLICKHOUSE)
metricPrefix: meter_clickhouse
metricsRules:
# Number of files opened per minute.
- name: file_open
exp: ClickHouseProfileEvents_FileOpen.sum(['host_name','service_instance_id']).increase('PT1M')
# Network
# Number of connections to TCP server.
- name: tcp_connections
exp: ClickHouseMetrics_TCPConnection.sum(['host_name','service_instance_id'])
# Number of client connections using MySQL protocol.
- name: mysql_connections
exp: ClickHouseMetrics_MySQLConnection.sum(['host_name','service_instance_id'])
# Number of connections to HTTP server.
- name: http_connections
exp: ClickHouseMetrics_HTTPConnection.sum(['host_name','service_instance_id'])
# Number of connections from other replicas to fetch parts.
- name: interserver_connections
exp: ClickHouseMetrics_InterserverConnection.sum(['host_name','service_instance_id'])
# Number of client connections using PostgreSQL protocol.
- name: postgresql_connections
exp: ClickHouseMetrics_PostgreSQLConnection.sum(['host_name','service_instance_id'])
# Total number of bytes received from network.
- name: network_receive_bytes
exp: ClickHouseProfileEvents_NetworkReceiveBytes.sum(['host_name','service_instance_id']).increase('PT1M')
# Total number of bytes send to network.
- name: network_send_bytes
exp: ClickHouseProfileEvents_NetworkSendBytes.sum(['host_name','service_instance_id']).increase('PT1M')
# Query
# Number of executing queries.
- name: query
exp: ClickHouseProfileEvents_Query.sum(['host_name','service_instance_id']).increase('PT1M')
# Number of executing queries, but only for SELECT queries.
- name: query_select
exp: ClickHouseProfileEvents_SelectQuery.sum(['host_name','service_instance_id']).increase('PT1M')
# Number of executing queries, but only for INSERT queries.
- name: query_insert
exp: ClickHouseProfileEvents_InsertQuery.sum(['host_name','service_instance_id']).increase('PT1M')
# Number of SELECT queries per second.
- name: query_select_rate
exp: ClickHouseProfileEvents_SelectQuery.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of INSERT queries per second.
- name: query_insert_rate
exp: ClickHouseProfileEvents_InsertQuery.sum(['host_name','service_instance_id']).rate('PT1M')
# Total time of all queries
- name: querytime_microseconds
exp: ClickHouseProfileEvents_QueryTimeMicroseconds.sum(['host_name','service_instance_id']).increase('PT1M')
# Total time of SELECT queries.
- name: querytime_select_microseconds
exp: ClickHouseProfileEvents_SelectQueryTimeMicroseconds.sum(['host_name','service_instance_id']).increase('PT1M')
# Total time of INSERT queries.
- name: querytime_insert_microseconds
exp: ClickHouseProfileEvents_InsertQueryTimeMicroseconds.sum(['host_name','service_instance_id']).increase('PT1M')
# Total time of queries that are not SELECT or INSERT.
- name: querytime_other_microseconds
exp: ClickHouseProfileEvents_OtherQueryTimeMicroseconds.sum(['host_name','service_instance_id']).increase('PT1M')
# Number of reads from a file that were slow.
- name: query_slow
exp: ClickHouseProfileEvents_SlowRead.sum(['host_name','service_instance_id']).rate('PT1M')
# Insertion
# Number of rows INSERTed to all tables.
- name: inserted_rows
exp: ClickHouseProfileEvents_InsertedRows.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of bytes INSERTed to all tables.
- name: inserted_bytes
exp: ClickHouseProfileEvents_InsertedBytes.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of times the INSERT of a block to a MergeTree table was throttled due to high number of active data parts for partition.
- name: delayed_inserts
exp: ClickHouseProfileEvents_DelayedInserts.sum(['host_name','service_instance_id']).rate('PT1M')
# Replicas
# Number of data parts checking for consistency.
- name: replicated_checks
exp: ClickHouseMetrics_ReplicatedChecks.sum(['host_name','service_instance_id'])
# Number of data parts being fetched from replica.
- name: replicated_fetch
exp: ClickHouseMetrics_ReplicatedFetch.sum(['host_name','service_instance_id'])
# Number of data parts being sent to replicas.
- name: replicated_send
exp: ClickHouseMetrics_ReplicatedSend.sum(['host_name','service_instance_id'])
# MergeTree
# Number of executing background merges.
- name: background_merge
exp: ClickHouseMetrics_Merge.sum(['host_name','service_instance_id'])
# Rows read for background merges. This is the number of rows before merge.
- name: merge_rows
exp: ClickHouseProfileEvents_MergedRows.sum(['host_name','service_instance_id']).increase('PT1M')
# Uncompressed bytes (for columns as they stored in memory) that was read for background merges. This is the number before merge.
- name: merge_uncompressed_bytes
exp: ClickHouseProfileEvents_MergedUncompressedBytes.sum(['host_name','service_instance_id']).increase('PT1M')
# Number of currently executing moves.
- name: move
exp: ClickHouseMetrics_Move.sum(['host_name','service_instance_id'])
# Active data part, used by current and upcoming SELECTs.
- name: parts_active
exp: ClickHouseMetrics_PartsActive.sum(['host_name','service_instance_id'])
# Number of mutations (ALTER DELETE/UPDATE)
- name: mutations
exp: ClickHouseMetrics_PartMutation.sum(['host_name','service_instance_id'])
# Kafka Table Engine
# Number of Kafka messages already processed by ClickHouse.
- name: kafka_messages_read
exp: ClickHouseProfileEvents_KafkaMessagesRead.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of writes (inserts) to Kafka tables.
- name: kafka_writes
exp: ClickHouseProfileEvents_KafkaWrites.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of active Kafka consumers.
- name: kafka_consumers
exp: ClickHouseMetrics_KafkaConsumers.sum(['host_name','service_instance_id'])
# Number of active Kafka producer created.
- name: kafka_producers
exp: ClickHouseMetrics_KafkaProducers.sum(['host_name','service_instance_id'])
# Zookeeper
# Number of sessions (connections) to ZooKeeper. Should be no more than one, because using more than one connection to ZooKeeper may lead to bugs due to lack of linearizability (stale reads) that ZooKeeper consistency model allows
- name: zookeeper_session
exp: ClickHouseMetrics_ZooKeeperSession.sum(['host_name','service_instance_id'])
# Number of watches (event subscriptions) in ZooKeeper.
- name: zookeeper_watch
exp: ClickHouseMetrics_ZooKeeperWatch.sum(['host_name','service_instance_id'])
# Number of bytes send over network while communicating with ZooKeeper.
- name: zookeeper_bytes_sent
exp: ClickHouseProfileEvents_ZooKeeperBytesSent.sum(['host_name','service_instance_id']).rate('PT1M')
# Number of bytes received over network while communicating with ZooKeeper.
- name: zookeeper_bytes_received
exp: ClickHouseProfileEvents_ZooKeeperBytesReceived.sum(['host_name','service_instance_id']).rate('PT1M')
# ClickHouse Keeper
# Number of alive connections for embedded ClickHouse Keeper.
- name: keeper_connections_alive
exp: ClickHouseMetrics_KeeperAliveConnections.sum(['host_name','service_instance_id'])
# Number of outstanding requests for embedded ClickHouse Keeper.
- name: keeper_outstanding_requests
exp: ClickHouseMetrics_KeeperOutstandingRequets.sum(['host_name','service_instance_id'])

View File

@ -0,0 +1,897 @@
[{
"id": "clickhouse-instance",
"configuration": {
"children": [
{
"x": 0,
"y": 0,
"w": 6,
"h": 9,
"i": "0",
"type": "Widget",
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Instance Uptime(day)",
"name": "InstanceUptime",
"tips": "The server uptime in days"
},
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_uptime)/3600/24"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"metricConfig": [
{
"unit": "day",
"label": "Uptime(day)"
}
],
"id": "0",
"moved": false
},
{
"x": 6,
"y": 0,
"w": 6,
"h": 9,
"i": "1",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_file_open)"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Files Opened",
"name": "FilesOpened",
"tips": "Number of files opened in a minute"
},
"metricConfig": [
{
"label": "Files Opened",
"unit": "/min"
}
],
"id": "1",
"moved": false
},
{
"x": 12,
"y": 0,
"w": 6,
"h": 9,
"i": "2",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_cpu_usage/1000000"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "CPU usage(cores)",
"name": "CPU",
"tips": "CPU time spent seen by OS"
},
"metricConfig": [
{
"label": "CPU usage"
}
],
"id": "2",
"moved": false
},
{
"x": 18,
"y": 0,
"w": 6,
"h": 9,
"i": "3",
"type": "Widget",
"graph": {
"type": "Area",
"opacity": 0.4,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Memory(%)",
"name": "Memory",
"tips": "The percentage of memory (bytes) allocated/available by the server"
},
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_memory_usage",
"meter_clickhouse_instance_memory_available"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"metricConfig": [
{
"unit": "%",
"label": "Memory Usage(%)"
},
{
"unit": "%",
"label": "Memory Available(%)"
}
],
"id": "3",
"moved": false,
"metrics": [],
"metricTypes": []
},
{
"x": 0,
"y": 9,
"w": 6,
"h": 9,
"i": "4",
"type": "Widget",
"id": "4",
"metricTypes": [],
"metrics": [],
"metricMode": "Expression",
"moved": false,
"expressions": [
"latest(meter_clickhouse_instance_version)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"name": "InstanceVersion",
"title": "Instance Version",
"tips": "The version of the ClickHouse instance(format in base-1000, 11022033 means version 11.22.33)."
}
},
{
"x": 6,
"y": 9,
"w": 6,
"h": 9,
"i": "5",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_network_receive_bytes",
"meter_clickhouse_instance_network_send_bytes"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Network I/O(B)",
"name": "Network",
"tips": "Total number of bytes received from network or send to network"
},
"metricConfig": [
{
"unit": "Bytes",
"label": "Receive Bytes"
},
{
"unit": "Bytes",
"label": "Send Bytes"
}
],
"id": "5",
"moved": false
},
{
"x": 12,
"y": 9,
"w": 12,
"h": 9,
"i": "6",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_tcp_connections",
"meter_clickhouse_instance_http_connections"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "HTTP/TCP Connections",
"name": "HTTPTCPConnections",
"tips": "Number of connections to HTTP/TCP server"
},
"metricConfig": [
{
"label": "TCP Connections"
},
{
"label": "HTTP Connections"
}
],
"id": "6",
"moved": false
},
{
"x": 0,
"y": 18,
"w": 6,
"h": 9,
"i": "7",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_query",
"meter_clickhouse_instance_query_select",
"meter_clickhouse_instance_query_insert"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Area",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Query",
"name": "Query",
"tips": "Number of executing queries"
},
"metricConfig": [
{
"label": "Query"
},
{
"label": "Select Query"
},
{
"label": "Insert Query"
}
],
"id": "7",
"moved": false
},
{
"x": 6,
"y": 18,
"w": 6,
"h": 9,
"i": "8",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_query_select_rate",
"meter_clickhouse_instance_query_insert_rate"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "QPS",
"name": "QPS",
"tips": "Queries per seconds"
},
"metricConfig": [
{
"label": "QPS(select)"
},
{
"label": "QPS(insert)"
}
],
"id": "8",
"moved": false
},
{
"x": 12,
"y": 18,
"w": 6,
"h": 9,
"i": "9",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_querytime_microseconds/meter_clickhouse_instance_query/1000",
"meter_clickhouse_instance_querytime_select_microseconds/meter_clickhouse_instance_query_select/1000",
"meter_clickhouse_instance_querytime_insert_microseconds/meter_clickhouse_instance_query_insert/1000"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Area",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "QueryTime(ms)",
"name": "QueryTime",
"tips": "The avg query time of each query in milliseconds"
},
"metricConfig": [
{
"unit": "ms",
"label": "QueryTime(all)"
},
{
"unit": "ms",
"label": "QueryTime(select)"
},
{
"unit": "ms",
"label": "QueryTime(insert)"
}
],
"id": "9",
"moved": false
},
{
"x": 18,
"y": 18,
"w": 6,
"h": 9,
"i": "10",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_query_slow"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "File SlowRead",
"name": "FileSlowRead",
"tips": "Number of reads from a file that were slow"
},
"metricConfig": [
{
"label": "File SlowRead"
}
],
"id": "10",
"moved": false
},
{
"x": 0,
"y": 27,
"w": 12,
"h": 9,
"i": "11",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_background_merge"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Merge",
"name": "Merge",
"tips": "Number of executing background merges"
},
"metricConfig": [
{
"label": "Merge"
}
],
"id": "11",
"moved": false
},
{
"x": 12,
"y": 27,
"w": 12,
"h": 9,
"i": "12",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_mutations"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Mutations",
"name": "Mutations",
"tips": "Number of mutations (ALTER DELETE/UPDATE)"
},
"metricConfig": [
{
"label": "Mutations"
}
],
"id": "12",
"moved": false
},
{
"x": 0,
"y": 36,
"w": 8,
"h": 9,
"i": "13",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_inserted_bytes"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Inserted bytes(b/s)",
"name": "InsertedBytes",
"tips": "Number of bytes inserted to all tables per second"
},
"metricConfig": [
{
"label": "Inserted bytes"
}
],
"id": "13",
"moved": false
},
{
"x": 8,
"y": 36,
"w": 8,
"h": 9,
"i": "14",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_inserted_rows"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Inserted rows",
"name": "InsertedRows",
"tips": "Number of rows inserted to all tables per second"
},
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "Inserted rows(s)"
}
],
"id": "14",
"moved": false
},
{
"x": 16,
"y": 36,
"w": 8,
"h": 9,
"i": "15",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_delayed_inserts"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Delayed Inserts(s)",
"name": "DelayedInserts",
"tips": "Number of times the insert of a block to a MergeTree table was throttled due to high number of active data parts for partition"
},
"metricConfig": [
{
"label": "Delayed Inserts(s)"
}
],
"id": "15",
"moved": false
},
{
"x": 0,
"y": 45,
"w": 8,
"h": 9,
"i": "16",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_replicated_checks"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Data Parts Consistency",
"name": "DataPartsConsistency",
"tips": "Number of data parts checking for consistency"
},
"metricConfig": [
{
"label": "Data Parts Consistency"
}
],
"id": "16",
"moved": false
},
{
"x": 8,
"y": 45,
"w": 8,
"h": 9,
"i": "17",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_replicated_fetch",
"meter_clickhouse_instance_replicated_send"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "ReplicatedFetch & Send",
"name": "ReplicatedFetchSend",
"tips": "Number of data parts being fetched from replica, and number of data parts being sent to replicas"
},
"metricConfig": [
{
"label": "Replicated Fetch"
},
{
"label": "Replicated Send"
}
],
"id": "17",
"moved": false
},
{
"x": 16,
"y": 45,
"w": 8,
"h": 9,
"i": "18",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_parts_active"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Data Parts Active",
"name": "DataPartsActive",
"tips": "Active data part, used by current and upcoming SELECTs"
},
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "Data Parts Active"
}
],
"id": "18",
"moved": false
},
{
"x": 0,
"y": 54,
"w": 3,
"h": 9,
"i": "19",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_zookeeper_session)"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Zookeeper Sessions",
"name": "ZookeeperSessions",
"tips": "Number of sessions (connections) to ZooKeeper"
},
"metricConfig": [
{
"label": "Zookeeper Sessions"
}
],
"id": "19",
"moved": false
},
{
"x": 3,
"y": 54,
"w": 3,
"h": 9,
"i": "20",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_zookeeper_watch)"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Zookeeper Watches",
"name": "ZookeeperWatches",
"tips": "Number of watches (event subscriptions) in ZooKeeper"
},
"metricConfig": [
{
"label": "Zookeeper Watches"
}
],
"id": "20",
"moved": false
},
{
"x": 6,
"y": 54,
"w": 6,
"h": 9,
"i": "21",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"meter_clickhouse_instance_zookeeper_bytes_sent",
"meter_clickhouse_instance_zookeeper_bytes_received"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Zookeeper Bytes Received & Send(b/s)",
"name": "ZookeeperBytesReceivedSend",
"tips": "Number of bytes received and send over network while communicating with ZooKeeper"
},
"metricConfig": [
{
"unit": "Bytes",
"label": "Sent Bytes"
},
{
"unit": "Bytes",
"label": "Receive Bytes"
}
],
"id": "21",
"moved": false
},
{
"x": 12,
"y": 54,
"w": 6,
"h": 9,
"i": "22",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_keeper_connections_alive)"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Keeper Alive Connections",
"name": "KeeperAliveConnections",
"tips": "Number of alive connections for embedded ClickHouse Keeper"
},
"metricConfig": [
{
"label": "Keeper Alive Connections"
}
],
"id": "22",
"moved": false
},
{
"x": 18,
"y": 54,
"w": 6,
"h": 9,
"i": "23",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(meter_clickhouse_instance_keeper_outstanding_requests)"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"widget": {
"title": "Keeper Outstanding Requests",
"name": "KeeperOutstandingRequests",
"tips": "Number of outstanding requests for embedded ClickHouse Keeper"
},
"metricConfig": [
{
"label": "Keeper Outstanding Requests"
}
],
"id": "23",
"moved": false
}
],
"layer": "CLICKHOUSE",
"entity": "ServiceInstance",
"name": "ClickHouse-Instance",
"id": "clickhouse-instance",
"isRoot": false
}
}]

View File

@ -0,0 +1,47 @@
[
{
"id": "clickhouse-root",
"configuration": {
"children": [
{
"x": 0,
"y": 3,
"w": 24,
"h": 43,
"i": "0",
"type": "Widget",
"graph": {
"type": "ServiceList",
"dashboardName": "ClickHouse-Service",
"fontSize": 12,
"showXAxis": false,
"showYAxis": false,
"showGroup": true
},
"metricMode": "Expression"
},
{
"x": 0,
"y": 0,
"w": 24,
"h": 3,
"i": "1",
"type": "Text",
"graph": {
"fontColor": "theme",
"backgroundColor": "theme",
"content": "Provide ClickHouse Server monitoring through OpenTelemetry's Prometheus Receiver",
"fontSize": 14,
"textAlign": "left",
"url": "https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-clickhouse-monitoring/"
}
}
],
"layer": "CLICKHOUSE",
"entity": "All",
"name": "ClickHouse-Root",
"id": "clickhouse-root",
"isRoot": true
}
}
]

View File

@ -0,0 +1,806 @@
[{
"id": "clickhouse-service",
"configuration": {
"children": [
{
"x": 0,
"y": 0,
"w": 24,
"h": 45,
"i": "0",
"type": "Tab",
"children": [
{
"name": "Inspections",
"children": [
{
"x": 0,
"y": 0,
"w": 8,
"h": 9,
"i": "1",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(aggregate_labels(meter_clickhouse_file_open,sum))"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
},
"metricConfig": [
{
"label": "File Open",
"unit": "/min"
}
],
"widget": {
"title": "File Open",
"name": "FileOpen",
"tips": "Number of files opened in a minute"
},
"id": "0-0-0",
"moved": false
},
{
"x": 8,
"y": 0,
"w": 8,
"h": 9,
"i": "2",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_query,sum)",
"aggregate_labels(meter_clickhouse_query_select,sum)",
"aggregate_labels(meter_clickhouse_query_insert,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Area",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Query",
"name": "Query",
"tips": "Number of executing queries"
},
"metricConfig": [
{
"label": "Query"
},
{
"label": "Select Query"
},
{
"label": "Insert Query"
}
],
"id": "0-0-1",
"moved": false
},
{
"x": 16,
"y": 0,
"w": 8,
"h": 9,
"i": "3",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_querytime_microseconds,sum)/aggregate_labels(meter_clickhouse_query,sum)/1000",
"aggregate_labels(meter_clickhouse_querytime_select_microseconds,sum)/aggregate_labels(meter_clickhouse_query_select,sum)/1000",
"aggregate_labels(meter_clickhouse_querytime_insert_microseconds,sum)/aggregate_labels(meter_clickhouse_query_insert,sum)/1000"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Area",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "QueryTime(ms)",
"name": "QueryTime",
"tips": "The avg query time of each query in milliseconds"
},
"metricConfig": [
{
"unit": "ms",
"label": "QueryTime"
},
{
"unit": "ms",
"label": "QueryTime(select)"
},
{
"unit": "ms",
"label": "QueryTime(insert)"
}
],
"id": "0-0-2",
"moved": false
},
{
"x": 0,
"y": 9,
"w": 8,
"h": 9,
"i": "4",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_tcp_connections,sum)",
"aggregate_labels(meter_clickhouse_http_connections,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "HTTP/TCP Connections",
"name": "HTTPTCPConnections",
"tips": "Number of connections to HTTP/TCP server"
},
"metricConfig": [
{
"label": "TCP Connections"
},
{
"label": "HTTP Connections"
}
],
"id": "0-0-3",
"moved": false
},
{
"x": 8,
"y": 9,
"w": 8,
"h": 9,
"i": "5",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_query_select_rate,sum)",
"aggregate_labels(meter_clickhouse_query_insert_rate,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "QPS",
"name": "QPS",
"tips": "Queries per seconds"
},
"metricConfig": [
{
"label": "QPS(select)"
},
{
"label": "QPS(insert)"
}
],
"id": "0-0-4",
"moved": false
},
{
"x": 16,
"y": 9,
"w": 8,
"h": 9,
"i": "6",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_query_slow,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "File SlowRead",
"name": "FileSlowRead",
"tips": "Number of reads from a file that were slow"
},
"metricConfig": [
{
"label": "File SlowRead"
}
],
"id": "0-0-5",
"moved": false
},
{
"x": 0,
"y": 18,
"w": 12,
"h": 9,
"i": "7",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_background_merge,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Merge",
"name": "Merge",
"tips": "Number of executing background merges"
},
"metricConfig": [
{
"label": "Merge"
}
],
"id": "0-0-6",
"moved": false
},
{
"x": 12,
"y": 18,
"w": 12,
"h": 9,
"i": "8",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_mutations,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Mutations",
"name": "Mutations",
"tips": "Number of mutations (ALTER DELETE/UPDATE)"
},
"metricConfig": [
{
"label": "Mutations"
}
],
"id": "0-0-7",
"moved": false
},
{
"x": 0,
"y": 27,
"w": 6,
"h": 9,
"i": "9",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_query_insert,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Insert Query(s)",
"name": "InsertQuery",
"tips": "Insert queries executing per second"
},
"metricConfig": [
{
"label": "Insert Query(s)"
}
],
"id": "0-0-8",
"moved": false
},
{
"x": 6,
"y": 27,
"w": 6,
"h": 9,
"i": "10",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_inserted_bytes,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Inserted bytes(s)",
"name": "InsertedBytes",
"tips": "Number of bytes inserted to all tables per second"
},
"metricConfig": [
{
"label": "Inserted bytes(s)"
}
],
"id": "0-0-9",
"moved": false
},
{
"x": 12,
"y": 27,
"w": 6,
"h": 9,
"i": "11",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_inserted_rows,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Inserted rows(s)",
"name": "InsertedRows",
"tips": "Number of rows inserted to all tables per second"
},
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "Inserted rows(s)"
}
],
"id": "0-0-10",
"moved": false
},
{
"x": 18,
"y": 27,
"w": 6,
"h": 9,
"i": "12",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_delayed_inserts,sum)"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Delayed Inserts(s)",
"name": "DelayedInserts",
"tips": "Number of times the insert of a block to a MergeTree table was throttled due to high number of active data parts for partition"
},
"metricConfig": [
{
"label": "Delayed Inserts(s)"
}
],
"id": "0-0-11",
"moved": false
},
{
"x": 0,
"y": 36,
"w": 8,
"h": 9,
"i": "13",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_replicated_checks,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "Data Parts Consistency",
"name": "DataPartsConsistency",
"tips": "Number of data parts checking for consistency"
},
"metricConfig": [
{
"label": "Data Parts Consistency"
}
],
"id": "0-0-12",
"moved": false
},
{
"x": 8,
"y": 36,
"w": 8,
"h": 9,
"i": "14",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_replicated_fetch,sum)",
"aggregate_labels(meter_clickhouse_replicated_send,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"widget": {
"title": "ReplicatedFetch & Send",
"name": "ReplicatedFetchSend",
"tips": "Number of data parts being fetched from replica, and number of data parts being sent to replicas"
},
"metricConfig": [
{
"label": "Replicated Fetch"
},
{
"label": "Replicated Send"
}
],
"id": "0-0-13",
"moved": false
},
{
"x": 16,
"y": 36,
"w": 8,
"h": 9,
"i": "15",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_parts_active,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES"
],
"widget": {
"title": "Data Parts Active",
"name": "DataPartsActive",
"tips": "Active data part, used by current and upcoming SELECTs"
},
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "Data Parts Active"
}
],
"id": "0-0-14",
"moved": false
},
{
"x": 0,
"y": 45,
"w": 3,
"h": 9,
"i": "16",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(aggregate_labels(meter_clickhouse_zookeeper_session,sum))"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"metricConfig": [
{
"label": "Zookeeper Sessions"
}
],
"widget": {
"name": "ZookeeperSessions",
"title": "Zookeeper Sessions",
"tips": "Number of sessions (connections) to ZooKeeper"
},
"id": "0-0-15",
"moved": false,
"metrics": [],
"metricTypes": [],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
}
},
{
"x": 3,
"y": 45,
"w": 3,
"h": 9,
"i": "17",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(aggregate_labels(meter_clickhouse_zookeeper_watch,sum))"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"widget": {
"name": "ZookeeperWatches",
"title": "Zookeeper Watches",
"tips": "Number of watches (event subscriptions) in ZooKeeper"
},
"id": "0-0-16",
"moved": false,
"metrics": [],
"metricTypes": [],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center",
"showUnit": true
}
},
{
"x": 6,
"y": 45,
"w": 6,
"h": 9,
"i": "18",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"aggregate_labels(meter_clickhouse_zookeeper_bytes_sent,sum)",
"aggregate_labels(meter_clickhouse_zookeeper_bytes_received,sum)"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
],
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "Sent Bytes",
"unit": "Bytes"
},
{
"unit": "Bytes",
"label": "Receive Bytes"
}
],
"widget": {
"name": "ZookeeperBytesReceivedSend",
"title": "Zookeeper Bytes Received & Send(b/s)",
"tips": "Number of bytes received and send over network while communicating with ZooKeeper"
},
"id": "0-0-17",
"moved": false,
"metrics": [],
"metricTypes": []
},
{
"x": 12,
"y": 45,
"w": 6,
"h": 9,
"i": "19",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(aggregate_labels(meter_clickhouse_keeper_connections_alive,sum))"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center"
},
"widget": {
"title": "Keeper Alive Connections",
"name": "KeeperAliveConnections",
"tips": "Number of alive connections for embedded ClickHouse Keeper"
},
"metricConfig": [
{
"label": "Keeper Alive Connections"
}
],
"id": "0-0-18",
"moved": false
},
{
"x": 18,
"y": 45,
"w": 6,
"h": 9,
"i": "20",
"type": "Widget",
"metricMode": "Expression",
"expressions": [
"latest(aggregate_labels(meter_clickhouse_keeper_outstanding_requests,sum))"
],
"typesOfMQE": [
"SINGLE_VALUE"
],
"graph": {
"type": "Card",
"fontSize": 24,
"textAlign": "center"
},
"widget": {
"title": "Keeper Outstanding Requests",
"name": "KeeperOutstandingRequests",
"tips": "Number of outstanding requests for embedded ClickHouse Keeper"
},
"metricConfig": [
{
"label": "Keeper Outstanding Requests"
}
],
"id": "0-0-19",
"moved": false
}
]
},
{
"name": "Instances",
"children": [
{
"x": 0,
"y": 0,
"w": 24,
"h": 17,
"type": "Widget",
"metricMode": "Expression",
"expressions": [
""
],
"typesOfMQE": [
""
],
"graph": {
"type": "InstanceList",
"dashboardName": "ClickHouse-Instance",
"fontSize": 12
},
"id": "0-1-1",
"moved": false
}
]
}
],
"id": "0",
"activedTabIndex": 0,
"moved": false
}
],
"layer": "CLICKHOUSE",
"entity": "Service",
"name": "ClickHouse-Service",
"id": "clickhouse-service",
"isRoot": false,
"isDefault": true,
"expressions": [
"aggregate_labels(meter_clickhouse_query_select_rate,sum)",
"aggregate_labels(meter_clickhouse_query_insert_rate,sum)"
],
"expressionsConfig": [
{
"unit": "rows / s",
"label": "Select"
},
{
"unit": "rows / s",
"label": "Insert"
}
]
}
}]

View File

@ -188,6 +188,11 @@ menus:
description: Provide BookKeeper monitoring through OpenTelemetry's Prometheus Receiver.
documentLink: https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-bookkeeper-monitoring/
i18nKey: database_bookkeeper
- title: ClickHouse
layer: CLICKHOUSE
description: Provide ClickHouse Server monitoring through OpenTelemetry's Prometheus Receiver.
documentLink: https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-clickhouse-monitoring/
i18nKey: database_clickhouse
- title: Message Queue
icon: mq
description: A message queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures.

View File

@ -0,0 +1,200 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is used to show how to write configuration files and can be used to test.
cases:
# service list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
expected: expected/service.yml
# service metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_tcp_connections --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_mysql_connections --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_http_connections --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_postgresql_connections --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_network_receive_bytes --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_network_send_bytes --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query_select --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query_insert --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query_select_rate --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query_insert_rate --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_querytime_microseconds --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_querytime_select_microseconds --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_querytime_insert_microseconds --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_querytime_other_microseconds --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_query_slow --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_inserted_rows --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_inserted_bytes --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_delayed_inserts --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_replicated_checks --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_replicated_fetch --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_background_merge --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_merge_rows --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_parts_active --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_mutations --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_kafka_messages_read --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_kafka_writes --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_kafka_consumers --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_kafka_producers --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_zookeeper_session --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_zookeeper_watch --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_zookeeper_bytes_sent --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_zookeeper_bytes_received --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_keeper_connections_alive --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_keeper_outstanding_requests --service-name=clickhouse::clickhouse:8123
expected: expected/metrics-has-value-label.yml
# instance metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_version --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_cpu_usage --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_memory_usage --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_memory_available --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_uptime --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_file_open --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# Network
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_tcp_connections --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_mysql_connections --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_http_connections --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_interserver_connections --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_postgresql_connections --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_network_receive_bytes --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_network_send_bytes --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# Query
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query_select --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query_insert --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query_select_rate --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query_insert_rate --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_querytime_microseconds --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_querytime_select_microseconds --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_querytime_insert_microseconds --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_querytime_other_microseconds --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_query_slow --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# Insertion
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_inserted_rows --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_inserted_bytes --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_delayed_inserts --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
# Replicas
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_replicated_checks --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_replicated_fetch --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_replicated_send --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# MergeTree
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_background_merge --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_merge_rows --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_merge_uncompressed_bytes --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_move --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_parts_active --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_mutations --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# Kafka Table Engine
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_kafka_messages_read --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_kafka_writes --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_kafka_consumers --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_kafka_producers --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# Zookeeper
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_zookeeper_session --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_zookeeper_watch --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_zookeeper_bytes_sent --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_zookeeper_bytes_received --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
# ClickHouse Keeper
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_keeper_connections_alive --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_clickhouse_instance_keeper_outstanding_requests --service-name=clickhouse::clickhouse:8123 --instance-name=clickhouse1:9363
expected: expected/metrics-has-value.yml

View File

@ -0,0 +1,487 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<clickhouse>
<logger>
<level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
</logger>
<url_scheme_mappers>
<s3>
<to>https://{bucket}.s3.amazonaws.com</to>
</s3>
<gs>
<to>https://{bucket}.storage.googleapis.com</to>
</gs>
<oss>
<to>https://{bucket}.oss.aliyuncs.com</to>
</oss>
</url_scheme_mappers>
<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
<value>*</value>
</header>
<header>
<name>Access-Control-Allow-Headers</name>
<value>origin, x-requested-with, x-clickhouse-format, x-clickhouse-user, x-clickhouse-key, Authorization
</value>
</header>
<header>
<name>Access-Control-Allow-Methods</name>
<value>POST, GET, OPTIONS</value>
</header>
<header>
<name>Access-Control-Max-Age</name>
<value>86400</value>
</header>
</http_options_response>
<http_port>8123</http_port>
<tcp_port>9000</tcp_port>
<mysql_port>9004</mysql_port>
<postgresql_port>9005</postgresql_port>
<interserver_http_port>9009</interserver_http_port>
<listen_host>0.0.0.0</listen_host>
<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host>
<max_connections>4096</max_connections>
<keep_alive_timeout>10</keep_alive_timeout>
<grpc>
<enable_ssl>false</enable_ssl>
<ssl_cert_file>/path/to/ssl_cert_file</ssl_cert_file>
<ssl_key_file>/path/to/ssl_key_file</ssl_key_file>
<ssl_require_client_auth>false</ssl_require_client_auth>
<ssl_ca_cert_file>/path/to/ssl_ca_cert_file</ssl_ca_cert_file>
<transport_compression_type>none</transport_compression_type>
<transport_compression_level>0</transport_compression_level>
<max_send_message_size>-1</max_send_message_size>
<max_receive_message_size>-1</max_receive_message_size>
<verbose_logs>false</verbose_logs>
</grpc>
<openSSL>
<server>
<verificationMode>none</verificationMode>
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<invalidCertificateHandler>
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</server>
<client>
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<invalidCertificateHandler>
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</client>
</openSSL>
<concurrent_threads_soft_limit_num>0</concurrent_threads_soft_limit_num>
<concurrent_threads_soft_limit_ratio_to_cores>2</concurrent_threads_soft_limit_ratio_to_cores>
<max_concurrent_queries>1000</max_concurrent_queries>
<max_server_memory_usage>0</max_server_memory_usage>
<max_thread_pool_size>10000</max_thread_pool_size>
<max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>
<total_memory_profiler_step>4194304</total_memory_profiler_step>
<total_memory_tracker_sample_probability>0</total_memory_tracker_sample_probability>
<uncompressed_cache_size>8589934592</uncompressed_cache_size>
<mark_cache_size>5368709120</mark_cache_size>
<index_mark_cache_size>5368709120</index_mark_cache_size>
<mmap_cache_size>1000</mmap_cache_size>
<compiled_expression_cache_size>134217728</compiled_expression_cache_size>
<compiled_expression_cache_elements_size>10000</compiled_expression_cache_elements_size>
<custom_cached_disks_base_directory>/var/lib/clickhouse/caches/</custom_cached_disks_base_directory>
<validate_tcp_client_information>false</validate_tcp_client_information>
<path>/var/lib/clickhouse/</path>
<tmp_path>/var/lib/clickhouse/tmp/</tmp_path>
<allow_plaintext_password>1</allow_plaintext_password>
<allow_no_password>1</allow_no_password>
<allow_implicit_no_password>1</allow_implicit_no_password>
<default_password_type>sha256_password</default_password_type>
<bcrypt_workfactor>12</bcrypt_workfactor>
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
<ldap_servers>
</ldap_servers>
<user_directories>
<users_xml>
<path>users.xml</path>
</users_xml>
<local_directory>
<path>/var/lib/clickhouse/access/</path>
</local_directory>
</user_directories>
<access_control_improvements>
<users_without_row_policies_can_read_rows>true</users_without_row_policies_can_read_rows>
<on_cluster_queries_require_cluster_grant>true</on_cluster_queries_require_cluster_grant>
<select_from_system_db_requires_grant>true</select_from_system_db_requires_grant>
<select_from_information_schema_requires_grant>true</select_from_information_schema_requires_grant>
<settings_constraints_replace_previous>true</settings_constraints_replace_previous>
<role_cache_expiration_time_seconds>600</role_cache_expiration_time_seconds>
</access_control_improvements>
<default_profile>default</default_profile>
<custom_settings_prefixes>SQL_</custom_settings_prefixes>
<default_database>default</default_database>
<mlock_executable>true</mlock_executable>
<remap_executable>false</remap_executable>
<![CDATA[
Uncomment below in order to use JDBC table engine and function.
To install and run JDBC bridge in background:
* [Debian/Ubuntu]
export MVN_URL=https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc-bridge/
export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
clickhouse-jdbc-bridge &
* [CentOS/RHEL]
export MVN_URL=https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc-bridge/
export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
yum localinstall -y clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
clickhouse-jdbc-bridge &
Please refer to https://github.com/ClickHouse/clickhouse-jdbc-bridge#usage for more information.
]]>
<remote_servers>
<cluster_1s_2r>
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>clickhouse1</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
<replica>
<host>clickhouse2</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
</shard>
</cluster_1s_2r>
</remote_servers>
<zookeeper-servers>
<node index="1">
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper-servers>
<include_from>/etc/clickhouse-server/metrika.xml</include_from>
<zookeeper>
<node>
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper>
<macros>
<layer>01</layer>
<shard>01</shard>
<replica>clickhouse1</replica>
</macros>
<builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>
<max_session_timeout>3600</max_session_timeout>
<default_session_timeout>60</default_session_timeout>
<prometheus>
<endpoint>/metrics</endpoint>
<port>9363</port>
<metrics>true</metrics>
<events>true</events>
<asynchronous_metrics>true</asynchronous_metrics>
</prometheus>
<query_log>
<database>system</database>
<table>query_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_log>
<trace_log>
<database>system</database>
<table>trace_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</trace_log>
<query_thread_log>
<database>system</database>
<table>query_thread_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_thread_log>
<query_views_log>
<database>system</database>
<table>query_views_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_views_log>
<part_log>
<database>system</database>
<table>part_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</part_log>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
<flush_on_crash>false</flush_on_crash>
</metric_log>
<asynchronous_metric_log>
<database>system</database>
<table>asynchronous_metric_log</table>
<flush_interval_milliseconds>7000</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</asynchronous_metric_log>
<opentelemetry_span_log>
<engine>
engine MergeTree
partition by toYYYYMM(finish_date)
order by (finish_date, finish_time_us, trace_id)
</engine>
<database>system</database>
<table>opentelemetry_span_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</opentelemetry_span_log>
<crash_log>
<database>system</database>
<table>crash_log</table>
<partition_by/>
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
<max_size_rows>1024</max_size_rows>
<reserved_size_rows>1024</reserved_size_rows>
<buffer_size_rows_flush_threshold>512</buffer_size_rows_flush_threshold>
<flush_on_crash>true</flush_on_crash>
</crash_log>
<processors_profile_log>
<database>system</database>
<table>processors_profile_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</processors_profile_log>
<asynchronous_insert_log>
<database>system</database>
<table>asynchronous_insert_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
<partition_by>event_date</partition_by>
<ttl>event_date + INTERVAL 3 DAY</ttl>
</asynchronous_insert_log>
<backup_log>
<database>system</database>
<table>backup_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</backup_log>
<s3queue_log>
<database>system</database>
<table>s3queue_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</s3queue_log>
<blob_storage_log>
<database>system</database>
<table>blob_storage_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<ttl>event_date + INTERVAL 30 DAY</ttl>
</blob_storage_log>
<top_level_domains_lists>
</top_level_domains_lists>
<dictionaries_config>*_dictionary.*ml</dictionaries_config>
<dictionaries_lazy_load>true</dictionaries_lazy_load>
<wait_dictionaries_load_at_startup>true</wait_dictionaries_load_at_startup>
<user_defined_executable_functions_config>*_function.*ml</user_defined_executable_functions_config>
<encryption_codecs>
</encryption_codecs>
<distributed_ddl>
<path>/clickhouse/task_queue/ddl</path>
</distributed_ddl>
<graphite_rollup_example>
<pattern>
<regexp>click_cost</regexp>
<function>any</function>
<retention>
<age>0</age>
<precision>3600</precision>
</retention>
<retention>
<age>86400</age>
<precision>60</precision>
</retention>
</pattern>
<default>
<function>max</function>
<retention>
<age>0</age>
<precision>60</precision>
</retention>
<retention>
<age>3600</age>
<precision>300</precision>
</retention>
<retention>
<age>86400</age>
<precision>3600</precision>
</retention>
</default>
</graphite_rollup_example>
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
<google_protos_path>/usr/share/clickhouse/protos/</google_protos_path>
<send_crash_reports>
<enabled>false</enabled>
<anonymize>false</anonymize>
<endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
</send_crash_reports>
<query_cache>
<max_size_in_bytes>1073741824</max_size_in_bytes>
<max_entries>1024</max_entries>
<max_entry_size_in_bytes>1048576</max_entry_size_in_bytes>
<max_entry_size_in_rows>30000000</max_entry_size_in_rows>
</query_cache>
<backups>
<allowed_path>backups</allowed_path>
</backups>
</clickhouse>

View File

@ -0,0 +1,62 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<yandex>
<clickhouse_remote_servers>
<cluster_1s_2r>
<!-- shard -->
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>clickhouse1</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
<replica>
<host>clickhouse2</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
</shard>
</cluster_1s_2r>
</clickhouse_remote_servers>
<!-- ZK -->
<zookeeper>
<node>
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper>
<!-- marcos -->
<macros>
<layer>01</layer>
<shard>01</shard>
<replica>clickhouse1</replica>
</macros>
<networks>
<ip>::/0</ip>
</networks>
<clickhouse_compression>
<case>
<min_part_size>10000000000</min_part_size>
<min_part_size_ratio>0.01</min_part_size_ratio>
<method>lz4</method>
</case>
</clickhouse_compression>
</yandex>

View File

@ -0,0 +1,30 @@
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
create table default.my_table_replica
(
id int,
name String,
created_at DateTime
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/my_table_replica', '{replica}')
order by (created_at);
create table default.my_table as default.my_table_replica
ENGINE = Distributed(cluster_1s_2r, default, my_table_replica, rand());
INSERT INTO default.my_table_replica (id, name, created_at) VALUES (1, 'third_party', '2024-02-27 16:17:34');
INSERT INTO default.my_table (id, name, created_at) VALUES (2, 'third_party2', '2024-02-28 15:44:41');

View File

@ -0,0 +1,487 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<clickhouse>
<logger>
<level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
</logger>
<url_scheme_mappers>
<s3>
<to>https://{bucket}.s3.amazonaws.com</to>
</s3>
<gs>
<to>https://{bucket}.storage.googleapis.com</to>
</gs>
<oss>
<to>https://{bucket}.oss.aliyuncs.com</to>
</oss>
</url_scheme_mappers>
<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
<value>*</value>
</header>
<header>
<name>Access-Control-Allow-Headers</name>
<value>origin, x-requested-with, x-clickhouse-format, x-clickhouse-user, x-clickhouse-key, Authorization
</value>
</header>
<header>
<name>Access-Control-Allow-Methods</name>
<value>POST, GET, OPTIONS</value>
</header>
<header>
<name>Access-Control-Max-Age</name>
<value>86400</value>
</header>
</http_options_response>
<http_port>8123</http_port>
<tcp_port>9000</tcp_port>
<mysql_port>9004</mysql_port>
<postgresql_port>9005</postgresql_port>
<interserver_http_port>9009</interserver_http_port>
<listen_host>0.0.0.0</listen_host>
<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host>
<max_connections>4096</max_connections>
<keep_alive_timeout>10</keep_alive_timeout>
<grpc>
<enable_ssl>false</enable_ssl>
<ssl_cert_file>/path/to/ssl_cert_file</ssl_cert_file>
<ssl_key_file>/path/to/ssl_key_file</ssl_key_file>
<ssl_require_client_auth>false</ssl_require_client_auth>
<ssl_ca_cert_file>/path/to/ssl_ca_cert_file</ssl_ca_cert_file>
<transport_compression_type>none</transport_compression_type>
<transport_compression_level>0</transport_compression_level>
<max_send_message_size>-1</max_send_message_size>
<max_receive_message_size>-1</max_receive_message_size>
<verbose_logs>false</verbose_logs>
</grpc>
<openSSL>
<server>
<verificationMode>none</verificationMode>
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<invalidCertificateHandler>
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</server>
<client>
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<invalidCertificateHandler>
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</client>
</openSSL>
<concurrent_threads_soft_limit_num>0</concurrent_threads_soft_limit_num>
<concurrent_threads_soft_limit_ratio_to_cores>2</concurrent_threads_soft_limit_ratio_to_cores>
<max_concurrent_queries>1000</max_concurrent_queries>
<max_server_memory_usage>0</max_server_memory_usage>
<max_thread_pool_size>10000</max_thread_pool_size>
<max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>
<total_memory_profiler_step>4194304</total_memory_profiler_step>
<total_memory_tracker_sample_probability>0</total_memory_tracker_sample_probability>
<uncompressed_cache_size>8589934592</uncompressed_cache_size>
<mark_cache_size>5368709120</mark_cache_size>
<index_mark_cache_size>5368709120</index_mark_cache_size>
<mmap_cache_size>1000</mmap_cache_size>
<compiled_expression_cache_size>134217728</compiled_expression_cache_size>
<compiled_expression_cache_elements_size>10000</compiled_expression_cache_elements_size>
<custom_cached_disks_base_directory>/var/lib/clickhouse/caches/</custom_cached_disks_base_directory>
<validate_tcp_client_information>false</validate_tcp_client_information>
<path>/var/lib/clickhouse/</path>
<tmp_path>/var/lib/clickhouse/tmp/</tmp_path>
<allow_plaintext_password>1</allow_plaintext_password>
<allow_no_password>1</allow_no_password>
<allow_implicit_no_password>1</allow_implicit_no_password>
<default_password_type>sha256_password</default_password_type>
<bcrypt_workfactor>12</bcrypt_workfactor>
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
<ldap_servers>
</ldap_servers>
<user_directories>
<users_xml>
<path>users.xml</path>
</users_xml>
<local_directory>
<path>/var/lib/clickhouse/access/</path>
</local_directory>
</user_directories>
<access_control_improvements>
<users_without_row_policies_can_read_rows>true</users_without_row_policies_can_read_rows>
<on_cluster_queries_require_cluster_grant>true</on_cluster_queries_require_cluster_grant>
<select_from_system_db_requires_grant>true</select_from_system_db_requires_grant>
<select_from_information_schema_requires_grant>true</select_from_information_schema_requires_grant>
<settings_constraints_replace_previous>true</settings_constraints_replace_previous>
<role_cache_expiration_time_seconds>600</role_cache_expiration_time_seconds>
</access_control_improvements>
<default_profile>default</default_profile>
<custom_settings_prefixes>SQL_</custom_settings_prefixes>
<default_database>default</default_database>
<mlock_executable>true</mlock_executable>
<remap_executable>false</remap_executable>
<![CDATA[
Uncomment below in order to use JDBC table engine and function.
To install and run JDBC bridge in background:
* [Debian/Ubuntu]
export MVN_URL=https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc-bridge/
export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
clickhouse-jdbc-bridge &
* [CentOS/RHEL]
export MVN_URL=https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc-bridge/
export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
yum localinstall -y clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
clickhouse-jdbc-bridge &
Please refer to https://github.com/ClickHouse/clickhouse-jdbc-bridge#usage for more information.
]]>
<remote_servers>
<cluster_1s_2r>
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>clickhouse1</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
<replica>
<host>clickhouse2</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
</shard>
</cluster_1s_2r>
</remote_servers>
<zookeeper-servers>
<node index="1">
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper-servers>
<include_from>/etc/clickhouse-server/metrika.xml</include_from>
<zookeeper>
<node>
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper>
<macros>
<layer>01</layer>
<shard>01</shard>
<replica>clickhouse2</replica>
</macros>
<builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>
<max_session_timeout>3600</max_session_timeout>
<default_session_timeout>60</default_session_timeout>
<prometheus>
<endpoint>/metrics</endpoint>
<port>9363</port>
<metrics>true</metrics>
<events>true</events>
<asynchronous_metrics>true</asynchronous_metrics>
</prometheus>
<query_log>
<database>system</database>
<table>query_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_log>
<trace_log>
<database>system</database>
<table>trace_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</trace_log>
<query_thread_log>
<database>system</database>
<table>query_thread_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_thread_log>
<query_views_log>
<database>system</database>
<table>query_views_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_views_log>
<part_log>
<database>system</database>
<table>part_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</part_log>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
<flush_on_crash>false</flush_on_crash>
</metric_log>
<asynchronous_metric_log>
<database>system</database>
<table>asynchronous_metric_log</table>
<flush_interval_milliseconds>7000</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</asynchronous_metric_log>
<opentelemetry_span_log>
<engine>
engine MergeTree
partition by toYYYYMM(finish_date)
order by (finish_date, finish_time_us, trace_id)
</engine>
<database>system</database>
<table>opentelemetry_span_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</opentelemetry_span_log>
<crash_log>
<database>system</database>
<table>crash_log</table>
<partition_by/>
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
<max_size_rows>1024</max_size_rows>
<reserved_size_rows>1024</reserved_size_rows>
<buffer_size_rows_flush_threshold>512</buffer_size_rows_flush_threshold>
<flush_on_crash>true</flush_on_crash>
</crash_log>
<processors_profile_log>
<database>system</database>
<table>processors_profile_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</processors_profile_log>
<asynchronous_insert_log>
<database>system</database>
<table>asynchronous_insert_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
<partition_by>event_date</partition_by>
<ttl>event_date + INTERVAL 3 DAY</ttl>
</asynchronous_insert_log>
<backup_log>
<database>system</database>
<table>backup_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</backup_log>
<s3queue_log>
<database>system</database>
<table>s3queue_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</s3queue_log>
<blob_storage_log>
<database>system</database>
<table>blob_storage_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<ttl>event_date + INTERVAL 30 DAY</ttl>
</blob_storage_log>
<top_level_domains_lists>
</top_level_domains_lists>
<dictionaries_config>*_dictionary.*ml</dictionaries_config>
<dictionaries_lazy_load>true</dictionaries_lazy_load>
<wait_dictionaries_load_at_startup>true</wait_dictionaries_load_at_startup>
<user_defined_executable_functions_config>*_function.*ml</user_defined_executable_functions_config>
<encryption_codecs>
</encryption_codecs>
<distributed_ddl>
<path>/clickhouse/task_queue/ddl</path>
</distributed_ddl>
<graphite_rollup_example>
<pattern>
<regexp>click_cost</regexp>
<function>any</function>
<retention>
<age>0</age>
<precision>3600</precision>
</retention>
<retention>
<age>86400</age>
<precision>60</precision>
</retention>
</pattern>
<default>
<function>max</function>
<retention>
<age>0</age>
<precision>60</precision>
</retention>
<retention>
<age>3600</age>
<precision>300</precision>
</retention>
<retention>
<age>86400</age>
<precision>3600</precision>
</retention>
</default>
</graphite_rollup_example>
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
<google_protos_path>/usr/share/clickhouse/protos/</google_protos_path>
<send_crash_reports>
<enabled>false</enabled>
<anonymize>false</anonymize>
<endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
</send_crash_reports>
<query_cache>
<max_size_in_bytes>1073741824</max_size_in_bytes>
<max_entries>1024</max_entries>
<max_entry_size_in_bytes>1048576</max_entry_size_in_bytes>
<max_entry_size_in_rows>30000000</max_entry_size_in_rows>
</query_cache>
<backups>
<allowed_path>backups</allowed_path>
</backups>
</clickhouse>

View File

@ -0,0 +1,62 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<yandex>
<clickhouse_remote_servers>
<cluster_1s_2r>
<!-- shard -->
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>clickhouse1</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
<replica>
<host>clickhouse2</host>
<port>9000</port>
<user>default</user>
<password></password>
</replica>
</shard>
</cluster_1s_2r>
</clickhouse_remote_servers>
<!-- ZK -->
<zookeeper>
<node>
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper>
<!-- marcos -->
<macros>
<layer>01</layer>
<shard>01</shard>
<replica>clickhouse2</replica>
</macros>
<networks>
<ip>::/0</ip>
</networks>
<clickhouse_compression>
<case>
<min_part_size>10000000000</min_part_size>
<min_part_size_ratio>0.01</min_part_size_ratio>
<method>lz4</method>
</case>
</clickhouse_compression>
</yandex>

View File

@ -0,0 +1,26 @@
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
create table default.my_table_replica
(
id int,
name String,
created_at DateTime
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/my_table_replica', '{replica}')
order by (created_at);
create table default.my_table as default.my_table_replica
ENGINE = Distributed(cluster_1s_2r, default, my_table_replica, rand());

View File

@ -0,0 +1,106 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: '2.1'
services:
oap:
extends:
file: ../../../script/docker-compose/base-compose.yml
service: oap
environment:
- TZ=Asia/Shanghai
ports:
- "12800:12800"
zookeeper:
image: zookeeper:3.7.2
environment:
- ZOO_MY_ID=1
ports:
- "2181:2181"
networks:
- e2e
clickhouse1:
image: clickhouse/clickhouse-server:24.1.5.6
volumes:
- ./clickhouse1/config.xml:/etc/clickhouse-server/config.xml
- ./clickhouse1/metrika.xml:/etc/clickhouse-server/metrika.xml
depends_on:
- zookeeper
ports:
- "9000:9000"
- "8123:8123"
- "9009:9009"
- "9363:9363"
networks:
- e2e
healthcheck:
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8123" ]
interval: 5s
timeout: 60s
retries: 120
clickhouse2:
image: clickhouse/clickhouse-server:24.1.5.6
volumes:
- ./clickhouse2/config.xml:/etc/clickhouse-server/config.xml
- ./clickhouse2/metrika.xml:/etc/clickhouse-server/metrika.xml
depends_on:
- zookeeper
ports:
- "9001:9000"
- "8124:8123"
- "9010:9009"
- "9364:9363"
networks:
- e2e
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8123"]
interval: 5s
timeout: 60s
retries: 120
clickhouse_mock:
image: clickhouse/clickhouse-client:21.3.20.1
depends_on:
- otel-collector
- zookeeper
- clickhouse1
- clickhouse2
- oap
networks:
- e2e
entrypoint: bash
volumes:
- ./clickhouse1/mock1.sql:/data/clickhouse1/mock1.sql
- ./clickhouse2/mock2.sql:/data/clickhouse2/mock2.sql
command:
- -c
- "sleep 5 && clickhouse-client --host clickhouse1 --port 9000 -d default --multiquery < /data/clickhouse1/mock1.sql && sleep 5 && clickhouse-client --host clickhouse2 --port 9000 -d default --multiquery < /data/clickhouse2/mock2.sql"
otel-collector:
image: otel/opentelemetry-collector:${OTEL_COLLECTOR_VERSION}
networks:
- e2e
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
expose:
- 55678
depends_on:
- zookeeper
- clickhouse1
- clickhouse2
- oap
networks:
e2e:

View File

@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is used to show how to write configuration files and can be used to test.
setup:
env: compose
file: docker-compose.yml
timeout: 20m
init-system-environment: ../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
- name: install yq
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
- name: install swctl
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
verify:
retry:
count: 60
interval: 3s
cases:
- includes:
- ../clickhouse-cases.yaml

View File

@ -0,0 +1,43 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
receivers:
prometheus:
config:
scrape_configs:
- job_name: 'clickhouse-monitoring'
scrape_interval: 15s
static_configs:
- targets: ['clickhouse1:9363','clickhouse2:9363']
labels:
host_name: clickhouse:8123
processors:
batch:
exporters:
otlp:
endpoint: oap:11800
tls:
insecure: true
service:
pipelines:
metrics:
receivers:
- prometheus
processors:
- batch
exporters:
- otlp

View File

@ -0,0 +1,35 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels:
{{- contains .metric.labels }}
- key: _
value: {{ .value }}
{{- end}}
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null

View File

@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels: []
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null

View File

@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- contains . }}
- id: {{ b64enc "clickhouse::clickhouse:8123" }}.1
name: clickhouse::clickhouse:8123
shortname: clickhouse:8123
normal: true
group: "clickhouse"
layers:
- CLICKHOUSE
{{- end }}