From 0e5b90e70c2609bee95d06a3c825bc9cd44ec63e Mon Sep 17 00:00:00 2001 From: Daniel <116079873+heydbut@users.noreply.github.com> Date: Thu, 27 Apr 2023 01:03:14 +0330 Subject: [PATCH] Add cockroachdb dashboard (#64) --- .../main.tf | 245 ++++++++++++++++++ .../outputs.tf | 4 + .../variables.tf | 4 + 3 files changed, 253 insertions(+) create mode 100644 collector-dashboards/otel-collector-cockroachdb-dashboard/main.tf create mode 100644 collector-dashboards/otel-collector-cockroachdb-dashboard/outputs.tf create mode 100644 collector-dashboards/otel-collector-cockroachdb-dashboard/variables.tf diff --git a/collector-dashboards/otel-collector-cockroachdb-dashboard/main.tf b/collector-dashboards/otel-collector-cockroachdb-dashboard/main.tf new file mode 100644 index 0000000..3de1ccc --- /dev/null +++ b/collector-dashboards/otel-collector-cockroachdb-dashboard/main.tf @@ -0,0 +1,245 @@ +terraform { + required_providers { + lightstep = { + source = "lightstep/lightstep" + version = "~> 1.70.10" + } + } + required_version = ">= v1.0.11" +} + +resource "lightstep_dashboard" "otel_collector_cockroachdb_dashboard" { + project_name = var.lightstep_project + dashboard_name = "CockroachDB - Overview" + dashboard_description = "This dashboard provides a high-level overview of key CockroachDB metrics so you can ensure that your cluster is available, serving queries, and has sufficient resources to maintain high levels of performance." + + chart { + name = "KV Pairs" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "big_number" + hidden = false + query_string = "metric syscount | reduce mean | group_by [], mean" + } + + } + + chart { + name = "Memory Usage Per SQL Statement" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "line" + hidden = false + query_string = "metric sql_stats_mem_max | delta | group_by [], sum | point percentile(value, 50.0), percentile(value, 95.0), percentile(value, 99.0), percentile(value, 99.9)" + } + + } + + chart { + name = "Capacity Used" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "big_number" + hidden = false + query_string = "metric capacity_used | reduce mean | group_by [], mean" + } + + } + + chart { + name = "Total Capacity" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "big_number" + hidden = false + query_string = "metric capacity | reduce mean | group_by [], mean" + } + + } + + chart { + name = "SQL UPDATE Count" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "bar" + hidden = false + query_string = "metric sql_update_count | rate | group_by [], sum" + } + + } + + chart { + name = "SQL INSERT Count" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "bar" + hidden = false + query_string = "metric sql_insert_count | rate | group_by [], sum" + } + + } + + chart { + name = "SQL DELETE Count" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "bar" + hidden = false + query_string = "metric sql_delete_count | rate | group_by [], sum" + } + + } + + chart { + name = "SQL SELECT Count" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "bar" + hidden = false + query_string = "metric sql_select_count | rate | group_by [], sum" + } + + } + + chart { + name = "Batch Request Latency" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "line" + hidden = false + query_string = "metric exec_latency | delta | group_by [], sum | point percentile(value, 50.0), percentile(value, 95.0), percentile(value, 99.0), percentile(value, 99.9)" + } + + } + + chart { + name = "SQL Connections" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "big_number" + hidden = false + query_string = "metric sql_conns | reduce mean | group_by [], mean" + } + + } + + chart { + name = "SQL Service Latency" + rank = "0" + type = "timeseries" + + query { + query_name = "a" + display = "line" + hidden = false + query_string = "metric sql_service_latency | delta | group_by [], sum | point percentile(value, 50.0), percentile(value, 95.0), percentile(value, 99.0), percentile(value, 99.9)" + } + + } + + chart { + name = "Capacity Available (%)" + rank = "0" + type = "timeseries" + + query { + query_name = "((a/b)*100)" + display = "big_number" + hidden = false + query_string = <