You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/11/10 14:29:47 UTC
[skywalking] branch master updated: Support MySQL/PostgreSQL cluster mode (#9937)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 109e6dea16 Support MySQL/PostgreSQL cluster mode (#9937)
109e6dea16 is described below
commit 109e6dea1672647992f693c5755b376fbbab048b
Author: yswdqz <74...@users.noreply.github.com>
AuthorDate: Thu Nov 10 22:29:31 2022 +0800
Support MySQL/PostgreSQL cluster mode (#9937)
---
apm-dist/src/main/assembly/binary.xml | 4 +-
docs/en/changes/changes.md | 1 +
docs/en/setup/backend/backend-mysql-monitoring.md | 3 +-
.../setup/backend/backend-postgresql-monitoring.md | 4 +-
.../src/main/resources/application.yml | 2 +-
.../{mysql.yaml => mysql/mysql-instance.yaml} | 44 +-
.../{mysql.yaml => mysql/mysql-service.yaml} | 12 +-
.../postgresql-instance.yaml} | 94 +--
.../postgresql-service.yaml} | 48 +-
.../mysql/mysql-instance.json | 320 ++++++++++
.../ui-initialized-templates/mysql/mysql-root.json | 4 +-
.../mysql/mysql-service.json | 162 ++---
.../postgresql/postgresql-instance.json | 700 +++++++++++++++++++++
.../postgresql/postgresql-root.json | 4 +-
.../postgresql/postgresql-service.json | 382 +++--------
test/e2e-v2/cases/mysql/mysql-cases.yaml | 103 +--
.../cases/mysql/mysql-slowsql/docker-compose.yaml | 61 +-
.../otel-collector-config.yaml | 2 +-
.../postgres-exporter/docker-compose.yml | 40 ++
.../postgres-exporter/otel-collector-config.yaml | 2 +-
test/e2e-v2/cases/postgresql/postgresql-cases.yaml | 100 +--
21 files changed, 1470 insertions(+), 622 deletions(-)
diff --git a/apm-dist/src/main/assembly/binary.xml b/apm-dist/src/main/assembly/binary.xml
index 259f721272..f3c84eb2de 100644
--- a/apm-dist/src/main/assembly/binary.xml
+++ b/apm-dist/src/main/assembly/binary.xml
@@ -61,14 +61,14 @@
<include>trace-sampling-policy-settings.yml</include>
<include>oal/*.oal</include>
<include>fetcher-prom-rules/*.yaml</include>
- <include>envoy-metrics-rules/*.yaml</include>
+ <include>envoy-metrics-rules/**</include>
<include>meter-analyzer-config/*.yaml</include>
<include>zabbix-rules/*.yaml</include>
<include>openapi-definitions/*/*.yaml</include>
<include>otel-rules/**</include>
<include>ui-initialized-templates/*/*.json</include>
<include>lal/*</include>
- <include>log-mal-rules/*</include>
+ <include>log-mal-rules/**</include>
<include>telegraf-rules/*</include>
</includes>
<outputDirectory>config</outputDirectory>
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 1d0b44d304..8ad0514bc0 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -83,6 +83,7 @@
* Support `sampledTrace` in LAL.
* Support multiple rules with different names under the same layer of LAL script.
* (Optimization) Reduce the buffer size(queue) of MAL(only) metric streams. Set L1 queue size as 1/20, L2 queue size as 1/2.
+* Support monitoring MySQL/PostgreSQL in the cluster mode.
* [**Breaking Change**] Migrate to BanyanDB v0.2.0.
* Adopt new OR logical operator for,
1. `MeasureIDs` query
diff --git a/docs/en/setup/backend/backend-mysql-monitoring.md b/docs/en/setup/backend/backend-mysql-monitoring.md
index c1f368f489..cfb4ffaea3 100644
--- a/docs/en/setup/backend/backend-mysql-monitoring.md
+++ b/docs/en/setup/backend/backend-mysql-monitoring.md
@@ -14,7 +14,8 @@ SkyWalking leverages prometheus/mysqld_exporter for collecting metrics data. It
3. Config SkyWalking [OpenTelemetry receiver](opentelemetry-receiver.md).
### MySQL Monitoring
-MySQL monitoring provides monitoring of the status and resources of the MySQL server. MySQL server is cataloged as a `Layer: MYSQL` `Service` in OAP.
+MySQL monitoring provides monitoring of the status and resources of the MySQL server. MySQL cluster is cataloged as a `Layer: MYSQL` `Service` in OAP.
+Each MySQL server is cataloged as an `Instance` in OAP.
#### Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
|-----|------|-----|-----|-----|
diff --git a/docs/en/setup/backend/backend-postgresql-monitoring.md b/docs/en/setup/backend/backend-postgresql-monitoring.md
index 1956758c5c..6f75e48828 100644
--- a/docs/en/setup/backend/backend-postgresql-monitoring.md
+++ b/docs/en/setup/backend/backend-postgresql-monitoring.md
@@ -64,8 +64,8 @@ SkyWalking leverages [fluentbit](https://fluentbit.io/) or other log agents for
3. Config PostgreSQL to enable slow log. [Example](../../../../test/e2e-v2/cases/postgresql/postgres-exporter/postgresql.conf).
### Slow SQL Monitoring
-Slow SQL monitoring provides monitoring of the slow SQL statements of the PostgreSQL server. PostgreSQL server is cataloged as a `Layer: POSTGRESQL` `Service` in OAP.
-
+Slow SQL monitoring provides monitoring of the slow SQL statements of the PostgreSQL server. PostgreSQL Cluster is cataloged as a `Layer: POSTGRESQL` `Service` in OAP.
+Each PostgreSQL server is cataloged as an `Instance` in OAP.
#### Supported Metrics
| Monitoring Panel | Unit | Metric Name | Description | Data Source |
|-----|------|-----|-----|-----|
diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml
index aa1cf0493e..bc3af91b94 100644
--- a/oap-server/server-starter/src/main/resources/application.yml
+++ b/oap-server/server-starter/src/main/resources/application.yml
@@ -356,7 +356,7 @@ receiver-otel:
selector: ${SW_OTEL_RECEIVER:default}
default:
enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"oc,otlp"}
- enabledOtelRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_RULES:"apisix,k8s/*,istio-controlplane,vm,mysql,postgresql,oap"}
+ enabledOtelRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_RULES:"apisix,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap"}
receiver-zipkin:
selector: ${SW_RECEIVER_ZIPKIN:-}
diff --git a/oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml b/oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-instance.yaml
similarity index 76%
copy from oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml
copy to oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-instance.yaml
index b41aad70fe..bbbbde4767 100644
--- a/oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml
+++ b/oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-instance.yaml
@@ -29,54 +29,54 @@
# "-P-6H+3M" -- parses as "+6 hours and -3 minutes"
# </pre>
filter: "{ tags -> tags.job_name == 'mysql-monitoring' }" # The OpenTelemetry job name
-expSuffix: tag({tags -> tags.host_name = 'mysql::' + tags.host_name}).service(['host_name'] , Layer.MYSQL)
+expSuffix: tag({tags -> tags.host_name = 'mysql::' + tags.host_name}).service(['host_name'] , Layer.MYSQL).instance(['host_name'], ['service_instance_id'], Layer.MYSQL)
metricPrefix: meter_mysql
metricsRules:
# mysql configurations
- - name: uptime
+ - name: instance_uptime
exp: mysql_global_status_uptime
- - name: innodb_buffer_pool_size
+ - name: instance_innodb_buffer_pool_size
exp: mysql_global_variables_innodb_buffer_pool_size
- - name: max_connections
+ - name: instance_max_connections
exp: mysql_global_variables_max_connections
- - name: thread_cache_size
+ - name: instance_thread_cache_size
exp: mysql_global_variables_thread_cache_size
# database throughput
- - name: commands_insert_rate
+ - name: instance_commands_insert_rate
exp: mysql_global_status_commands_total.tagEqual('command','insert').rate('PT1M')
- - name: commands_select_rate
+ - name: instance_commands_select_rate
exp: mysql_global_status_commands_total.tagEqual('command','select').rate('PT1M')
- - name: commands_delete_rate
+ - name: instance_commands_delete_rate
exp: mysql_global_status_commands_total.tagEqual('command','delete').rate('PT1M')
- - name: commands_update_rate
+ - name: instance_commands_update_rate
exp: mysql_global_status_commands_total.tagEqual('command','update').rate('PT1M')
- - name: qps
+ - name: instance_qps
exp: mysql_global_status_queries.rate('PT1M')
- - name: tps
+ - name: instance_tps
exp: mysql_global_status_commands_total.tagMatch('command','rollback|commit').rate('PT1M')
# connections
## threads
- - name: threads_connected
+ - name: instance_threads_connected
exp: mysql_global_status_threads_connected
- - name: threads_created
+ - name: instance_threads_created
exp: mysql_global_status_threads_created
- - name: threads_running
+ - name: instance_threads_running
exp: mysql_global_status_threads_running
- - name: threads_cached
+ - name: instance_threads_cached
exp: mysql_global_status_threads_cached
## connect
- - name: connects_aborted
+ - name: instance_connects_aborted
exp: mysql_global_status_aborted_connects
- - name: connects_available
- exp: mysql_global_variables_max_connections.sum(['host_name']) - mysql_global_status_threads_connected.sum(['host_name'])
- - name: connection_errors_max_connections
+ - name: instance_connects_available
+ exp: mysql_global_variables_max_connections.sum(['host_name','service_instance_id']) - mysql_global_status_threads_connected.sum(['host_name','service_instance_id'])
+ - name: instance_connection_errors_max_connections
exp: mysql_global_status_connection_errors_total.tagEqual('error','max_connection')
- - name: connection_errors_internal
+ - name: instance_connection_errors_internal
exp: mysql_global_status_connection_errors_total.tagEqual('error','internal')
# slow queries
- - name: slow_queries_rate
+ - name: instance_slow_queries_rate
exp: mysql_global_status_slow_queries.rate('PT1M')
-
+
diff --git a/oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml b/oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-service.yaml
similarity index 90%
rename from oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml
rename to oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-service.yaml
index b41aad70fe..814f390d08 100644
--- a/oap-server/server-starter/src/main/resources/otel-rules/mysql.yaml
+++ b/oap-server/server-starter/src/main/resources/otel-rules/mysql/mysql-service.yaml
@@ -32,16 +32,6 @@ filter: "{ tags -> tags.job_name == 'mysql-monitoring' }" # The OpenTelemetry jo
expSuffix: tag({tags -> tags.host_name = 'mysql::' + tags.host_name}).service(['host_name'] , Layer.MYSQL)
metricPrefix: meter_mysql
metricsRules:
- # mysql configurations
- - name: uptime
- exp: mysql_global_status_uptime
- - name: innodb_buffer_pool_size
- exp: mysql_global_variables_innodb_buffer_pool_size
- - name: max_connections
- exp: mysql_global_variables_max_connections
- - name: thread_cache_size
- exp: mysql_global_variables_thread_cache_size
-
# database throughput
- name: commands_insert_rate
exp: mysql_global_status_commands_total.tagEqual('command','insert').rate('PT1M')
@@ -54,7 +44,7 @@ metricsRules:
- name: qps
exp: mysql_global_status_queries.rate('PT1M')
- name: tps
- exp: mysql_global_status_commands_total.tagMatch('command','rollback|commit').rate('PT1M')
+ exp: mysql_global_status_commands_total.tagMatch('command','rollback|commit').sum(['host_name']).rate('PT1M')
# connections
## threads
diff --git a/oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml b/oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-instance.yaml
similarity index 61%
copy from oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml
copy to oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-instance.yaml
index d65707d5ae..b36349c0ff 100644
--- a/oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml
+++ b/oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-instance.yaml
@@ -29,87 +29,87 @@
# "-P-6H+3M" -- parses as "+6 hours and -3 minutes"
# </pre>
filter: "{ tags -> tags.job_name == 'postgresql-monitoring' }" # The OpenTelemetry job name
-expSuffix: tag({tags -> tags.host_name = 'postgresql::' + tags.host_name}).service(['host_name'] , Layer.POSTGRESQL)
+expSuffix: tag({tags -> tags.host_name = 'postgresql::' + tags.host_name}).service(['host_name'] , Layer.POSTGRESQL).instance(['host_name'],['service_instance_id'], Layer.POSTGRESQL)
metricPrefix: meter_pg
metricsRules:
# postgresql configurations
- - name: shared_buffers
+ - name: instance_shared_buffers
exp: pg_settings_shared_buffers_bytes
- - name: effective_cache
+ - name: instance_effective_cache
exp: pg_settings_effective_cache_size_bytes
- - name: maintenance_work_mem
+ - name: instance_maintenance_work_mem
exp: pg_settings_maintenance_work_mem_bytes
- - name: work_mem
+ - name: instance_work_mem
exp: pg_settings_work_mem_bytes
- - name: seq_page_cost
+ - name: instance_seq_page_cost
exp: pg_settings_seq_page_cost
- - name: random_page_cost
+ - name: instance_random_page_cost
exp: pg_settings_random_page_cost
- - name: max_wal_size
+ - name: instance_max_wal_size
exp: pg_settings_max_wal_size_bytes
- - name: max_parallel_workers
+ - name: instance_max_parallel_workers
exp: pg_settings_max_parallel_workers
- - name: max_worker_processes
+ - name: instance_max_worker_processes
exp: pg_settings_max_worker_processes
# dashboards
## rows
- - name: fetched_rows_rate
- exp: pg_stat_database_tup_fetched.sum(['datname','host_name']).rate('PT1M')
- - name: deleted_rows_rate
- exp: pg_stat_database_tup_deleted.sum(['datname','host_name']).rate('PT1M')
- - name: inserted_rows_rate
- exp: pg_stat_database_tup_inserted.sum(['datname','host_name']).rate('PT1M')
- - name: updated_rows_rate
- exp: pg_stat_database_tup_updated.sum(['datname','host_name']).rate('PT1M')
- - name: returned_rows_rate
- exp: pg_stat_database_tup_returned.sum(['datname','host_name']).rate('PT1M')
+ - name: instance_fetched_rows_rate
+ exp: pg_stat_database_tup_fetched.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_deleted_rows_rate
+ exp: pg_stat_database_tup_deleted.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_inserted_rows_rate
+ exp: pg_stat_database_tup_inserted.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_updated_rows_rate
+ exp: pg_stat_database_tup_updated.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_returned_rows_rate
+ exp: pg_stat_database_tup_returned.sum(['datname','host_name','service_instance_id']).rate('PT1M')
## locks
- - name: locks_count
- exp: pg_locks_count.tag({tags -> tags.mode = tags.datname + ":" + tags.mode}).sum(['mode','host_name'])
+ - name: instance_locks_count
+ exp: pg_locks_count.tag({tags -> tags.mode = tags.datname + ":" + tags.mode}).sum(['mode','host_name','service_instance_id'])
## sessions
- - name: active_sessions
- exp: pg_stat_activity_count.tagEqual('state','active').sum(['datname' , 'host_name'])
- - name: idle_sessions
- exp: pg_stat_activity_count.tagMatch('state','idle|idle in transaction|idle in transaction (aborted)').sum(['datname' , 'host_name'])
+ - name: instance_active_sessions
+ exp: pg_stat_activity_count.tagEqual('state','active').sum(['datname' , 'host_name','service_instance_id'])
+ - name: instance_idle_sessions
+ exp: pg_stat_activity_count.tagMatch('state','idle|idle in transaction|idle in transaction (aborted)').sum(['datname','host_name','service_instance_id'])
## transactions
- - name: committed_transactions_rate
- exp: pg_stat_database_xact_commit.sum(['datname','host_name']).rate('PT1M')
- - name: rolled_back_transactions_rate
- exp: pg_stat_database_xact_rollback.sum(['datname','host_name']).rate('PT1M')
+ - name: instance_committed_transactions_rate
+ exp: pg_stat_database_xact_commit.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_rolled_back_transactions_rate
+ exp: pg_stat_database_xact_rollback.sum(['datname','host_name','service_instance_id']).rate('PT1M')
## cache and temporary file
- - name: cache_hit_rate
- exp: (pg_stat_database_blks_hit*100 / (pg_stat_database_blks_read + pg_stat_database_blks_hit)).sum(['datname','host_name'])
- - name: temporary_files_rate
- exp: pg_stat_database_temp_bytes.sum(['datname','host_name']).rate('PT1M')
+ - name: instance_cache_hit_rate
+ exp: (pg_stat_database_blks_hit*100 / (pg_stat_database_blks_read + pg_stat_database_blks_hit)).sum(['datname','host_name','service_instance_id'])
+ - name: instance_temporary_files_rate
+ exp: pg_stat_database_temp_bytes.sum(['datname','host_name','service_instance_id']).rate('PT1M')
## checkpoint
- - name: checkpoint_write_time_rate
+ - name: instance_checkpoint_write_time_rate
exp: pg_stat_bgwriter_checkpoint_write_time_total.rate('PT1M')
- - name: checkpoint_sync_time_rate
+ - name: instance_checkpoint_sync_time_rate
exp: pg_stat_bgwriter_checkpoint_sync_time_total.rate('PT1M')
- - name: checkpoint_req_rate
+ - name: instance_checkpoint_req_rate
exp: pg_stat_bgwriter_checkpoints_req_total.rate('PT1M')
- - name: checkpoints_timed_rate
+ - name: instance_checkpoints_timed_rate
exp: pg_stat_bgwriter_checkpoints_timed_total.rate('PT1M')
## conflicts and deadlocks
- - name: conflicts_rate
- exp: pg_stat_database_conflicts.sum(['datname','host_name']).rate('PT1M')
- - name: deadlocks_rate
- exp: pg_stat_database_deadlocks.sum(['datname','host_name']).rate('PT1M')
+ - name: instance_conflicts_rate
+ exp: pg_stat_database_conflicts.sum(['datname','host_name','service_instance_id']).rate('PT1M')
+ - name: instance_deadlocks_rate
+ exp: pg_stat_database_deadlocks.sum(['datname','host_name','service_instance_id']).rate('PT1M')
## buffers
- - name: buffers_checkpoint
+ - name: instance_buffers_checkpoint
exp: pg_stat_bgwriter_buffers_checkpoint.rate('PT1M')
- - name: buffers_clean
+ - name: instance_buffers_clean
exp: pg_stat_bgwriter_buffers_clean.rate('PT1M')
- - name: buffers_backend_fsync
+ - name: instance_buffers_backend_fsync
exp: pg_stat_bgwriter_buffers_backend_fsync.rate('PT1M')
- - name: buffers_alloc
+ - name: instance_buffers_alloc
exp: pg_stat_bgwriter_buffers_alloc.rate('PT1M')
- - name: buffers_backend
+ - name: instance_buffers_backend
exp: pg_stat_bgwriter_buffers_backend.rate('PT1M')
diff --git a/oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml b/oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-service.yaml
similarity index 67%
rename from oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml
rename to oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-service.yaml
index d65707d5ae..1dc9e3e388 100644
--- a/oap-server/server-starter/src/main/resources/otel-rules/postgresql.yaml
+++ b/oap-server/server-starter/src/main/resources/otel-rules/postgresql/postgresql-service.yaml
@@ -32,59 +32,39 @@ filter: "{ tags -> tags.job_name == 'postgresql-monitoring' }" # The OpenTelemet
expSuffix: tag({tags -> tags.host_name = 'postgresql::' + tags.host_name}).service(['host_name'] , Layer.POSTGRESQL)
metricPrefix: meter_pg
metricsRules:
- # postgresql configurations
- - name: shared_buffers
- exp: pg_settings_shared_buffers_bytes
- - name: effective_cache
- exp: pg_settings_effective_cache_size_bytes
- - name: maintenance_work_mem
- exp: pg_settings_maintenance_work_mem_bytes
- - name: work_mem
- exp: pg_settings_work_mem_bytes
- - name: seq_page_cost
- exp: pg_settings_seq_page_cost
- - name: random_page_cost
- exp: pg_settings_random_page_cost
- - name: max_wal_size
- exp: pg_settings_max_wal_size_bytes
- - name: max_parallel_workers
- exp: pg_settings_max_parallel_workers
- - name: max_worker_processes
- exp: pg_settings_max_worker_processes
-
# dashboards
## rows
- name: fetched_rows_rate
- exp: pg_stat_database_tup_fetched.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_tup_fetched.sum(['service_instance_id','host_name']).rate('PT1M')
- name: deleted_rows_rate
- exp: pg_stat_database_tup_deleted.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_tup_deleted.sum(['service_instance_id','host_name']).rate('PT1M')
- name: inserted_rows_rate
- exp: pg_stat_database_tup_inserted.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_tup_inserted.sum(['service_instance_id','host_name']).rate('PT1M')
- name: updated_rows_rate
- exp: pg_stat_database_tup_updated.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_tup_updated.sum(['service_instance_id','host_name']).rate('PT1M')
- name: returned_rows_rate
- exp: pg_stat_database_tup_returned.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_tup_returned.sum(['service_instance_id','host_name']).rate('PT1M')
## locks
- name: locks_count
- exp: pg_locks_count.tag({tags -> tags.mode = tags.datname + ":" + tags.mode}).sum(['mode','host_name'])
+ exp: pg_locks_count.tag({tags -> tags.mode = tags.datname + ":" + tags.mode}).sum(['service_instance_id','host_name'])
## sessions
- name: active_sessions
- exp: pg_stat_activity_count.tagEqual('state','active').sum(['datname' , 'host_name'])
+ exp: pg_stat_activity_count.tagEqual('state','active').sum(['service_instance_id' , 'host_name'])
- name: idle_sessions
- exp: pg_stat_activity_count.tagMatch('state','idle|idle in transaction|idle in transaction (aborted)').sum(['datname' , 'host_name'])
+ exp: pg_stat_activity_count.tagMatch('state','idle|idle in transaction|idle in transaction (aborted)').sum(['service_instance_id' , 'host_name'])
## transactions
- name: committed_transactions_rate
- exp: pg_stat_database_xact_commit.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_xact_commit.sum(['service_instance_id','host_name']).rate('PT1M')
- name: rolled_back_transactions_rate
- exp: pg_stat_database_xact_rollback.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_xact_rollback.sum(['service_instance_id','host_name']).rate('PT1M')
## cache and temporary file
- name: cache_hit_rate
- exp: (pg_stat_database_blks_hit*100 / (pg_stat_database_blks_read + pg_stat_database_blks_hit)).sum(['datname','host_name'])
+ exp: (pg_stat_database_blks_hit*100 / (pg_stat_database_blks_read + pg_stat_database_blks_hit)).sum(['service_instance_id','host_name'])
- name: temporary_files_rate
- exp: pg_stat_database_temp_bytes.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_temp_bytes.sum(['service_instance_id','host_name']).rate('PT1M')
## checkpoint
- name: checkpoint_write_time_rate
@@ -98,9 +78,9 @@ metricsRules:
## conflicts and deadlocks
- name: conflicts_rate
- exp: pg_stat_database_conflicts.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_conflicts.sum(['service_instance_id','host_name']).rate('PT1M')
- name: deadlocks_rate
- exp: pg_stat_database_deadlocks.sum(['datname','host_name']).rate('PT1M')
+ exp: pg_stat_database_deadlocks.sum(['service_instance_id','host_name']).rate('PT1M')
## buffers
- name: buffers_checkpoint
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-instance.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-instance.json
new file mode 100644
index 0000000000..bd00a53fcd
--- /dev/null
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-instance.json
@@ -0,0 +1,320 @@
+/**
+ * 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.
+ */
+
+[
+ {
+ "id":"mysql-instance ",
+ "configuration":{
+ "children":[
+ {
+ "x":0,
+ "y":0,
+ "w":6,
+ "h":9,
+ "i":"0",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_mysql_instance_uptime"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "metricConfig":[
+ {
+ "calculation":"secondToDay"
+ }
+ ],
+ "widget":{
+ "title":"MySQL Uptime (day)"
+ }
+ },
+ {
+ "x":0,
+ "y":9,
+ "w":6,
+ "h":10,
+ "i":"1",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_qps"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Current QPS"
+ }
+ },
+ {
+ "x":12,
+ "y":0,
+ "w":6,
+ "h":9,
+ "i":"2",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_mysql_instance_innodb_buffer_pool_size"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToMB"
+ }
+ ],
+ "widget":{
+ "title":"Innodb Buffer Pool Size (MB)"
+ }
+ },
+ {
+ "x":6,
+ "y":0,
+ "w":6,
+ "h":9,
+ "i":"3",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_mysql_instance_max_connections"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Max Connections"
+ }
+ },
+ {
+ "x":18,
+ "y":0,
+ "w":6,
+ "h":9,
+ "i":"4",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_mysql_instance_thread_cache_size"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Thread Cache Size"
+ }
+ },
+ {
+ "x":6,
+ "y":9,
+ "w":6,
+ "h":10,
+ "i":"5",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_tps"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Current TPS"
+ }
+ },
+ {
+ "x":12,
+ "y":9,
+ "w":6,
+ "h":10,
+ "i":"6",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_commands_insert_rate",
+ "meter_mysql_instance_commands_select_rate",
+ "meter_mysql_instance_commands_delete_rate",
+ "meter_mysql_instance_commands_update_rate"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Commands Trend (rows per second)"
+ }
+ },
+ {
+ "x":6,
+ "y":19,
+ "w":6,
+ "h":10,
+ "i":"7",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_threads_cached",
+ "meter_mysql_instance_threads_running",
+ "meter_mysql_instance_threads_created",
+ "meter_mysql_instance_threads_connected"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Threads"
+ }
+ },
+ {
+ "x":0,
+ "y":19,
+ "w":6,
+ "h":10,
+ "i":"8",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_connects_available",
+ "meter_mysql_instance_connects_aborted"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Connects"
+ }
+ },
+ {
+ "x":18,
+ "y":9,
+ "w":6,
+ "h":10,
+ "i":"10",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_slow_queries_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Slow Queries Trend (queries per second)"
+ }
+ },
+ {
+ "x":12,
+ "y":19,
+ "w":6,
+ "h":10,
+ "i":"11",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_mysql_instance_connection_errors_internal",
+ "meter_mysql_instance_connection_errors_max_connections"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Connection Errors"
+ }
+ }
+ ],
+ "layer":"MYSQL",
+ "entity":"ServiceInstance",
+ "name":"MySQL-Instance",
+ "id":"mysql-instance",
+ "isRoot":false
+ }
+ }
+]
\ No newline at end of file
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-root.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-root.json
index 5aab25ae3e..3f353fa64a 100644
--- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-root.json
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-root.json
@@ -17,7 +17,7 @@
[
{
- "id":"b6e3763c-882d-417f-8556-3cf0187cb8db",
+ "id":"mysql-root",
"configuration":{
"children":[
{
@@ -53,7 +53,7 @@
}
}
],
- "id":"b6e3763c-882d-417f-8556-3cf0187cb8db",
+ "id":"mysql-root",
"layer":"MYSQL",
"entity":"All",
"name":"MySQL-Root",
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-service.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-service.json
index e9e2364087..b0967fc496 100644
--- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-service.json
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/mysql/mysql-service.json
@@ -17,7 +17,7 @@
[
{
- "id":"2ca19857-dcdb-491a-9739-d7ab79beb60b",
+ "id":"mysql-service",
"configuration":{
"children":[
{
@@ -35,35 +35,7 @@
"x":0,
"y":0,
"w":6,
- "h":9,
- "i":"0",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_mysql_uptime"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "metricConfig":[
- {
- "calculation":"secondToDay"
- }
- ],
- "widget":{
- "title":"MySQL Uptime (day)"
- }
- },
- {
- "x":0,
- "y":9,
- "w":6,
- "h":10,
+ "h":13,
"i":"1",
"type":"Widget",
"metricTypes":[
@@ -84,85 +56,11 @@
"title":"Current QPS"
}
},
- {
- "x":12,
- "y":0,
- "w":6,
- "h":9,
- "i":"2",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_mysql_innodb_buffer_pool_size"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "metricConfig":[
- {
- "calculation":"byteToMB"
- }
- ],
- "widget":{
- "title":"Innodb Buffer Pool Size (MB)"
- }
- },
{
"x":6,
"y":0,
"w":6,
- "h":9,
- "i":"3",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_mysql_max_connections"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Max Connections"
- }
- },
- {
- "x":18,
- "y":0,
- "w":6,
- "h":9,
- "i":"4",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_mysql_thread_cache_size"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Thread Cache Size"
- }
- },
- {
- "x":6,
- "y":9,
- "w":6,
- "h":10,
+ "h":13,
"i":"5",
"type":"Widget",
"metricTypes":[
@@ -185,9 +83,9 @@
},
{
"x":12,
- "y":9,
+ "y":0,
"w":6,
- "h":10,
+ "h":13,
"i":"6",
"type":"Widget",
"metricTypes":[
@@ -214,9 +112,9 @@
},
{
"x":6,
- "y":19,
+ "y":13,
"w":6,
- "h":10,
+ "h":14,
"i":"7",
"type":"Widget",
"metricTypes":[
@@ -243,9 +141,9 @@
},
{
"x":0,
- "y":19,
+ "y":13,
"w":6,
- "h":10,
+ "h":13,
"i":"8",
"type":"Widget",
"metricTypes":[
@@ -270,9 +168,9 @@
},
{
"x":18,
- "y":9,
+ "y":0,
"w":6,
- "h":10,
+ "h":13,
"i":"10",
"type":"Widget",
"metricTypes":[
@@ -295,9 +193,9 @@
},
{
"x":12,
- "y":19,
+ "y":13,
"w":6,
- "h":10,
+ "h":14,
"i":"11",
"type":"Widget",
"metricTypes":[
@@ -352,6 +250,36 @@
]
}
]
+ },
+ {
+ "name":"Instances",
+ "children":[
+ {
+ "x":0,
+ "y":0,
+ "w":24,
+ "h":29,
+ "i":"0",
+ "type":"Widget",
+ "graph":{
+ "type":"InstanceList",
+ "dashboardName":"MySQL-Instance",
+ "fontSize":12
+ },
+ "metrics":[
+ "meter_mysql_instance_uptime"
+ ],
+ "metricTypes":[
+ "readMetricsValue",
+ ""
+ ],
+ "metricConfig":[
+ {
+ "calculation":"secondToDay"
+ }
+ ]
+ }
+ ]
}
]
}
@@ -359,8 +287,8 @@
"layer":"MYSQL",
"entity":"Service",
"name":"MySQL-Service",
- "id":"2ca19857-dcdb-491a-9739-d7ab79beb60b",
+ "id":"mysql-service",
"isRoot":false
}
}
-]
+]
\ No newline at end of file
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-instance.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-instance.json
new file mode 100644
index 0000000000..2f702fc838
--- /dev/null
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-instance.json
@@ -0,0 +1,700 @@
+/**
+ * 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.
+ */
+
+[
+ {
+ "id":"postgresql-instance",
+ "configuration":{
+ "children":[
+ {
+ "x":0,
+ "y":0,
+ "w":4,
+ "h":6,
+ "i":"0",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_shared_buffers"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToMB"
+ }
+ ],
+ "widget":{
+ "title":"Shared Buffers (MB)"
+ }
+ },
+ {
+ "x":4,
+ "y":0,
+ "w":5,
+ "h":6,
+ "i":"1",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_effective_cache"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToGB"
+ }
+ ],
+ "widget":{
+ "title":"Effective Cache (GB)"
+ }
+ },
+ {
+ "x":4,
+ "y":6,
+ "w":5,
+ "h":6,
+ "i":"2",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_maintenance_work_mem"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Maintenance Work Mem (MB)"
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToMB"
+ }
+ ]
+ },
+ {
+ "x":14,
+ "y":6,
+ "w":5,
+ "h":6,
+ "i":"3",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_work_mem"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToMB"
+ }
+ ],
+ "widget":{
+ "title":"Work Mem (MB)"
+ }
+ },
+ {
+ "x":9,
+ "y":0,
+ "w":5,
+ "h":6,
+ "i":"4",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_seq_page_cost"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Seq Page Cost"
+ }
+ },
+ {
+ "x":14,
+ "y":0,
+ "w":5,
+ "h":6,
+ "i":"5",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_random_page_cost"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Random Page Cost"
+ }
+ },
+ {
+ "x":0,
+ "y":6,
+ "w":4,
+ "h":6,
+ "i":"6",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_max_wal_size"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Max WAL Size (GB)"
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToGB"
+ }
+ ]
+ },
+ {
+ "x":9,
+ "y":6,
+ "w":5,
+ "h":6,
+ "i":"7",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_max_parallel_workers"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Max Parallel Workers"
+ }
+ },
+ {
+ "x":19,
+ "y":0,
+ "w":5,
+ "h":6,
+ "i":"8",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_max_worker_processes"
+ ],
+ "graph":{
+ "type":"Card",
+ "fontSize":40,
+ "textAlign":"center",
+ "showUnit":true
+ },
+ "widget":{
+ "title":"Max Worker Processes"
+ }
+ },
+ {
+ "x":0,
+ "y":12,
+ "w":6,
+ "h":10,
+ "i":"9",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_fetched_rows_rate"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Fetched Rows Trend (rows per second)"
+ },
+ "value":"9",
+ "label":"9"
+ },
+ {
+ "x":6,
+ "y":12,
+ "w":6,
+ "h":10,
+ "i":"10",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_inserted_rows_rate"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Inserted Rows Trend (rows per second)"
+ },
+ "value":"10",
+ "label":"10"
+ },
+ {
+ "x":6,
+ "y":32,
+ "w":6,
+ "h":10,
+ "i":"11",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_buffers_clean",
+ "meter_pg_instance_buffers_backend",
+ "meter_pg_instance_buffers_checkpoint",
+ "meter_pg_instance_buffers_backend_fsync",
+ "meter_pg_instance_buffers_alloc"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Buffers Trend (per second)"
+ },
+ "value":"11",
+ "label":"11"
+ },
+ {
+ "x":12,
+ "y":12,
+ "w":6,
+ "h":10,
+ "i":"12",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_updated_rows_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Updated Rows Trend (rows per second)"
+ },
+ "value":"12",
+ "label":"12"
+ },
+ {
+ "x":18,
+ "y":12,
+ "w":6,
+ "h":10,
+ "i":"13",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_deleted_rows_rate"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Deleted Rows Trend (rows per second)"
+ },
+ "value":"13",
+ "label":"13"
+ },
+ {
+ "x":0,
+ "y":22,
+ "w":6,
+ "h":10,
+ "i":"14",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_returned_rows_rate"
+ ],
+ "graph":{
+ "type":"Area",
+ "opacity":0.4,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Returned Rows Trend (rows per second)"
+ },
+ "value":"14",
+ "label":"14"
+ },
+ {
+ "x":6,
+ "y":42,
+ "w":6,
+ "h":10,
+ "i":"15",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_temporary_files_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "value":"15",
+ "label":"15",
+ "widget":{
+ "title":"Temporary Files Trend (per second)"
+ }
+ },
+ {
+ "x":12,
+ "y":22,
+ "w":6,
+ "h":10,
+ "i":"16",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_committed_transactions_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Committed Transactions Trend (per second)"
+ },
+ "value":"16",
+ "label":"16"
+ },
+ {
+ "x":6,
+ "y":22,
+ "w":6,
+ "h":10,
+ "i":"17",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_rolled_back_transactions_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Rolled Back Transactions Trend (per second)"
+ },
+ "value":"17",
+ "label":"17"
+ },
+ {
+ "x":0,
+ "y":32,
+ "w":6,
+ "h":10,
+ "i":"18",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_cache_hit_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Cache Hit Rate (%)"
+ },
+ "value":"18",
+ "label":"18"
+ },
+ {
+ "x":12,
+ "y":42,
+ "w":6,
+ "h":10,
+ "i":"19",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues",
+ "readMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_checkpoint_sync_time_rate",
+ "meter_pg_instance_checkpoints_timed_rate",
+ "meter_pg_instance_checkpoint_req_rate",
+ "meter_pg_instance_checkpoint_write_time_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Checkpoint Stat Trend (per second)"
+ },
+ "value":"19",
+ "label":"19"
+ },
+ {
+ "x":18,
+ "y":22,
+ "w":6,
+ "h":10,
+ "i":"20",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_conflicts_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Conflicts Trend (per second)"
+ },
+ "value":"20",
+ "label":"20"
+ },
+ {
+ "x":0,
+ "y":42,
+ "w":6,
+ "h":10,
+ "i":"21",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_deadlocks_rate"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Deadlocks Trend (per second)"
+ },
+ "value":"21",
+ "label":"21"
+ },
+ {
+ "x":12,
+ "y":32,
+ "w":6,
+ "h":10,
+ "i":"22",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_active_sessions"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Active Sessions"
+ },
+ "value":"22",
+ "label":"22"
+ },
+ {
+ "x":18,
+ "y":42,
+ "w":6,
+ "h":10,
+ "i":"23",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_locks_count"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Locks"
+ },
+ "value":"23",
+ "label":"23"
+ },
+ {
+ "x":18,
+ "y":32,
+ "w":6,
+ "h":10,
+ "i":"24",
+ "type":"Widget",
+ "metricTypes":[
+ "readLabeledMetricsValues"
+ ],
+ "metrics":[
+ "meter_pg_instance_idle_sessions"
+ ],
+ "graph":{
+ "type":"Line",
+ "step":false,
+ "smooth":false,
+ "showSymbol":false,
+ "showXAxis":true,
+ "showYAxis":true
+ },
+ "widget":{
+ "title":"Idle Sessions"
+ },
+ "value":"24",
+ "label":"24"
+ }
+ ],
+ "layer":"POSTGRESQL",
+ "entity":"ServiceInstance",
+ "name":"PostgreSQL-Instance",
+ "id":"postgresql-instance"
+ }
+ }
+]
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-root.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-root.json
index 62914852b3..3b969bf011 100644
--- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-root.json
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-root.json
@@ -17,7 +17,7 @@
[
{
- "id":"90ec4ee8-3df2-4bd9-bcb1-2d50cbe49634",
+ "id":"postgresql-root",
"configuration":{
"children":[
{
@@ -56,7 +56,7 @@
"layer":"POSTGRESQL",
"entity":"All",
"name":"PostgreSQL-Root",
- "id":"90ec4ee8-3df2-4bd9-bcb1-2d50cbe49634",
+ "id":"postgresql-root",
"isRoot":true
}
}
diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-service.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-service.json
index 85c804a3f8..13fd757be5 100644
--- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-service.json
+++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/postgresql/postgresql-service.json
@@ -17,14 +17,14 @@
[
{
- "id":"7da9d2e6-7c10-4ab4-ba86-fd73889608ff",
+ "id":"postgresql-service",
"configuration":{
"children":[
{
"x":0,
"y":0,
"w":24,
- "h":33,
+ "h":37,
"i":"0",
"type":"Tab",
"children":[
@@ -34,238 +34,6 @@
{
"x":0,
"y":0,
- "w":4,
- "h":6,
- "i":"0",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_shared_buffers"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "metricConfig":[
- {
- "calculation":"byteToMB"
- }
- ],
- "widget":{
- "title":"Shared Buffers (MB)"
- }
- },
- {
- "x":4,
- "y":0,
- "w":5,
- "h":6,
- "i":"1",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_effective_cache"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "metricConfig":[
- {
- "calculation":"byteToGB"
- }
- ],
- "widget":{
- "title":"Effective Cache (GB)"
- }
- },
- {
- "x":4,
- "y":6,
- "w":5,
- "h":6,
- "i":"2",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_maintenance_work_mem"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Maintenance Work Mem (MB)"
- },
- "metricConfig":[
- {
- "calculation":"byteToMB"
- }
- ]
- },
- {
- "x":14,
- "y":6,
- "w":5,
- "h":6,
- "i":"3",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_work_mem"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "metricConfig":[
- {
- "calculation":"byteToMB"
- }
- ],
- "widget":{
- "title":"Work Mem (MB)"
- }
- },
- {
- "x":9,
- "y":0,
- "w":5,
- "h":6,
- "i":"4",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_seq_page_cost"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Seq Page Cost"
- }
- },
- {
- "x":14,
- "y":0,
- "w":5,
- "h":6,
- "i":"5",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_random_page_cost"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Random Page Cost"
- }
- },
- {
- "x":0,
- "y":6,
- "w":4,
- "h":6,
- "i":"6",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_max_wal_size"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Max WAL Size (GB)"
- },
- "metricConfig":[
- {
- "calculation":"byteToGB"
- }
- ]
- },
- {
- "x":9,
- "y":6,
- "w":5,
- "h":6,
- "i":"7",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_max_parallel_workers"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Max Parallel Workers"
- }
- },
- {
- "x":19,
- "y":0,
- "w":5,
- "h":6,
- "i":"8",
- "type":"Widget",
- "metricTypes":[
- "readMetricsValue"
- ],
- "metrics":[
- "meter_pg_max_worker_processes"
- ],
- "graph":{
- "type":"Card",
- "fontSize":40,
- "textAlign":"center",
- "showUnit":true
- },
- "widget":{
- "title":"Max Worker Processes"
- }
- },
- {
- "x":0,
- "y":12,
"w":6,
"h":10,
"i":"9",
@@ -284,13 +52,11 @@
},
"widget":{
"title":"Fetched Rows Trend (rows per second)"
- },
- "value":"9",
- "label":"9"
+ }
},
{
"x":6,
- "y":12,
+ "y":0,
"w":6,
"h":10,
"i":"10",
@@ -309,13 +75,11 @@
},
"widget":{
"title":"Inserted Rows Trend (rows per second)"
- },
- "value":"10",
- "label":"10"
+ }
},
{
"x":6,
- "y":32,
+ "y":20,
"w":6,
"h":10,
"i":"11",
@@ -344,13 +108,11 @@
},
"widget":{
"title":"Buffers Trend (per second)"
- },
- "value":"11",
- "label":"11"
+ }
},
{
"x":12,
- "y":12,
+ "y":0,
"w":6,
"h":10,
"i":"12",
@@ -371,13 +133,11 @@
},
"widget":{
"title":"Updated Rows Trend (rows per second)"
- },
- "value":"12",
- "label":"12"
+ }
},
{
"x":18,
- "y":12,
+ "y":0,
"w":6,
"h":10,
"i":"13",
@@ -396,13 +156,11 @@
},
"widget":{
"title":"Deleted Rows Trend (rows per second)"
- },
- "value":"13",
- "label":"13"
+ }
},
{
"x":0,
- "y":22,
+ "y":10,
"w":6,
"h":10,
"i":"14",
@@ -421,13 +179,11 @@
},
"widget":{
"title":"Returned Rows Trend (rows per second)"
- },
- "value":"14",
- "label":"14"
+ }
},
{
"x":6,
- "y":42,
+ "y":30,
"w":6,
"h":10,
"i":"15",
@@ -446,15 +202,13 @@
"showXAxis":true,
"showYAxis":true
},
- "value":"15",
- "label":"15",
"widget":{
"title":"Temporary Files Trend (per second)"
}
},
{
"x":12,
- "y":22,
+ "y":10,
"w":6,
"h":10,
"i":"16",
@@ -475,13 +229,11 @@
},
"widget":{
"title":"Committed Transactions Trend (per second)"
- },
- "value":"16",
- "label":"16"
+ }
},
{
"x":6,
- "y":22,
+ "y":10,
"w":6,
"h":10,
"i":"17",
@@ -502,13 +254,11 @@
},
"widget":{
"title":"Rolled Back Transactions Trend (per second)"
- },
- "value":"17",
- "label":"17"
+ }
},
{
"x":0,
- "y":32,
+ "y":20,
"w":6,
"h":10,
"i":"18",
@@ -529,13 +279,11 @@
},
"widget":{
"title":"Cache Hit Rate (%)"
- },
- "value":"18",
- "label":"18"
+ }
},
{
"x":12,
- "y":42,
+ "y":30,
"w":6,
"h":10,
"i":"19",
@@ -562,13 +310,11 @@
},
"widget":{
"title":"Checkpoint Stat Trend (per second)"
- },
- "value":"19",
- "label":"19"
+ }
},
{
"x":18,
- "y":22,
+ "y":10,
"w":6,
"h":10,
"i":"20",
@@ -589,13 +335,11 @@
},
"widget":{
"title":"Conflicts Trend (per second)"
- },
- "value":"20",
- "label":"20"
+ }
},
{
"x":0,
- "y":42,
+ "y":30,
"w":6,
"h":10,
"i":"21",
@@ -616,13 +360,11 @@
},
"widget":{
"title":"Deadlocks Trend (per second)"
- },
- "value":"21",
- "label":"21"
+ }
},
{
"x":12,
- "y":32,
+ "y":20,
"w":6,
"h":10,
"i":"22",
@@ -643,13 +385,11 @@
},
"widget":{
"title":"Active Sessions"
- },
- "value":"22",
- "label":"22"
+ }
},
{
"x":18,
- "y":42,
+ "y":30,
"w":6,
"h":10,
"i":"23",
@@ -670,13 +410,11 @@
},
"widget":{
"title":"Locks"
- },
- "value":"23",
- "label":"23"
+ }
},
{
"x":18,
- "y":32,
+ "y":20,
"w":6,
"h":10,
"i":"24",
@@ -697,9 +435,7 @@
},
"widget":{
"title":"Idle Sessions"
- },
- "value":"24",
- "label":"24"
+ }
}
]
},
@@ -733,6 +469,58 @@
]
}
]
+ },
+ {
+ "name":"Instances",
+ "children":[
+ {
+ "x":0,
+ "y":0,
+ "w":24,
+ "h":32,
+ "i":"0",
+ "type":"Widget",
+ "metricTypes":[
+ "readMetricsValue",
+ "readMetricsValue",
+ "readMetricsValue",
+ "readMetricsValue",
+ "readMetricsValue"
+ ],
+ "metrics":[
+ "meter_pg_instance_shared_buffers",
+ "meter_pg_instance_effective_cache",
+ "meter_pg_instance_seq_page_cost",
+ "meter_pg_instance_random_page_cost",
+ "meter_pg_instance_work_mem"
+ ],
+ "graph":{
+ "type":"InstanceList",
+ "dashboardName":"PostgreSQL-Instance",
+ "fontSize":12
+ },
+ "metricConfig":[
+ {
+ "calculation":"byteToMB",
+ "label":"Shared Buffers (MB)"
+ },
+ {
+ "label":"Effective Cache (GB)",
+ "calculation":"byteToGB"
+ },
+ {
+ "label":"Seq Page Cost"
+ },
+ {
+ "label":"Random Page Cost"
+ },
+ {
+ "label":"Work Mem (MB)",
+ "calculation":"byteToMB"
+ }
+ ]
+ }
+ ]
}
]
}
@@ -740,7 +528,7 @@
"layer":"POSTGRESQL",
"entity":"Service",
"name":"PostgreSQL-Service",
- "id":"7da9d2e6-7c10-4ab4-ba86-fd73889608ff"
+ "id":"postgresql-service"
}
}
]
diff --git a/test/e2e-v2/cases/mysql/mysql-cases.yaml b/test/e2e-v2/cases/mysql/mysql-cases.yaml
index 360d349571..bb59d32dcd 100644
--- a/test/e2e-v2/cases/mysql/mysql-cases.yaml
+++ b/test/e2e-v2/cases/mysql/mysql-cases.yaml
@@ -15,44 +15,69 @@
# 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
- # metrics
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_uptime --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_innodb_buffer_pool_size --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_max_connections --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_thread_cache_size --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
-
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_select_rate --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_insert_rate --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_update_rate --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_delete_rate --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_qps --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_tps --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
+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 linear --name=meter_mysql_commands_select_rate --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_insert_rate --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_update_rate --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_commands_delete_rate --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_qps --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_tps --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_connected --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_created --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_running --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_connected --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_created --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_threads_running --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_connects_aborted --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_connects_available --service-name=mysql::root[root] |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- # slow sql
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql records list --name=top_n_database_statement |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/db-has-value.yml
\ No newline at end of file
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_connects_aborted --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_connects_available --service-name=mysql::root[root] |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ # instance metrics
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_uptime --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_innodb_buffer_pool_size --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_max_connections --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_thread_cache_size --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_commands_select_rate --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_commands_insert_rate --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_commands_update_rate --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_commands_delete_rate --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_qps --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_tps --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_threads_connected --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_threads_created --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_threads_running --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_connects_aborted --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_mysql_instance_connects_available --service-name=mysql::root[root] --instance-name=mysql-service:9104 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ # slow sql
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql records list --name=top_n_database_statement |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/db-has-value.yml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/mysql/mysql-slowsql/docker-compose.yaml b/test/e2e-v2/cases/mysql/mysql-slowsql/docker-compose.yaml
index c2263301ff..a2ce130766 100644
--- a/test/e2e-v2/cases/mysql/mysql-slowsql/docker-compose.yaml
+++ b/test/e2e-v2/cases/mysql/mysql-slowsql/docker-compose.yaml
@@ -46,12 +46,25 @@ services:
- "MYSQL_ROOT_PASSWORD=password"
- "MYSQL_DATABASE=swtest"
ports:
- - 3306:3306
+ - 3306
healthcheck:
test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"]
interval: 5s
timeout: 60s
retries: 120
+ mysql_2: &mysql
+ image: mysql:8.0.13
+ networks:
+ - e2e
+ volumes:
+ - ../mysql-slowsql/my.cnf:/etc/my.cnf
+ environment:
+ - "MYSQL_ROOT_PASSWORD=password"
+ - "MYSQL_DATABASE=swtest"
+ ports:
+ - 3306
+ mysql_3:
+ <<: *mysql
mysql-load:
image: mysql:8.0.13
depends_on:
@@ -65,6 +78,32 @@ services:
command:
- -c
- "mysql -h mysql -uroot -ppassword < /docker/mock.sql"
+ mysql-load_2:
+ image: mysql:8.0.13
+ depends_on:
+ oap:
+ condition: service_healthy
+ networks:
+ - e2e
+ entrypoint: bash
+ volumes:
+ - ./mock.sql:/docker/mock.sql
+ command:
+ - -c
+ - "mysql -h mysql_2 -uroot -ppassword < /docker/mock.sql"
+ mysql-load_3:
+ image: mysql:8.0.13
+ depends_on:
+ oap:
+ condition: service_healthy
+ networks:
+ - e2e
+ entrypoint: bash
+ volumes:
+ - ./mock.sql:/docker/mock.sql
+ command:
+ - -c
+ - "mysql -h mysql_3 -uroot -ppassword < /docker/mock.sql"
fluentbit:
image: fluent/fluent-bit:1.9
environment:
@@ -88,6 +127,26 @@ services:
- e2e
depends_on:
- mysql
+ mysql-service_2:
+ image: prom/mysqld-exporter:v0.14.0
+ ports:
+ - 9104
+ environment:
+ - DATA_SOURCE_NAME=root:password@(mysql_2:3306)/
+ networks:
+ - e2e
+ depends_on:
+ - mysql_2
+ mysql-service_3:
+ image: prom/mysqld-exporter:v0.14.0
+ ports:
+ - 9104
+ environment:
+ - DATA_SOURCE_NAME=root:password@(mysql_3:3306)/
+ networks:
+ - e2e
+ depends_on:
+ - mysql_3
otel-collector:
image: otel/opentelemetry-collector:0.50.0
networks:
diff --git a/test/e2e-v2/cases/mysql/prometheus-mysql-exporter/otel-collector-config.yaml b/test/e2e-v2/cases/mysql/prometheus-mysql-exporter/otel-collector-config.yaml
index c0b2f270be..5a78af97fb 100644
--- a/test/e2e-v2/cases/mysql/prometheus-mysql-exporter/otel-collector-config.yaml
+++ b/test/e2e-v2/cases/mysql/prometheus-mysql-exporter/otel-collector-config.yaml
@@ -20,7 +20,7 @@ receivers:
- job_name: 'mysql-monitoring'
scrape_interval: 5s
static_configs:
- - targets: ['mysql-service:9104']
+ - targets: ['mysql-service:9104', 'mysql-service_2:9104', 'mysql-service_3:9104']
labels:
host_name: root[root]
processors:
diff --git a/test/e2e-v2/cases/postgresql/postgres-exporter/docker-compose.yml b/test/e2e-v2/cases/postgresql/postgres-exporter/docker-compose.yml
index e8853ab3ed..95f5c7e80b 100644
--- a/test/e2e-v2/cases/postgresql/postgres-exporter/docker-compose.yml
+++ b/test/e2e-v2/cases/postgresql/postgres-exporter/docker-compose.yml
@@ -51,6 +51,26 @@ services:
interval: 5s
timeout: 60s
retries: 120
+ postgres_2: &pgsql
+ image: postgres:14.1
+ environment:
+ - TZ=Asia/Shanghai
+ - POSTGRES_PASSWORD=123456
+ - POSTGRES_DB=skywalking
+ ports:
+ - 5432
+ command: postgres -c config_file=/etc/postgresql.conf
+ volumes:
+ - ./postgresql.conf:/etc/postgresql.conf
+ networks:
+ - e2e
+ healthcheck:
+ test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5432" ]
+ interval: 5s
+ timeout: 60s
+ retries: 120
+ postgres_3:
+ <<: *pgsql
postgres-load:
image: postgres:14.1
environment:
@@ -75,6 +95,26 @@ services:
- DATA_SOURCE_NAME=postgresql://postgres:123456@postgres:5432/postgres?sslmode=disable
networks:
- e2e
+ postgres-exporter_2:
+ image: quay.io/prometheuscommunity/postgres-exporter:v0.11.0
+ depends_on:
+ - postgres
+ ports:
+ - 9187
+ environment:
+ - DATA_SOURCE_NAME=postgresql://postgres:123456@postgres_2:5432/postgres?sslmode=disable
+ networks:
+ - e2e
+ postgres-exporter_3:
+ image: quay.io/prometheuscommunity/postgres-exporter:v0.11.0
+ depends_on:
+ - postgres
+ ports:
+ - 9187
+ environment:
+ - DATA_SOURCE_NAME=postgresql://postgres:123456@postgres_3:5432/postgres?sslmode=disable
+ networks:
+ - e2e
fluentbit:
image: fluent/fluent-bit:1.9
environment:
diff --git a/test/e2e-v2/cases/postgresql/postgres-exporter/otel-collector-config.yaml b/test/e2e-v2/cases/postgresql/postgres-exporter/otel-collector-config.yaml
index 10ee8dc009..17502ae819 100644
--- a/test/e2e-v2/cases/postgresql/postgres-exporter/otel-collector-config.yaml
+++ b/test/e2e-v2/cases/postgresql/postgres-exporter/otel-collector-config.yaml
@@ -20,7 +20,7 @@ receivers:
- job_name: "postgresql-monitoring"
scrape_interval: 5s
static_configs:
- - targets: ["postgres-exporter:9187"]
+ - targets: ["postgres-exporter:9187","postgres-exporter_2:9187","postgres-exporter_3:9187"]
labels:
host_name: postgres:5432
processors:
diff --git a/test/e2e-v2/cases/postgresql/postgresql-cases.yaml b/test/e2e-v2/cases/postgresql/postgresql-cases.yaml
index ca9147344e..18a5e25fe2 100644
--- a/test/e2e-v2/cases/postgresql/postgresql-cases.yaml
+++ b/test/e2e-v2/cases/postgresql/postgresql-cases.yaml
@@ -15,47 +15,63 @@
# 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
- # metrics
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_shared_buffers --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_effective_cache --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_maintenance_work_mem --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_work_mem --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
-
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_seq_page_cost --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_random_page_cost --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_max_wal_size --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_max_parallel_workers --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_max_worker_processes --service-name=postgresql::postgres:5432 |yq e 'to_entries' -
- expected: expected/metrics-has-value.yml
-
+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 multiple-linear --name=meter_pg_cache_hit_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_fetched_rows_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_inserted_rows_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_updated_rows_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_returned_rows_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_deleted_rows_rate --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_cache_hit_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_fetched_rows_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_inserted_rows_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_updated_rows_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_returned_rows_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_deleted_rows_rate --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_active_sessions --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ # instance metrics
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_shared_buffers --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_effective_cache --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_maintenance_work_mem --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_work_mem --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_active_sessions --labels=postgres --service-name=postgresql::postgres:5432 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/metrics-has-value-label.yml
- # slow sql
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql records list --name=top_n_database_statement |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
- expected: expected/db-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_seq_page_cost --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_random_page_cost --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_max_wal_size --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_max_parallel_workers --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_pg_instance_max_worker_processes --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries' -
+ expected: expected/metrics-has-value.yml
+
+
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_cache_hit_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_fetched_rows_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_inserted_rows_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_updated_rows_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_returned_rows_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_deleted_rows_rate --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear --name=meter_pg_instance_active_sessions --service-name=postgresql::postgres:5432 --instance-name=postgres-exporter:9187 |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/metrics-has-value-label.yml
+ # slow sql
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql records list --name=top_n_database_statement |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+ expected: expected/db-has-value.yml