diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml
index e94240dccb..967b418f2c 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -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
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index cd81b25af0..6b2faf9217 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -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
diff --git a/docs/en/concepts-and-designs/service-hierarchy.md b/docs/en/concepts-and-designs/service-hierarchy.md
index 60eb2f66a2..fc75485204 100644
--- a/docs/en/concepts-and-designs/service-hierarchy.md
+++ b/docs/en/concepts-and-designs/service-hierarchy.md
@@ -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.
diff --git a/docs/en/setup/backend/backend-clickhouse-monitoring.md b/docs/en/setup/backend/backend-clickhouse-monitoring.md
new file mode 100644
index 0000000000..e3412dc984
--- /dev/null
+++ b/docs/en/setup/backend/backend-clickhouse-monitoring.md
@@ -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
meter_clickhouse_tcp_connections | Number of connections to TCP server. | ClickHouse |
+| MysqlConnections | count | meter_clickhouse_instance_mysql_connections
meter_clickhouse_mysql_connections | Number of client connections using MySQL protocol. | ClickHouse |
+| HttpConnections | count | meter_clickhouse_instance_http_connections
meter_clickhouse_mysql_connections | Number of connections to HTTP server. | ClickHouse |
+| InterserverConnections | count | meter_clickhouse_instance_interserver_connections
meter_clickhouse_interserver_connections | Number of connections from other replicas to fetch parts. | ClickHouse |
+| PostgresqlConnections | count | meter_clickhouse_instance_postgresql_connections
meter_clickhouse_postgresql_connections | Number of client connections using PostgreSQL protocol. | ClickHouse |
+| ReceiveBytes | bytes | meter_clickhouse_instance_network_receive_bytes
meter_clickhouse_network_receive_bytes | Total number of bytes received from network. | ClickHouse |
+| SendBytes | bytes | meter_clickhouse_instance_network_send_bytes
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
meter_clickhouse_query | Number of executing queries. | ClickHouse |
+| SelectQueryCount | count | meter_clickhouse_instance_query_select
meter_clickhouse_query_select | Number of executing queries, but only for SELECT queries. | ClickHouse |
+| InsertQueryCount | count | meter_clickhouse_instance_query_insert
meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
+| SelectQueryRate | count/sec | meter_clickhouse_instance_query_select_rate
meter_clickhouse_query_select_rate | Number of SELECT queries per second. | ClickHouse |
+| InsertQueryRate | count/sec | meter_clickhouse_instance_query_insert_rate
meter_clickhouse_query_insert_rate | Number of INSERT queries per second. | ClickHouse |
+| Querytime | microsec | meter_clickhouse_instance_querytime_microseconds
meter_clickhouse_querytime_microseconds | Total time of all queries. | ClickHouse |
+| SelectQuerytime | microsec | meter_clickhouse_instance_querytime_select_microseconds
meter_clickhouse_querytime_select_microseconds | Total time of SELECT queries. | ClickHouse |
+| InsertQuerytime | microsec | meter_clickhouse_instance_querytime_insert_microseconds
meter_clickhouse_querytime_insert_microseconds | Total time of INSERT queries. | ClickHouse |
+| OtherQuerytime | microsec | meter_clickhouse_instance_querytime_other_microseconds
meter_clickhouse_querytime_other_microseconds | Total time of queries that are not SELECT or INSERT. | ClickHouse |
+| QuerySlowCount | count | meter_clickhouse_instance_query_slow
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
meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
+| InsertedRowCount | count | meter_clickhouse_instance_inserted_rows
meter_clickhouse_inserted_rows | Number of rows INSERTed to all tables. | ClickHouse |
+| InsertedBytes | bytes | meter_clickhouse_instance_inserted_bytes
meter_clickhouse_inserted_bytes | Number of bytes INSERTed to all tables. | ClickHouse |
+| DelayedInsertCount | count | meter_clickhouse_instance_delayed_insert
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
meter_clickhouse_replicated_checks | Number of data parts checking for consistency. | ClickHouse |
+| ReplicatedFetch | count | meter_clickhouse_instance_replicated_fetch
meter_clickhouse_replicated_fetch | Number of data parts being fetched from replica. | ClickHouse |
+| ReplicatedSend | count | meter_clickhouse_instance_replicated_send
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
meter_clickhouse_background_merge | Number of executing background merges. | ClickHouse |
+| MergeRows | count | meter_clickhouse_instance_merge_rows
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
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
meter_clickhouse_move | Number of currently executing moves. | ClickHouse |
+| PartsActive | Count | meter_clickhouse_instance_parts_active
meter_clickhouse_parts_active | Active data part, used by current and upcoming SELECTs. | ClickHouse |
+| MutationsCount | count | meter_clickhouse_instance_mutations
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
meter_clickhouse_kafka_messages_read | Number of Kafka messages already processed by ClickHouse. | ClickHouse |
+| KafkaWrites | count | meter_clickhouse_instance_kafka_writes
meter_clickhouse_kafka_writes | Number of writes (inserts) to Kafka tables. | ClickHouse |
+| KafkaConsumers | count | meter_clickhouse_instance_kafka_consumers
meter_clickhouse_kafka_consumers | Number of active Kafka consumers. | ClickHouse |
+| KafkProducers | count | meter_clickhouse_instance_kafka_producers
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
meter_clickhouse_zookeeper_session | Number of sessions (connections) to ZooKeeper. | ClickHouse |
+| ZookeeperWatch | count | meter_clickhouse_instance_zookeeper_watch
meter_clickhouse_zookeeper_watch | Number of watches (event subscriptions) in ZooKeeper. | ClickHouse |
+| ZookeeperBytesSent | bytes | meter_clickhouse_instance_zookeeper_bytes_sent
meter_clickhouse_zookeeper_bytes_sent | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
+| ZookeeperBytesReceive | bytes | meter_clickhouse_instance_zookeeper_bytes_received
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
meter_clickhouse_keeper_connections_alive | Number of alive connections for embedded ClickHouse Keeper. | ClickHouse |
+| KeeperOutstandingRequets | count | meter_clickhouse_instance_keeper_outstanding_requests
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`.
diff --git a/docs/en/swip/SWIP-5.md b/docs/en/swip/SWIP-5.md
new file mode 100644
index 0000000000..7e3bf604d6
--- /dev/null
+++ b/docs/en/swip/SWIP-5.md
@@ -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
meter_clickhouse_tcp_connections | Number of connections to TCP server. | ClickHouse |
+| MysqlConnections | count | meter_clickhouse_instance_mysql_connections
meter_clickhouse_mysql_connections | Number of client connections using MySQL protocol. | ClickHouse |
+| HttpConnections | count | meter_clickhouse_instance_http_connections
meter_clickhouse_mysql_connections | Number of connections to HTTP server. | ClickHouse |
+| InterserverConnections | count | meter_clickhouse_instance_interserver_connections
meter_clickhouse_interserver_connections | Number of connections from other replicas to fetch parts. | ClickHouse |
+| PostgresqlConnections | count | meter_clickhouse_instance_postgresql_connections
meter_clickhouse_postgresql_connections | Number of client connections using PostgreSQL protocol. | ClickHouse |
+| ReceiveBytes | bytes | meter_clickhouse_instance_network_receive_bytes
meter_clickhouse_network_receive_bytes | Total number of bytes received from network. | ClickHouse |
+| SendBytes | bytes | meter_clickhouse_instance_network_send_bytes
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
meter_clickhouse_query | Number of executing queries. | ClickHouse |
+| SelectQueryCount | count | meter_clickhouse_instance_query_select
meter_clickhouse_query_select | Number of executing queries, but only for SELECT queries. | ClickHouse |
+| InsertQueryCount | count | meter_clickhouse_instance_query_insert
meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
+| SelectQueryRate | count/sec | meter_clickhouse_instance_query_select_rate
meter_clickhouse_query_select_rate | Number of SELECT queries per second. | ClickHouse |
+| InsertQueryRate | count/sec | meter_clickhouse_instance_query_insert_rate
meter_clickhouse_query_insert_rate | Number of INSERT queries per second. | ClickHouse |
+| Querytime | microsec | meter_clickhouse_instance_querytime_microseconds
meter_clickhouse_querytime_microseconds | Total time of all queries. | ClickHouse |
+| SelectQuerytime | microsec | meter_clickhouse_instance_querytime_select_microseconds
meter_clickhouse_querytime_select_microseconds | Total time of SELECT queries. | ClickHouse |
+| InsertQuerytime | microsec | meter_clickhouse_instance_querytime_insert_microseconds
meter_clickhouse_querytime_insert_microseconds | Total time of INSERT queries. | ClickHouse |
+| OtherQuerytime | microsec | meter_clickhouse_instance_querytime_other_microseconds
meter_clickhouse_querytime_other_microseconds | Total time of queries that are not SELECT or INSERT. | ClickHouse |
+| QuerySlowCount | count | meter_clickhouse_instance_query_slow
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
meter_clickhouse_query_insert | Number of executing queries, but only for INSERT queries. | ClickHouse |
+| InsertedRowCount | count | meter_clickhouse_instance_inserted_rows
meter_clickhouse_inserted_rows | Number of rows INSERTed to all tables. | ClickHouse |
+| InsertedBytes | bytes | meter_clickhouse_instance_inserted_bytes
meter_clickhouse_inserted_bytes | Number of bytes INSERTed to all tables. | ClickHouse |
+| DelayedInsertCount | count | meter_clickhouse_instance_delayed_insert
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
meter_clickhouse_replicated_checks | Number of data parts checking for consistency. | ClickHouse |
+| ReplicatedFetch | count | meter_clickhouse_instance_replicated_fetch
meter_clickhouse_replicated_fetch | Number of data parts being fetched from replica. | ClickHouse |
+| ReplicatedSend | count | meter_clickhouse_instance_replicated_send
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
meter_clickhouse_background_merge | Number of executing background merges. | ClickHouse |
+| MergeRows | count | meter_clickhouse_instance_merge_rows
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
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
meter_clickhouse_move | Number of currently executing moves. | ClickHouse |
+| PartsActive | Count | meter_clickhouse_instance_parts_active
meter_clickhouse_parts_active | Active data part, used by current and upcoming SELECTs. | ClickHouse |
+| MutationsCount | count | meter_clickhouse_instance_mutations
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
meter_clickhouse_kafka_messages_read | Number of Kafka messages already processed by ClickHouse. | ClickHouse |
+| KafkaWrites | count | meter_clickhouse_instance_kafka_writes
meter_clickhouse_kafka_writes | Number of writes (inserts) to Kafka tables. | ClickHouse |
+| KafkaConsumers | count | meter_clickhouse_instance_kafka_consumers
meter_clickhouse_kafka_consumers | Number of active Kafka consumers. | ClickHouse |
+| KafkProducers | count | meter_clickhouse_instance_kafka_producers
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
meter_clickhouse_zookeeper_session | Number of sessions (connections) to ZooKeeper. | ClickHouse |
+| ZookeeperWatch | count | meter_clickhouse_instance_zookeeper_watch
meter_clickhouse_zookeeper_watch | Number of watches (event subscriptions) in ZooKeeper. | ClickHouse |
+| ZookeeperBytesSent | bytes | meter_clickhouse_instance_zookeeper_bytes_sent
meter_clickhouse_zookeeper_bytes_sent | Number of bytes send over network while communicating with ZooKeeper. | ClickHouse |
+| ZookeeperBytesReceive | bytes | meter_clickhouse_instance_zookeeper_bytes_received
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
meter_clickhouse_keeper_connections_alive | Number of alive connections for embedded ClickHouse Keeper. | ClickHouse |
+| KeeperOutstandingRequets | count | meter_clickhouse_instance_keeper_outstanding_requests
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
diff --git a/docs/en/swip/readme.md b/docs/en/swip/readme.md
index 3961e7d89c..346b65cb6a 100644
--- a/docs/en/swip/readme.md
+++ b/docs/en/swip/readme.md
@@ -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)
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java
index 96d15236fd..7de44badee 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java
@@ -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;
/**
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java
index ec7c239928..2754047652 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java
@@ -73,6 +73,7 @@ public class UITemplateInitializer {
Layer.BOOKKEEPER.name(),
Layer.NGINX.name(),
Layer.ROCKETMQ.name(),
+ Layer.CLICKHOUSE.name(),
"custom"
};
private final UITemplateManagementService uiTemplateManagementService;
diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml
index 02a043d491..ff1a4a5de0 100644
--- a/oap-server/server-starter/src/main/resources/application.yml
+++ b/oap-server/server-starter/src/main/resources/application.yml
@@ -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:-}
diff --git a/oap-server/server-starter/src/main/resources/hierarchy-definition.yml b/oap-server/server-starter/src/main/resources/hierarchy-definition.yml
index 39aa4a017b..6cd9b9d947 100644
--- a/oap-server/server-starter/src/main/resources/hierarchy-definition.yml
+++ b/oap-server/server-starter/src/main/resources/hierarchy-definition.yml
@@ -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
diff --git a/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-instance.yaml b/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-instance.yaml
new file mode 100644
index 0000000000..cd1317622f
--- /dev/null
+++ b/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-instance.yaml
@@ -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.
+#
+# Examples: +#
+# "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" +#+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 + diff --git a/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-service.yaml b/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-service.yaml new file mode 100644 index 0000000000..940d891f64 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/otel-rules/clickhouse/clickhouse-service.yaml @@ -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. +#
+# Examples: +#
+# "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" +#+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']) diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-instance.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-instance.json new file mode 100644 index 0000000000..dbc2ece018 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-instance.json @@ -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 + } +}] diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-root.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-root.json new file mode 100644 index 0000000000..e3ce1e6528 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-root.json @@ -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 + } + } +] \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-service.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-service.json new file mode 100644 index 0000000000..03b0f97436 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/clickhouse/clickhouse-service.json @@ -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" + } + ] + } +}] diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml b/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml index b94a062c8f..0fe0f48522 100644 --- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml @@ -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. diff --git a/test/e2e-v2/cases/clickhouse/clickhouse-cases.yaml b/test/e2e-v2/cases/clickhouse/clickhouse-cases.yaml new file mode 100644 index 0000000000..d928d7ecec --- /dev/null +++ b/test/e2e-v2/cases/clickhouse/clickhouse-cases.yaml @@ -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 diff --git a/test/e2e-v2/cases/clickhouse/clickhouse-prometheus-endpoint/clickhouse1/config.xml b/test/e2e-v2/cases/clickhouse/clickhouse-prometheus-endpoint/clickhouse1/config.xml new file mode 100644 index 0000000000..857f343e60 --- /dev/null +++ b/test/e2e-v2/cases/clickhouse/clickhouse-prometheus-endpoint/clickhouse1/config.xml @@ -0,0 +1,487 @@ + + +