diff --git a/couchbase-mixin/alerts/alerts.libsonnet b/couchbase-mixin/alerts.libsonnet similarity index 91% rename from couchbase-mixin/alerts/alerts.libsonnet rename to couchbase-mixin/alerts.libsonnet index 0dd16634d..1293719c5 100644 --- a/couchbase-mixin/alerts/alerts.libsonnet +++ b/couchbase-mixin/alerts.libsonnet @@ -1,6 +1,6 @@ { - prometheusAlerts+:: { - groups+: [ + new(this): { + groups: [ { name: 'couchbase', rules: [ @@ -8,7 +8,7 @@ alert: 'CouchbaseHighCPUUsage', expr: ||| (sys_cpu_utilization_rate) > %(alertsCriticalCPUUsage)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -19,14 +19,14 @@ ( '{{ printf "%%.0f" $value }} percent CPU usage on node {{$labels.instance}} and on cluster {{$labels.couchbase_cluster}}, ' + 'which is above the threshold of %(alertsCriticalCPUUsage)s.' - ) % $._config, + ) % this.config, }, }, { alert: 'CouchbaseHighMemoryUsage', expr: ||| 100 * (sys_mem_actual_used / clamp_min(sys_mem_actual_used + sys_mem_actual_free, 1)) > %(alertsCriticalMemoryUsage)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -37,14 +37,14 @@ ( '{{ printf "%%.0f" $value }} percent memory usage on node {{$labels.instance}} and on cluster {{$labels.couchbase_cluster}}, ' + 'which is above the threshold of %(alertsCriticalMemoryUsage)s.' - ) % $._config, + ) % this.config, }, }, { alert: 'CouchbaseMemoryEvictionRate', expr: ||| (kv_ep_num_value_ejects) > %(alertsWarningMemoryEvictionRate)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'warning', @@ -55,14 +55,14 @@ ( '{{ printf "%%.0f" $value }} evictions in bucket {{$labels.bucket}}, on node {{$labels.instance}}, and on cluster {{$labels.couchbase_cluster}}, ' + 'which is above the threshold of %(alertsWarningMemoryEvictionRate)s.' - ) % $._config, + ) % this.config, }, }, { alert: 'CouchbaseInvalidRequestVolume', expr: ||| sum without(instance, job) (rate(n1ql_invalid_requests[2m])) > %(alertsWarningInvalidRequestVolume)s - ||| % $._config, + ||| % this.config, 'for': '2m', labels: { severity: 'warning', @@ -73,7 +73,7 @@ ( '{{ printf "%%.0f" $value }} invalid requests to {{$labels.couchbase_cluster}}, ' + 'which is above the threshold of %(alertsWarningInvalidRequestVolume)s.' - ) % $._config, + ) % this.config, }, }, ], diff --git a/couchbase-mixin/config.libsonnet b/couchbase-mixin/config.libsonnet index 697857b35..b9da616df 100644 --- a/couchbase-mixin/config.libsonnet +++ b/couchbase-mixin/config.libsonnet @@ -1,19 +1,42 @@ { - _config+:: { - enableMultiCluster: false, - couchbaseSelector: if self.enableMultiCluster then 'job=~"$job", cluster=~"$cluster"' else 'job=~"$job"', - multiclusterSelector: 'job=~"$job"', - dashboardTags: ['couchbase-mixin'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', + // any modular library should include as inputs: + // 'dashboardNamePrefix' - Use as prefix for all Dashboards and (optional) rule groups + // 'filteringSelector' - Static selector to apply to ALL dashboard variables of type query, panel queries, alerts and recording rules. + // 'groupLabels' - one or more labels that can be used to identify 'group' of instances. In simple cases, can be 'job' or 'cluster'. + // 'instanceLabels' - one or more labels that can be used to identify single entity of instances. In simple cases, can be 'instance' or 'pod'. + // 'uid' - UID to prefix all dashboards original uids - // alerts thresholds - alertsCriticalCPUUsage: 85, // % - alertsCriticalMemoryUsage: 85, // % - alertsWarningMemoryEvictionRate: 10, // count - alertsWarningInvalidRequestVolume: 1000, // count + enableMultiCluster: false, + filteringSelector: '', + groupLabels: if self.enableMultiCluster then ['job', 'cluster', 'couchbase_cluster'] else ['job', 'couchbase_cluster'], + instanceLabels: ['instance'], + dashboardTags: ['couchbase-mixin'], + uid: 'couchbase', + dashboardNamePrefix: 'Couchbase', - enableLokiLogs: true, + local config = self, + // Dashboard-specific label configurations + dashboardVariables: { + cluster: if config.enableMultiCluster then ['job', 'couchbase_cluster', 'cluster'] else ['job', 'couchbase_cluster'], + node: if config.enableMultiCluster then ['job', 'instance', 'couchbase_cluster', 'cluster'] else ['job', 'instance', 'couchbase_cluster'], + bucket: if config.enableMultiCluster then ['job', 'instance', 'couchbase_cluster', 'cluster', 'bucket'] else ['job', 'instance', 'couchbase_cluster', 'bucket'], }, + + // additional params + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + + // logs lib related + enableLokiLogs: true, + logLabels: if self.enableMultiCluster then ['job', 'instance', 'cluster', 'level'] else ['job', 'instance', 'level'], + extraLogLabels: [], // Required by logs-lib + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + // alerts thresholds + alertsCriticalCPUUsage: 85, // % + alertsCriticalMemoryUsage: 85, // % + alertsWarningMemoryEvictionRate: 10, // count + alertsWarningInvalidRequestVolume: 1000, // count } diff --git a/couchbase-mixin/dashboards.libsonnet b/couchbase-mixin/dashboards.libsonnet new file mode 100644 index 000000000..9a55bc4e5 --- /dev/null +++ b/couchbase-mixin/dashboards.libsonnet @@ -0,0 +1,153 @@ +local g = import './g.libsonnet'; +local logslib = import 'logs-lib/logs/main.libsonnet'; +{ + local root = self, + new(this):: + local prefix = this.config.dashboardNamePrefix; + local links = this.grafana.links; + local tags = this.config.dashboardTags; + local uid = g.util.string.slugify(this.config.uid); + local vars = this.grafana.variables; + local annotations = this.grafana.annotations; + local refresh = this.config.dashboardRefresh; + local period = this.config.dashboardPeriod; + local timezone = this.config.dashboardTimezone; + local panels = this.grafana.panels; + + { + couchbase_bucket_overview: + g.dashboard.new(prefix + ' bucket overview') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + [ + panels.bucket_topBucketsByMemoryUsedPanel { gridPos+: { w: 12 } }, + panels.bucket_topBucketsByDiskUsedPanel { gridPos+: { w: 12 } }, + panels.bucket_topBucketsByCurrentItemsPanel { gridPos+: { w: 8 } }, + panels.bucket_topBucketsByOperationsPanel { gridPos+: { w: 8 } }, + panels.bucket_topBucketsByOperationsFailedPanel { gridPos+: { w: 8 } }, + panels.bucket_topBucketsByHighPriorityRequestsPanel { gridPos+: { w: 12 } }, + panels.bucket_bottomBucketsByCacheHitRatioPanel { gridPos+: { w: 12 } }, + panels.bucket_topBucketsByVBucketsCountPanel { gridPos+: { w: 12 } }, + panels.bucket_topBucketsByVBucketQueueMemoryPanel { gridPos+: { w: 12 } }, + ], + ) + ) + + root.applyCommon( + vars.bucketVariables, + uid + '_couchbase_bucket_overview', + tags, + links { couchbaseBucketOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + couchbase_node_overview: + g.dashboard.new(prefix + ' node overview') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + [ + panels.node_memoryUtilizationPanel { gridPos+: { w: 12 } }, + panels.node_cpuUtilizationPanel { gridPos+: { w: 12 } }, + panels.node_totalMemoryUsedByServicePanel { gridPos+: { w: 8 } }, + panels.node_backupSizePanel { gridPos+: { w: 8 } }, + panels.node_currentConnectionsPanel { gridPos+: { w: 8 } }, + panels.node_httpResponseCodesPanel { gridPos+: { w: 12 } }, + panels.node_httpRequestMethodsPanel { gridPos+: { w: 12 } }, + panels.node_queryServiceRequestsPanel { gridPos+: { w: 12 } }, + panels.node_queryServiceRequestProcessingTimePanel { gridPos+: { w: 12 } }, + panels.node_indexServiceRequestsPanel { gridPos+: { w: 8 } }, + panels.node_indexCacheHitRatioPanel { gridPos+: { w: 8 } }, + panels.node_averageScanLatencyPanel { gridPos+: { w: 8 } }, + ] + ) + ) + + root.applyCommon( + vars.nodeVariables, + uid + '_couchbase_node_overview', + tags, + links { couchbaseNodeOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + couchbase_cluster_overview: + g.dashboard.new(prefix + ' cluster overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + panels.cluster_topNodesByMemoryUsagePanel { gridPos+: { w: 12 } }, + panels.cluster_topNodesByHTTPRequestsPanel { gridPos+: { w: 12 } }, + panels.cluster_topNodesByQueryServiceRequestsPanel { gridPos+: { w: 12 } }, + panels.cluster_topNodesByIndexAverageScanLatencyPanel { gridPos+: { w: 12 } }, + panels.cluster_xdcrReplicationRatePanel { gridPos+: { w: 8 } }, + panels.cluster_xdcrDocsReceivedPanel { gridPos+: { w: 8 } }, + panels.cluster_localBackupSizePanel { gridPos+: { w: 8 } }, + ] + this.grafana.rows.clusterOverviewBucket, + ) + ) + ) + + root.applyCommon( + vars.clusterVariables, + uid + '_couchbase_cluster_overview', + tags, + links { couchbaseClusterOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + } + + + if this.config.enableLokiLogs then + { + logs: + logslib.new( + prefix + ' logs', + datasourceName=this.grafana.variables.datasources.loki.name, + datasourceRegex=this.grafana.variables.datasources.loki.regex, + filterSelector=this.config.filteringSelector, + labels=this.config.groupLabels + this.config.extraLogLabels, + formatParser=null, + showLogsVolume=this.config.showLogsVolume, + ) + { + dashboards+: + { + logs+: + // reference to self, already generated variables, to keep them, but apply other common data in applyCommon + root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period), + }, + panels+: + { + // modify log panel + logs+: + g.panel.logs.options.withEnableLogDetails(true) + + g.panel.logs.options.withShowTime(false) + + g.panel.logs.options.withWrapLogMessage(false), + }, + variables+: { + // add prometheus datasource for annotations processing + toArray+: [ + this.grafana.variables.datasources.prometheus { hide: 2 }, + ], + }, + }.dashboards.logs, + } + else {}, + + applyCommon(vars, uid, tags, links, annotations, timezone, refresh, period): + g.dashboard.withTags(tags) + + g.dashboard.withUid(uid) + + g.dashboard.withLinks(std.objectValues(links)) + + g.dashboard.withTimezone(timezone) + + g.dashboard.withRefresh(refresh) + + g.dashboard.time.withFrom(period) + + g.dashboard.withVariables(vars) + + g.dashboard.withAnnotations(std.objectValues(annotations)), +} diff --git a/couchbase-mixin/dashboards/couchbase-bucket-overview.libsonnet b/couchbase-mixin/dashboards/couchbase-bucket-overview.libsonnet deleted file mode 100644 index d83ce880e..000000000 --- a/couchbase-mixin/dashboards/couchbase-bucket-overview.libsonnet +++ /dev/null @@ -1,780 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'couchbase-bucket-overview'; - -local promDatasourceName = 'prometheus_datasource'; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local topBucketsByMemoryUsedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, kv_mem_used_bytes{' + matcher + ' })', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - format='time_series', - ), - ], - type: 'timeseries', - title: 'Top buckets by memory used', - description: 'Memory used for the top buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'Bps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByDiskUsedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, couch_docs_actual_disk_size{' + matcher + ' })', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'bargauge', - title: 'Top buckets by disk used', - description: 'Total space on disk used for the top buckets.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'horizontal', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local topBucketsByCurrentItemsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, kv_curr_items{' + matcher + ' })', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by current items', - description: 'Number of active items for the largest buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'none', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByOperationsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{' + matcher + ' }[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}} - {{op}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by operations', - description: 'Rate of operations for the busiest buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: true, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ops', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByOperationsFailedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{' + matcher + ' }[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by operations failed', - description: 'Rate of failed operations for the most problematic buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ops', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByHighPriorityRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{' + matcher + ' }))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by high priority requests', - description: 'Rate of high priority requests processed by the KV engine for the top buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local bottomBucketsByCacheHitRatioPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{' + matcher + ' }[$__rate_interval]))) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{' + matcher + ' }[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{' + matcher + ' }[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Bottom buckets by cache hit ratio', - description: 'Worst buckets by cache hit ratio.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: true, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - max: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percentunit', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByVBucketsCountPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{' + matcher + ' }))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'bargauge', - title: 'Top buckets by vBuckets count', - description: 'Number of virtual buckets across the cluster for the top buckets.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'none', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'horizontal', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local topBucketsByVBucketQueueMemoryPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_vb_queue_memory_bytes{' + matcher + ' }))', - datasource=promDatasource, - legendFormat='{{instance}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by vBucket queue memory', - description: 'Memory occupied by the queue for a virtual bucket for the top buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local getMatcher(cfg) = '%(couchbaseSelector)s, couchbase_cluster=~"$couchbase_cluster", instance=~"$instance", bucket=~"$bucket"' % cfg; - -{ - grafanaDashboards+:: { - 'couchbase-bucket-overview.json': - dashboard.new( - 'Couchbase bucket overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Other Couchbase dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - .addTemplates( - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data source', - refresh='load' - ), - template.new( - 'job', - promDatasource, - 'label_values(kv_mem_used_bytes,job)', - label='Job', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(kv_mem_used_bytes{%(multiclusterSelector)s}, cluster)' % $._config, - label='Cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='.*', - hide=if $._config.enableMultiCluster then '' else 'variable', - sort=0 - ), - template.new( - 'couchbase_cluster', - promDatasource, - 'label_values(kv_mem_used_bytes{%(couchbaseSelector)s},couchbase_cluster)' % $._config, - label='Couchbase cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - template.new( - 'instance', - promDatasource, - 'label_values(kv_mem_used_bytes{%(couchbaseSelector)s},instance)' % $._config, - label='Instance', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - template.new( - 'bucket', - promDatasource, - 'label_values(kv_mem_used_bytes{%(couchbaseSelector)s},bucket)' % $._config, - label='Bucket', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - ] - ) - .addPanels( - [ - topBucketsByMemoryUsedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 0 } }, - topBucketsByDiskUsedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 0 } }, - topBucketsByCurrentItemsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 8 } }, - topBucketsByOperationsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 8 } }, - topBucketsByOperationsFailedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 8 } }, - topBucketsByHighPriorityRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 16 } }, - bottomBucketsByCacheHitRatioPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 16 } }, - topBucketsByVBucketsCountPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 24 } }, - topBucketsByVBucketQueueMemoryPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 24 } }, - ] - ), - }, -} diff --git a/couchbase-mixin/dashboards/couchbase-cluster-overview.libsonnet b/couchbase-mixin/dashboards/couchbase-cluster-overview.libsonnet deleted file mode 100644 index 480ebbbca..000000000 --- a/couchbase-mixin/dashboards/couchbase-cluster-overview.libsonnet +++ /dev/null @@ -1,980 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'couchbase-cluster-overview'; - -local promDatasourceName = 'prometheus_datasource'; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local topNodesByMemoryUsagePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{' + matcher + '})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{' + matcher + '}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{' + matcher + '}))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Top nodes by memory usage', - description: 'Top nodes by memory usage across the Couchbase cluster.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percentunit', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topNodesByHTTPRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{' + matcher + '}[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Top nodes by HTTP requests', - description: 'Rate of HTTP requests handled by the cluster manager for the top nodes.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topNodesByQueryServiceRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{' + matcher + '}[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Top nodes by query service requests', - description: 'Rate of N1QL requests processed by the query service for the top nodes.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topNodesByIndexAverageScanLatencyPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{' + matcher + '}))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Top nodes by index average scan latency', - description: 'Average time to serve an index service scan request for the top nodes.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ns', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local xdcrReplicationRatePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{' + matcher + '}[$__rate_interval]))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}}', - ), - ], - type: 'timeseries', - title: 'XDCR replication rate', - description: 'Rate of replication through the Cross Data Center Replication feature.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'Bps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local xdcrDocsReceivedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{' + matcher + '}[$__rate_interval]))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}}', - ), - ], - type: 'timeseries', - title: 'XDCR docs received', - description: 'The rate of mutations received by this cluster.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'mut/sec', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local localBackupSizePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, job, instance) (backup_data_size{' + matcher + '})', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'bargauge', - title: 'Local backup size', - description: 'The size of the locally replicated data stored, per node.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local bucketsRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Buckets', - collapsed: false, -}; - -local topBucketsByMemoryUsedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{' + matcher + '}))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by memory used', - description: 'Memory used for the top buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByDiskUsedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{' + matcher + '}))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{bucket}}', - ), - ], - type: 'bargauge', - title: 'Top buckets by disk used', - description: 'Space on disk used for the top buckets.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'horizontal', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local topBucketsByOperationsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{' + matcher + '}[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by operations', - description: 'Rate of operations for the busiest buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ops', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByOperationsFailedPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{' + matcher + '}[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{bucket}}', - ), - ], - type: 'timeseries', - title: 'Top buckets by operations failed', - description: 'Rate of operations failed for the most problematic buckets.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ops', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local topBucketsByVBucketsCountPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{' + matcher + '}))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{bucket}}', - ), - ], - type: 'bargauge', - title: 'Top buckets by vBuckets count', - description: 'Number of virtual buckets across the cluster for the top buckets.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'none', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'horizontal', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local getMatcher(cfg) = '%(couchbaseSelector)s, couchbase_cluster=~"$couchbase_cluster"' % cfg; - -{ - grafanaDashboards+:: { - 'couchbase-cluster-overview.json': - dashboard.new( - 'Couchbase cluster overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Other Couchbase dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - .addTemplates( - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data source', - refresh='load' - ), - template.new( - 'job', - promDatasource, - 'label_values(kv_num_vbuckets,job)', - label='Job', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(kv_num_vbuckets{%(multiclusterSelector)s}, cluster)' % $._config, - label='Cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='.*', - hide=if $._config.enableMultiCluster then '' else 'variable', - sort=0 - ), - template.new( - 'couchbase_cluster', - promDatasource, - 'label_values(kv_num_vbuckets{%(couchbaseSelector)s},couchbase_cluster)' % $._config, - label='Couchbase cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - ] - ) - .addPanels( - [ - topNodesByMemoryUsagePanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 0 } }, - topNodesByHTTPRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 0 } }, - topNodesByQueryServiceRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 8 } }, - topNodesByIndexAverageScanLatencyPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 8 } }, - xdcrReplicationRatePanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 16 } }, - xdcrDocsReceivedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 16 } }, - localBackupSizePanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 16 } }, - bucketsRow { gridPos: { h: 1, w: 24, x: 0, y: 24 } }, - topBucketsByMemoryUsedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 25 } }, - topBucketsByDiskUsedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 25 } }, - topBucketsByOperationsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 33 } }, - topBucketsByOperationsFailedPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 33 } }, - topBucketsByVBucketsCountPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 33 } }, - ] - ), - }, -} diff --git a/couchbase-mixin/dashboards/couchbase-node-overview.libsonnet b/couchbase-mixin/dashboards/couchbase-node-overview.libsonnet deleted file mode 100644 index dc227b7dc..000000000 --- a/couchbase-mixin/dashboards/couchbase-node-overview.libsonnet +++ /dev/null @@ -1,1158 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'couchbase-node-overview'; - -local promDatasourceName = 'prometheus_datasource'; -local lokiDatasourceName = 'loki_datasource'; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local lokiDatasource = { - uid: '${%s}' % lokiDatasourceName, -}; - -local memoryUtilizationPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sys_mem_actual_used{' + matcher + '} / (clamp_min(sys_mem_actual_free{' + matcher + '} + sys_mem_actual_used{' + matcher + '}, 1))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Memory utilization', - description: 'Percentage of memory allocated to Couchbase on this node actually in use.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percentunit', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local cpuUtilizationPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{' + matcher + '})', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'CPU utilization', - description: 'CPU utilization percentage across all available cores on this Couchbase node.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local totalMemoryUsedByServicePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'index_memory_used_total{' + matcher + '}', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - index', - ), - prometheus.target( - 'cbas_direct_memory_used_bytes{' + matcher + '}', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - analytics', - ), - prometheus.target( - 'sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{' + matcher + '})', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - data', - ), - ], - type: 'timeseries', - title: 'Total memory used by service', - description: 'Memory used by the index, analytics, and data services for a node.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local backupSizePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, instance, job) (backup_data_size{' + matcher + '})', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'bargauge', - title: 'Backup size', - description: 'Size of locally replicated cluster data for a Couchbase node.', - fieldConfig: { - defaults: { - color: { - fixedColor: 'green', - mode: 'fixed', - }, - mappings: [], - min: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'decbytes', - }, - overrides: [], - }, - options: { - displayMode: 'basic', - minVizHeight: 10, - minVizWidth: 0, - orientation: 'vertical', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - showUnfilled: true, - valueMode: 'color', - }, - pluginVersion: '10.0.2-cloud.1.94a6f396', -}; - -local currentConnectionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'kv_curr_connections{' + matcher + '}', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Current connections', - description: 'Number of active connections to a node.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'stepBefore', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - decimals: 0, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'none', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local httpResponseCodesPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{' + matcher + '}[$__rate_interval]))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - {{code}}', - ), - ], - type: 'timeseries', - title: 'HTTP response codes', - description: 'Rate of HTTP response codes handled by the cluster manager.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - min: 0.001, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local httpRequestMethodsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{' + matcher + '}[$__rate_interval]))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - {{method}}', - ), - ], - type: 'timeseries', - title: 'HTTP request methods', - description: 'Rate of HTTP request methods handled by the cluster manager.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local queryServiceRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(n1ql_requests{' + matcher + '}[$__rate_interval]) + rate(n1ql_invalid_requests{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - total', - ), - prometheus.target( - 'rate(n1ql_errors{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - error', - ), - prometheus.target( - 'rate(n1ql_invalid_requests{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - invalid', - ), - ], - type: 'timeseries', - title: 'Query service requests', - description: 'Rate of N1QL requests processed by the query service for a node.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local queryServiceRequestProcessingTimePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(n1ql_requests{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - >0ms', - ), - prometheus.target( - 'rate(n1ql_requests_250ms{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - >250ms', - ), - prometheus.target( - 'rate(n1ql_requests_500ms{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - >500ms', - ), - prometheus.target( - 'rate(n1ql_requests_1000ms{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - >1000ms', - ), - prometheus.target( - 'rate(n1ql_requests_5000ms{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - >5000ms', - ), - ], - type: 'timeseries', - title: 'Query service request processing time', - description: 'Rate of queries grouped by processing time.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local indexServiceRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, instance, job) (rate(index_num_requests{couchbase_cluster=~"$couchbase_cluster", job=~"$job", instance=~"$instance"}[$__rate_interval]))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Index service requests', - description: 'Rate of index service requests served.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local indexCacheHitRatioPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{' + matcher + '}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{' + matcher + '}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{' + matcher + '}[$__rate_interval])))', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}}', - ), - ], - type: 'timeseries', - title: 'Index cache hit ratio', - description: 'Ratio at which cache scans result in a hit rather than a miss.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: true, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - max: 1, - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percentunit', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local averageScanLatencyPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{' + matcher + '})', - datasource=promDatasource, - legendFormat='{{couchbase_cluster}} - {{instance}} - {{index}}', - ), - ], - type: 'timeseries', - title: 'Average scan latency', - description: 'Average time to serve a scan request per index.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'ns', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'multi', - sort: 'desc', - }, - }, -}; - -local errorLogsPanel(matcher) = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{' + matcher + '} |~ `ns_server:error|couchbase.log.error`', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Error logs', - description: 'Recent error logs from a node.', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: true, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, -}; - -local couchbaseLogsPanel(matcher) = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{' + matcher + '} |~ `couchdb`', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Couchbase logs', - description: 'Recent couchbase logs from a node.', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, -}; - -local getMatcher(cfg) = '%(couchbaseSelector)s, couchbase_cluster=~"$couchbase_cluster", instance=~"$instance"' % cfg; - -{ - grafanaDashboards+:: { - 'couchbase-node-overview.json': - dashboard.new( - 'Couchbase node overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Other Couchbase dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - .addTemplates( - std.flattenArrays([ - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data Source', - refresh='load' - ), - ], - if $._config.enableLokiLogs then [ - template.datasource( - lokiDatasourceName, - 'loki', - null, - label='Loki Datasource', - refresh='load' - ), - ] else [], - [ - template.new( - 'job', - promDatasource, - 'label_values(sys_mem_actual_used,job)', - label='Job', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(sys_mem_actual_used{%(multiclusterSelector)s}, cluster)' % $._config, - label='Cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='.*', - hide=if $._config.enableMultiCluster then '' else 'variable', - sort=0 - ), - template.new( - 'couchbase_cluster', - promDatasource, - 'label_values(sys_mem_actual_used{%(couchbaseSelector)s},couchbase_cluster)' % $._config, - label='Couchbase cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - template.new( - 'instance', - promDatasource, - 'label_values(sys_mem_actual_used{%(couchbaseSelector)s},instance)' % $._config, - label='Instance', - refresh=2, - includeAll=true, - multi=true, - allValues='', - sort=0 - ), - ], - ]) - ) - .addPanels( - std.flattenArrays([ - [ - memoryUtilizationPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 0 } }, - cpuUtilizationPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 0 } }, - totalMemoryUsedByServicePanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 8 } }, - backupSizePanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 8 } }, - currentConnectionsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 8 } }, - httpResponseCodesPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 16 } }, - httpRequestMethodsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 16 } }, - queryServiceRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 24 } }, - queryServiceRequestProcessingTimePanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 24 } }, - indexServiceRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 32 } }, - indexCacheHitRatioPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 32 } }, - averageScanLatencyPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 32 } }, - ], - if $._config.enableLokiLogs then [ - errorLogsPanel(getMatcher($._config)) { gridPos: { h: 7, w: 24, x: 0, y: 40 } }, - ] else [], - [ - ], - if $._config.enableLokiLogs then [ - couchbaseLogsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 24, x: 0, y: 47 } }, - ] else [], - [ - ], - ]) - ), - }, -} diff --git a/couchbase-mixin/dashboards/dashboards.libsonnet b/couchbase-mixin/dashboards/dashboards.libsonnet deleted file mode 100644 index ac01ff83c..000000000 --- a/couchbase-mixin/dashboards/dashboards.libsonnet +++ /dev/null @@ -1,3 +0,0 @@ -(import 'couchbase-bucket-overview.libsonnet') + -(import 'couchbase-cluster-overview.libsonnet') + -(import 'couchbase-node-overview.libsonnet') diff --git a/couchbase-mixin/dashboards_out/couchbase-bucket-overview.json b/couchbase-mixin/dashboards_out/couchbase-bucket-overview.json deleted file mode 100644 index 2e340e339..000000000 --- a/couchbase-mixin/dashboards_out/couchbase-bucket-overview.json +++ /dev/null @@ -1,965 +0,0 @@ -{ - "__inputs": [ ], - "__requires": [ ], - "annotations": { - "list": [ ] - }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [ - { - "asDropdown": false, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "couchbase-mixin" - ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" - } - ], - "panels": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Memory used for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Bps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, kv_mem_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by memory used", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Total space on disk used for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, couch_docs_actual_disk_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by disk used", - "type": "bargauge" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Number of active items for the largest buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, kv_curr_items{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by current items", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of operations for the busiest buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}} - {{op}}" - } - ], - "title": "Top buckets by operations", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of failed operations for the most problematic buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by operations failed", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of high priority requests processed by the KV engine for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 16 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by high priority requests", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Worst buckets by cache hit ratio.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "max": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 16 - }, - "id": 8, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval]))) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Bottom buckets by cache hit ratio", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Number of virtual buckets across the cluster for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 24 - }, - "id": 9, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by vBuckets count", - "type": "bargauge" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Memory occupied by the queue for a virtual bucket for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 24 - }, - "id": 10, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_vb_queue_memory_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" - } - ], - "title": "Top buckets by vBucket queue memory", - "type": "timeseries" - } - ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", - "tags": [ - "couchbase-mixin" - ], - "templating": { - "list": [ - { - "current": { }, - "hide": 0, - "label": "Data source", - "name": "prometheus_datasource", - "options": [ ], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": false, - "label": "Job", - "multi": false, - "name": "job", - "options": [ ], - "query": "label_values(kv_mem_used_bytes,job)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 2, - "includeAll": true, - "label": "Cluster", - "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"}, cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Couchbase cluster", - "multi": true, - "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"},couchbase_cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Instance", - "multi": true, - "name": "instance", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"},instance)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Bucket", - "multi": true, - "name": "bucket", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"},bucket)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "default", - "title": "Couchbase bucket overview", - "uid": "couchbase-bucket-overview", - "version": 0 - } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/couchbase-cluster-overview.json b/couchbase-mixin/dashboards_out/couchbase-cluster-overview.json deleted file mode 100644 index 748eaa542..000000000 --- a/couchbase-mixin/dashboards_out/couchbase-cluster-overview.json +++ /dev/null @@ -1,1184 +0,0 @@ -{ - "__inputs": [ ], - "__requires": [ ], - "annotations": { - "list": [ ] - }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [ - { - "asDropdown": false, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "couchbase-mixin" - ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" - } - ], - "panels": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Top nodes by memory usage across the Couchbase cluster.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Top nodes by memory usage", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of HTTP requests handled by the cluster manager for the top nodes.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Top nodes by HTTP requests", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of N1QL requests processed by the query service for the top nodes.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Top nodes by query service requests", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Average time to serve an index service scan request for the top nodes.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ns" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Top nodes by index average scan latency", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of replication through the Cross Data Center Replication feature.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Bps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 16 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}}" - } - ], - "title": "XDCR replication rate", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "The rate of mutations received by this cluster.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "mut/sec" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 16 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}}" - } - ], - "title": "XDCR docs received", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "The size of the locally replicated data stored, per node.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 16 - }, - "id": 8, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, job, instance) (backup_data_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Local backup size", - "type": "bargauge" - }, - { - "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 9, - "targets": [ ], - "title": "Buckets", - "type": "row" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Memory used for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 25 - }, - "id": 10, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" - } - ], - "title": "Top buckets by memory used", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Space on disk used for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 25 - }, - "id": 11, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" - } - ], - "title": "Top buckets by disk used", - "type": "bargauge" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of operations for the busiest buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 33 - }, - "id": 12, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" - } - ], - "title": "Top buckets by operations", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of operations failed for the most problematic buckets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ops" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 33 - }, - "id": 13, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" - } - ], - "title": "Top buckets by operations failed", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Number of virtual buckets across the cluster for the top buckets.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 33 - }, - "id": 14, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"}))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" - } - ], - "title": "Top buckets by vBuckets count", - "type": "bargauge" - } - ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", - "tags": [ - "couchbase-mixin" - ], - "templating": { - "list": [ - { - "current": { }, - "hide": 0, - "label": "Data source", - "name": "prometheus_datasource", - "options": [ ], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": false, - "label": "Job", - "multi": false, - "name": "job", - "options": [ ], - "query": "label_values(kv_num_vbuckets,job)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 2, - "includeAll": true, - "label": "Cluster", - "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(kv_num_vbuckets{job=~\"$job\"}, cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Couchbase cluster", - "multi": true, - "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(kv_num_vbuckets{job=~\"$job\"},couchbase_cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "default", - "title": "Couchbase cluster overview", - "uid": "couchbase-cluster-overview", - "version": 0 - } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/couchbase-node-overview.json b/couchbase-mixin/dashboards_out/couchbase-node-overview.json deleted file mode 100644 index c29407795..000000000 --- a/couchbase-mixin/dashboards_out/couchbase-node-overview.json +++ /dev/null @@ -1,1399 +0,0 @@ -{ - "__inputs": [ ], - "__requires": [ ], - "annotations": { - "list": [ ] - }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [ - { - "asDropdown": false, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "couchbase-mixin" - ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" - } - ], - "panels": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Percentage of memory allocated to Couchbase on this node actually in use.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sys_mem_actual_used{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"} / (clamp_min(sys_mem_actual_free{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"} + sys_mem_actual_used{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}, 1))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Memory utilization", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "CPU utilization percentage across all available cores on this Couchbase node.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "CPU utilization", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Memory used by the index, analytics, and data services for a node.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "index_memory_used_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - index" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "cbas_direct_memory_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - analytics" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - data" - } - ], - "title": "Total memory used by service", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Size of locally replicated cluster data for a Couchbase node.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 5, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, instance, job) (backup_data_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Backup size", - "type": "bargauge" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Number of active connections to a node.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "stepBefore", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "kv_curr_connections{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Current connections", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of HTTP response codes handled by the cluster manager.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "min": 0.001, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 16 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{code}}" - } - ], - "title": "HTTP response codes", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of HTTP request methods handled by the cluster manager.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 16 - }, - "id": 8, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{method}}" - } - ], - "title": "HTTP request methods", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of N1QL requests processed by the query service for a node.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 24 - }, - "id": 9, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval]) + rate(n1ql_invalid_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - total" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_errors{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - error" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_invalid_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - invalid" - } - ], - "title": "Query service requests", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of queries grouped by processing time.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 24 - }, - "id": 10, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >0ms" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests_250ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >250ms" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests_500ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >500ms" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests_1000ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >1000ms" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "rate(n1ql_requests_5000ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >5000ms" - } - ], - "title": "Query service request processing time", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Rate of index service requests served.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 32 - }, - "id": 11, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, instance, job) (rate(index_num_requests{couchbase_cluster=~\"$couchbase_cluster\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Index service requests", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Ratio at which cache scans result in a hit rather than a miss.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "max": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 32 - }, - "id": 12, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" - } - ], - "title": "Index cache hit ratio", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "description": "Average time to serve a scan request per index.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ns" - }, - "overrides": [ ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 32 - }, - "id": 13, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "uid": "${prometheus_datasource}" - }, - "expr": "sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{index}}" - } - ], - "title": "Average scan latency", - "type": "timeseries" - }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "Recent error logs from a node.", - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 40 - }, - "id": 14, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": true, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"} |~ `ns_server:error|couchbase.log.error`", - "queryType": "range", - "refId": "A" - } - ], - "title": "Error logs", - "type": "logs" - }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "Recent couchbase logs from a node.", - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 47 - }, - "id": 15, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"} |~ `couchdb`", - "queryType": "range", - "refId": "A" - } - ], - "title": "Couchbase logs", - "type": "logs" - } - ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", - "tags": [ - "couchbase-mixin" - ], - "templating": { - "list": [ - { - "current": { }, - "hide": 0, - "label": "Data Source", - "name": "prometheus_datasource", - "options": [ ], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "current": { }, - "hide": 0, - "label": "Loki Datasource", - "name": "loki_datasource", - "options": [ ], - "query": "loki", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": false, - "label": "Job", - "multi": false, - "name": "job", - "options": [ ], - "query": "label_values(sys_mem_actual_used,job)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 2, - "includeAll": true, - "label": "Cluster", - "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"}, cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Couchbase cluster", - "multi": true, - "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"},couchbase_cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": { }, - "datasource": { - "uid": "${prometheus_datasource}" - }, - "hide": 0, - "includeAll": true, - "label": "Instance", - "multi": true, - "name": "instance", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"},instance)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "default", - "title": "Couchbase node overview", - "uid": "couchbase-node-overview", - "version": 0 - } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/couchbase_bucket_overview b/couchbase-mixin/dashboards_out/couchbase_bucket_overview new file mode 100644 index 000000000..85723d96f --- /dev/null +++ b/couchbase-mixin/dashboards_out/couchbase_bucket_overview @@ -0,0 +1,559 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Couchbase Cluster Overview", + "type": "link", + "url": "/d/couchbase_couchbase_cluster_overview" + }, + { + "keepTime": true, + "title": "Couchbase Node Overview", + "type": "link", + "url": "/d/couchbase_couchbase_node_overview" + }, + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/couchbase-logs" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "couchbase-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Memory used for the top buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, kv_mem_used_bytes{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"})", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by memory used", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Disk used for the top buckets.", + "fieldConfig": { + "defaults": { + "min": 0, + "thresholds": { + "steps": [ + { + "color": "light-green", + "value": null + } + ] + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "orientation": "horizontal" + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, couch_docs_actual_disk_size{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"})", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by disk used", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Number of active items for the largest buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "none" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_curr_items{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}))", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by current items", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of operations for the busiest buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ops" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}[$__rate_interval])))", + "legendFormat": "{{instance}} - {{bucket}} - {{op}}" + } + ], + "title": "Top buckets by operations", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of operations failed for the most problematic buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ops" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}[$__rate_interval])))", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by operations failed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of high priority requests processed by the KV engine for the top buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}))", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by high priority requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Worst buckets by cache hit ratio.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": true + }, + "max": 1, + "unit": "percentunit" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 7, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}[$__rate_interval]))))", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Bottom buckets by cache hit ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The number of vBuckets for the top buckets.", + "fieldConfig": { + "defaults": { + "min": 0, + "thresholds": { + "steps": [ + { + "color": "light-green", + "value": null + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 8, + "options": { + "orientation": "horizontal" + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"}))", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by vBuckets count", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Memory occupied by the queue for a virtual bucket for the top buckets.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, kv_mem_used_bytes{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\",bucket=~\"$bucket\"})", + "legendFormat": "{{instance}} - {{bucket}}" + } + ], + "title": "Top buckets by vBucket queue memory", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "couchbase-mixin" + ], + "templating": { + "list": [ + { + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Instance", + "multi": true, + "name": "instance", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, instance)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Couchbase_cluster", + "multi": true, + "name": "couchbase_cluster", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",instance=~\"$instance\"}, couchbase_cluster)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Bucket", + "multi": true, + "name": "bucket", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}, bucket)", + "refresh": 2, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "Couchbase bucket overview", + "uid": "couchbase_couchbase_bucket_overview" + } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/couchbase_cluster_overview b/couchbase-mixin/dashboards_out/couchbase_cluster_overview new file mode 100644 index 000000000..6c2603521 --- /dev/null +++ b/couchbase-mixin/dashboards_out/couchbase_cluster_overview @@ -0,0 +1,718 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Couchbase Bucket Overview", + "type": "link", + "url": "/d/couchbase_couchbase_bucket_overview" + }, + { + "keepTime": true, + "title": "Couchbase Node Overview", + "type": "link", + "url": "/d/couchbase_couchbase_node_overview" + }, + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/couchbase-logs" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "couchbase-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Top nodes by memory usage across the Couchbase cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "percentunit" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Top nodes by memory usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of HTTP requests handled by the cluster manager for the top nodes.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Top nodes by HTTP requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of N1QL requests processed by the query service for the top nodes.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Top nodes by query service requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Average time to serve an index service scan request for the top nodes.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ns" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Top nodes by index average scan latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of replication through the Cross Data Center Replication feature.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "Bps" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 16 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", + "legendFormat": "{{couchbase_cluster}}" + } + ], + "title": "XDCR replication rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "The rate of mutations received by this cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "mut/sec" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 16 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", + "legendFormat": "{{couchbase_cluster}}" + } + ], + "title": "XDCR docs received", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Size of the local backup for a node.", + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 16 + }, + "id": 7, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, job, instance) (backup_data_size{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"})", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Local backup size", + "type": "bargauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 24, + "y": 24 + }, + "id": 8, + "panels": [ ], + "title": "Buckets", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Memory used for the top buckets across the cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 25 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by memory used", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Disk used for the top buckets across the cluster.", + "fieldConfig": { + "defaults": { + "min": 0, + "thresholds": { + "steps": [ + { + "color": "light-green", + "value": null + } + ] + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 25 + }, + "id": 10, + "options": { + "orientation": "horizontal" + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by disk used", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of operations for the busiest buckets across the cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ops" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 33 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by operations", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of operations failed for the most problematic buckets across the cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ops" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 33 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by operations failed", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The number of vBuckets for the top buckets across the cluster.", + "fieldConfig": { + "defaults": { + "min": 0, + "thresholds": { + "steps": [ + { + "color": "light-green", + "value": null + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 41 + }, + "id": 13, + "options": { + "orientation": "horizontal" + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by vBuckets count", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Memory occupied by the queue for a virtual bucket for the top buckets across the cluster.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 41 + }, + "id": 14, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_vb_queue_memory_bytes{job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}))", + "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + } + ], + "title": "Top buckets by vBucket queue memory", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "couchbase-mixin" + ], + "templating": { + "list": [ + { + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": false, + "name": "job", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Couchbase_cluster", + "multi": false, + "name": "couchbase_cluster", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, couchbase_cluster)", + "refresh": 2, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "Couchbase cluster overview", + "uid": "couchbase_couchbase_cluster_overview" + } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/couchbase_node_overview b/couchbase-mixin/dashboards_out/couchbase_node_overview new file mode 100644 index 000000000..61e8a02ce --- /dev/null +++ b/couchbase-mixin/dashboards_out/couchbase_node_overview @@ -0,0 +1,769 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Couchbase Bucket Overview", + "type": "link", + "url": "/d/couchbase_couchbase_bucket_overview" + }, + { + "keepTime": true, + "title": "Couchbase Cluster Overview", + "type": "link", + "url": "/d/couchbase_couchbase_cluster_overview" + }, + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/couchbase-logs" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "couchbase-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Percentage of memory allocated to Couchbase on this node actually in use.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "percentunit" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sys_mem_actual_used{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"} / (clamp_min(sys_mem_actual_free{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"} + sys_mem_actual_used{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}, 1))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Memory utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "CPU utilization percentage across all available cores on this Couchbase node.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "percent" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"})", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "CPU utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Memory used by the index, analytics, and data services for a node.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"})", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - data" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "index_memory_used_total{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - index" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "cbas_direct_memory_used_bytes{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - analytics" + } + ], + "title": "Total memory used by service", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Size of the backup for a node.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, instance, job) (backup_data_size{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"})", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Backup size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Number of active connections to a node.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "none" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "kv_curr_connections{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Current connections", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of HTTP response codes handled by the cluster manager.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{code}}" + } + ], + "title": "HTTP response codes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of HTTP request methods handled by the cluster manager.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 7, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{method}}" + } + ], + "title": "HTTP request methods", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of N1QL requests processed by the query service for a node.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 8, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]) + rate(n1ql_invalid_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_errors{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - error" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_invalid_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - invalid" + } + ], + "title": "Query service requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of queries grouped by processing time.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >0ms" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests_250ms{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >250ms" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests_500ms{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >500ms" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests_1000ms{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >1000ms" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "rate(n1ql_requests_5000ms{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >5000ms" + } + ], + "title": "Query service request processing time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Rate of index service requests served.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 32 + }, + "id": 10, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, instance, job) (rate(index_num_requests{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval]))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Index service requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Ratio at which cache scans result in a hit rather than a miss.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": true + }, + "unit": "percentunit" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 32 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"}[$__rate_interval])))", + "legendFormat": "{{couchbase_cluster}} - {{instance}}" + } + ], + "title": "Index cache hit ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "description": "Average time to serve a scan request per index.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "ns" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 32 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "expr": "sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{job=~\"$job\",instance=~\"$instance\",couchbase_cluster=~\"$couchbase_cluster\"})", + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{index}}" + } + ], + "title": "Average scan latency", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "couchbase-mixin" + ], + "templating": { + "list": [ + { + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Instance", + "multi": true, + "name": "instance", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, instance)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Couchbase_cluster", + "multi": true, + "name": "couchbase_cluster", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",instance=~\"$instance\"}, couchbase_cluster)", + "refresh": 2, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "Couchbase node overview", + "uid": "couchbase_couchbase_node_overview" + } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/logs b/couchbase-mixin/dashboards_out/logs new file mode 100644 index 000000000..21c5ac386 --- /dev/null +++ b/couchbase-mixin/dashboards_out/logs @@ -0,0 +1,310 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Couchbase Bucket Overview", + "type": "link", + "url": "/d/couchbase_couchbase_bucket_overview" + }, + { + "keepTime": true, + "title": "Couchbase Cluster Overview", + "type": "link", + "url": "/d/couchbase_couchbase_cluster_overview" + }, + { + "keepTime": true, + "title": "Couchbase Node Overview", + "type": "link", + "url": "/d/couchbase_couchbase_node_overview" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "couchbase-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "description": "Logs volume grouped by \"level\" label.", + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "bars", + "fillOpacity": 50, + "stacking": { + "mode": "normal" + } + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)merg|(F|f)atal|(A|a)lert|(C|c)rit.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)(rr.*|RR.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(W|w)(arn.*|ARN.*|rn|RN)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(N|n)(otice|ote)|(I|i)(nf.*|NF.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "dbg.*|DBG.*|(D|d)(EBUG|ebug)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(T|t)(race|RACE)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "logs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "sum by (level) (count_over_time({job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}\n|~ \"$regex_search\"\n\n[$__auto]))\n", + "legendFormat": "{{ level }}" + } + ], + "title": "Logs volume", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "logs" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 2, + "options": { + "dedupStrategy": "exact", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showTime": false, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "couchbase-mixin" + ], + "templating": { + "list": [ + { + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values({job=~\"integrations/couchbase\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Couchbase_cluster", + "multi": true, + "name": "couchbase_cluster", + "query": "label_values({job=~\"integrations/couchbase\",job=~\"$job\"}, couchbase_cluster)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "label": "Regex search", + "name": "regex_search", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "", + "type": "textbox" + }, + { + "hide": 2, + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "Couchbase logs", + "uid": "couchbase-logs" + } \ No newline at end of file diff --git a/couchbase-mixin/g.libsonnet b/couchbase-mixin/g.libsonnet new file mode 100644 index 000000000..f89dcc064 --- /dev/null +++ b/couchbase-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/couchbase-mixin/jsonnetfile.json b/couchbase-mixin/jsonnetfile.json index 65cebf84b..69b58cc74 100644 --- a/couchbase-mixin/jsonnetfile.json +++ b/couchbase-mixin/jsonnetfile.json @@ -1,15 +1,33 @@ { - "version": 1, - "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } - }, - "version": "master" + "version": 1, + "dependencies": [ + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" } - ], - "legacyImports": true -} + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet.git", + "subdir": "gen/grafonnet-v10.0.0" + } + }, + "version": "main" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "logs-lib" + } + }, + "version": "master" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/couchbase-mixin/links.libsonnet b/couchbase-mixin/links.libsonnet new file mode 100644 index 000000000..5b3e0cb10 --- /dev/null +++ b/couchbase-mixin/links.libsonnet @@ -0,0 +1,32 @@ +local g = import './g.libsonnet'; +{ + local link = g.dashboard.link, + new(this): + { + couchbaseBucketOverview: + link.link.new('Couchbase Bucket Overview', '/d/' + this.grafana.dashboards.couchbase_bucket_overview.uid) + + link.link.options.withKeepTime(true), + + couchbaseNodeOverview: + link.link.new('Couchbase Node Overview', '/d/' + this.grafana.dashboards.couchbase_node_overview.uid) + + link.link.options.withKeepTime(true), + + couchbaseClusterOverview: + link.link.new('Couchbase Cluster Overview', '/d/' + this.grafana.dashboards.couchbase_cluster_overview.uid) + + link.link.options.withKeepTime(true), + + otherDashboards: + link.dashboards.new('All dashboards', this.config.dashboardTags) + + link.dashboards.options.withIncludeVars(true) + + link.dashboards.options.withKeepTime(true) + + link.dashboards.options.withAsDropdown(true), + } + + + if this.config.enableLokiLogs then + { + logs: + link.link.new('Logs', '/d/' + this.grafana.dashboards.logs.uid) + + link.link.options.withKeepTime(true), + } + else {}, +} diff --git a/couchbase-mixin/main.libsonnet b/couchbase-mixin/main.libsonnet new file mode 100644 index 000000000..3e70509cd --- /dev/null +++ b/couchbase-mixin/main.libsonnet @@ -0,0 +1,35 @@ +local alerts = import './alerts.libsonnet'; +local config = import './config.libsonnet'; +local dashboards = import './dashboards.libsonnet'; +local links = import './links.libsonnet'; +local panels = import './panels.libsonnet'; +local rows = import './rows.libsonnet'; +local targets = import './targets.libsonnet'; +local variables = import './variables.libsonnet'; + +{ + withConfigMixin(config): { + config+: config, + }, + + new(): { + + local this = self, + config: config, + + grafana: { + variables: variables.new(this, varMetric='kv_mem_used_bytes'), + targets: targets.new(this), + annotations: {}, + links: links.new(this), + panels: panels.new(this), + dashboards: dashboards.new(this), + rows: rows.new(panels.new(this)), + }, + + prometheus: { + alerts: alerts.new(this), + recordingRules: {}, + }, + }, +} diff --git a/couchbase-mixin/mixin.libsonnet b/couchbase-mixin/mixin.libsonnet index 4d987cf31..8c5556134 100644 --- a/couchbase-mixin/mixin.libsonnet +++ b/couchbase-mixin/mixin.libsonnet @@ -1,3 +1,18 @@ -(import 'dashboards/dashboards.libsonnet') + -(import 'alerts/alerts.libsonnet') + -(import 'config.libsonnet') +local couchbaselib = import './main.libsonnet'; + +local couchbase = + couchbaselib.new() + + couchbaselib.withConfigMixin( + { + filteringSelector: 'job=~"integrations/couchbase"', + uid: 'couchbase', + enableLokiLogs: true, + } + ); + +// populate monitoring-mixin: +{ + grafanaDashboards+:: couchbase.grafana.dashboards, + prometheusAlerts+:: couchbase.prometheus.alerts, + prometheusRules+:: couchbase.prometheus.recordingRules, +} diff --git a/couchbase-mixin/panels.libsonnet b/couchbase-mixin/panels.libsonnet new file mode 100644 index 000000000..db4e6bf6b --- /dev/null +++ b/couchbase-mixin/panels.libsonnet @@ -0,0 +1,448 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this):: + { + local t = this.grafana.targets, + local barGauge = g.panel.barGauge, + + // + // Bucket Overview Dashboard Panels + // + + bucket_topBucketsByMemoryUsedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by memory used', + targets=[ + t.bucketTopBucketsByMemoryUsed, + ], + description='Memory used for the top buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + bucket_topBucketsByDiskUsedPanel: + barGauge.new( + 'Top buckets by disk used' + ) + + barGauge.queryOptions.withTargets([ + t.topBucketsByDiskUsedDetailed, + ]) + + barGauge.standardOptions.withUnit('decbytes') + + barGauge.standardOptions.withMin(0) + + barGauge.options.withOrientation('horizontal') + + barGauge.standardOptions.thresholds.withSteps([ + barGauge.thresholdStep.withColor('light-green') + + barGauge.thresholdStep.withValue(null), + ]) + + barGauge.panelOptions.withDescription('Disk used for the top buckets.'), + + bucket_topBucketsByCurrentItemsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by current items', + targets=[ + t.topBucketsByCurrentItems, + ], + description='Number of active items for the largest buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('none') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + bucket_topBucketsByOperationsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by operations', + targets=[ + t.topBucketsByOperationsWithOp, + ], + description='Rate of operations for the busiest buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ops') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + bucket_topBucketsByOperationsFailedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by operations failed', + targets=[ + t.topBucketsByOperationsFailedDetailed, + ], + description='Rate of operations failed for the most problematic buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ops') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + bucket_topBucketsByHighPriorityRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by high priority requests', + targets=[ + t.topBucketsByHighPriorityRequests, + ], + description='Rate of high priority requests processed by the KV engine for the top buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + bucket_bottomBucketsByCacheHitRatioPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Bottom buckets by cache hit ratio', + targets=[ + t.bottomBucketsByCacheHitRatio, + ], + description='Worst buckets by cache hit ratio.' + ) + + g.panel.timeSeries.standardOptions.withMax(1) + + g.panel.timeSeries.standardOptions.withUnit('percentunit') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(true), + + bucket_topBucketsByVBucketsCountPanel: + barGauge.new(title='Top buckets by vBuckets count') + + barGauge.queryOptions.withTargets([ + t.bucketTopBucketsByVBucketsCount, + ]) + + barGauge.panelOptions.withDescription('The number of vBuckets for the top buckets.') + + barGauge.standardOptions.withMin(0) + + barGauge.options.withOrientation('horizontal') + + barGauge.standardOptions.thresholds.withSteps([ + barGauge.thresholdStep.withColor('light-green') + + barGauge.thresholdStep.withValue(null), + ]) + + barGauge.standardOptions.withUnit('none'), + + bucket_topBucketsByVBucketQueueMemoryPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by vBucket queue memory', + targets=[ + t.bucketTopBucketsByMemoryUsed, + ], + description='Memory occupied by the queue for a virtual bucket for the top buckets.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + // + // Node Overview Dashboard Panels + // + + node_memoryUtilizationPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Memory utilization', + targets=[ + t.memoryUtilization, + ], + description='Percentage of memory allocated to Couchbase on this node actually in use.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percentunit') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_cpuUtilizationPanel: + commonlib.panels.generic.timeSeries.base.new( + 'CPU utilization', + targets=[ + t.cpuUtilization, + ], + description='CPU utilization percentage across all available cores on this Couchbase node.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_totalMemoryUsedByServicePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Total memory used by service', + targets=[ + t.totalMemoryUsedByService, + t.totalMemoryUsedByIndexService, + t.totalMemoryUsedByAnalyticsService, + ], + description='Memory used by the index, analytics, and data services for a node.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_backupSizePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Backup size', + targets=[ + t.backupSize, + ], + description='Size of the backup for a node.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_currentConnectionsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Current connections', + targets=[ + t.currentConnections, + ], + description='Number of active connections to a node.' + ) + + g.panel.timeSeries.standardOptions.withUnit('none') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_httpResponseCodesPanel: + commonlib.panels.generic.timeSeries.base.new( + 'HTTP response codes', + targets=[ + t.httpResponseCodes, + ], + description='Rate of HTTP response codes handled by the cluster manager.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_httpRequestMethodsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'HTTP request methods', + targets=[ + t.httpRequestMethods, + ], + description='Rate of HTTP request methods handled by the cluster manager.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_queryServiceRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Query service requests', + targets=[ + t.queryServiceRequestsTotal, + t.queryServiceErrors, + t.queryServiceInvalidRequests, + ], + description='Rate of N1QL requests processed by the query service for a node.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_queryServiceRequestProcessingTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Query service request processing time', + targets=[ + t.queryServiceRequests, + t.queryServiceRequests250ms, + t.queryServiceRequests500ms, + t.queryServiceRequests1000ms, + t.queryServiceRequests5000ms, + ], + description='Rate of queries grouped by processing time.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_indexServiceRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Index service requests', + targets=[ + t.indexServiceRequests, + ], + description='Rate of index service requests served.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + node_indexCacheHitRatioPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Index cache hit ratio', + targets=[ + t.indexCacheHitRatio, + ], + description='Ratio at which cache scans result in a hit rather than a miss.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percentunit') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(true), + + node_averageScanLatencyPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Average scan latency', + targets=[ + t.indexAverageScanLatency, + ], + description='Average time to serve a scan request per index.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ns') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + // + // Cluster Overview Dashboard Panels + // + + cluster_topNodesByMemoryUsagePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top nodes by memory usage', + targets=[ + t.topNodesByMemoryUsage, + ], + description='Top nodes by memory usage across the Couchbase cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percentunit') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topNodesByHTTPRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top nodes by HTTP requests', + targets=[ + t.topNodesByHTTPRequests, + ], + description='Rate of HTTP requests handled by the cluster manager for the top nodes.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topNodesByQueryServiceRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top nodes by query service requests', + targets=[ + t.topNodesByQueryServiceRequests, + ], + description='Rate of N1QL requests processed by the query service for the top nodes.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topNodesByIndexAverageScanLatencyPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top nodes by index average scan latency', + targets=[ + t.topNodesByIndexAverageScanLatency, + ], + description='Average time to serve an index service scan request for the top nodes.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ns') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_xdcrReplicationRatePanel: + commonlib.panels.generic.timeSeries.base.new( + 'XDCR replication rate', + targets=[ + t.xdcrReplicationRate, + ], + description='Rate of replication through the Cross Data Center Replication feature.' + ) + + g.panel.timeSeries.standardOptions.withUnit('Bps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_xdcrDocsReceivedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'XDCR docs received', + targets=[ + t.xdcrDocsReceived, + ], + description='The rate of mutations received by this cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('mut/sec') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_localBackupSizePanel: + barGauge.new( + 'Local backup size' + ) + + barGauge.queryOptions.withTargets([ + t.localBackupSize, + ]) + + barGauge.panelOptions.withDescription('Size of the local backup for a node.'), + + cluster_topBucketsByMemoryUsedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by memory used', + targets=[ + t.topBucketsByMemoryUsed, + ], + description='Memory used for the top buckets across the cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topBucketsByDiskUsedPanel: + barGauge.new( + 'Top buckets by disk used' + ) + + barGauge.queryOptions.withTargets([ + t.topBucketsByDiskUsed, + ]) + + barGauge.standardOptions.withUnit('decbytes') + + barGauge.standardOptions.withMin(0) + + barGauge.options.withOrientation('horizontal') + + barGauge.standardOptions.thresholds.withSteps([ + barGauge.thresholdStep.withColor('light-green') + + barGauge.thresholdStep.withValue(null), + ]) + + barGauge.panelOptions.withDescription('Disk used for the top buckets across the cluster.'), + + cluster_topBucketsByOperationsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by operations', + targets=[ + t.clusterTopBucketsByOperations, + ], + description='Rate of operations for the busiest buckets across the cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ops') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topBucketsByOperationsFailedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by operations failed', + targets=[ + t.clusterTopBucketsByOperationsFailed, + ], + description='Rate of operations failed for the most problematic buckets across the cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('ops') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + cluster_topBucketsByVBucketsCountPanel: + barGauge.new(title='Top buckets by vBuckets count') + + barGauge.queryOptions.withTargets([ + t.clusterTopBucketsByVBucketsCount, + ]) + + barGauge.panelOptions.withDescription('The number of vBuckets for the top buckets across the cluster.') + + barGauge.standardOptions.withMin(0) + + barGauge.options.withOrientation('horizontal') + + barGauge.standardOptions.thresholds.withSteps([ + barGauge.thresholdStep.withColor('light-green') + + barGauge.thresholdStep.withValue(null), + ]) + + barGauge.standardOptions.withUnit('none'), + + cluster_topBucketsByVBucketQueueMemoryPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by vBucket queue memory', + targets=[ + t.clusterTopBucketsByVBucketQueueMemory, + ], + description='Memory occupied by the queue for a virtual bucket for the top buckets across the cluster.' + ) + + g.panel.timeSeries.standardOptions.withUnit('decbytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + }, +} diff --git a/couchbase-mixin/rows.libsonnet b/couchbase-mixin/rows.libsonnet new file mode 100644 index 000000000..5bea489bf --- /dev/null +++ b/couchbase-mixin/rows.libsonnet @@ -0,0 +1,18 @@ +local g = import './g.libsonnet'; +local panels = import './panels.libsonnet'; + +// Use g.util.grid.wrapPanels() to import into custom dashboard +{ + new(panels): { + clusterOverviewBucket: + [ + g.panel.row.new('Buckets'), + panels.cluster_topBucketsByMemoryUsedPanel { gridPos+: { w: 12 } }, + panels.cluster_topBucketsByDiskUsedPanel { gridPos+: { w: 12 } }, + panels.cluster_topBucketsByOperationsPanel { gridPos+: { w: 12 } }, + panels.cluster_topBucketsByOperationsFailedPanel { gridPos+: { w: 12 } }, + panels.cluster_topBucketsByVBucketsCountPanel { gridPos+: { w: 12 } }, + panels.cluster_topBucketsByVBucketQueueMemoryPanel { gridPos+: { w: 12 } }, + ], + }, +} diff --git a/couchbase-mixin/targets.libsonnet b/couchbase-mixin/targets.libsonnet new file mode 100644 index 000000000..628830572 --- /dev/null +++ b/couchbase-mixin/targets.libsonnet @@ -0,0 +1,325 @@ +local g = import './g.libsonnet'; +local prometheusQuery = g.query.prometheus; + +{ + new(this): { + local vars = this.grafana.variables, + local clusterSelector = vars.clusterSelector, + local nodeSelector = vars.nodeSelector, + local bucketSelector = vars.bucketSelector, + + // + // Cluster Overview Dashboard Targets + // + + // Top nodes metrics + topNodesByMemoryUsage: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{%(clusterSelector)s})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{%(clusterSelector)s}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + topNodesByHTTPRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{%(clusterSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + topNodesByQueryServiceRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{%(clusterSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + topNodesByIndexAverageScanLatency: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + // XDCR metrics + xdcrReplicationRate: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{%(clusterSelector)s}[$__rate_interval]))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}}'), + + xdcrDocsReceived: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{%(clusterSelector)s}[$__rate_interval]))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}}'), + + // Backup metrics + localBackupSize: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, job, instance) (backup_data_size{%(clusterSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + // Top buckets metrics (cluster level) + topBucketsByMemoryUsed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + topBucketsByDiskUsed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + clusterTopBucketsByOperations: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{%(clusterSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + clusterTopBucketsByOperationsFailed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{%(clusterSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + clusterTopBucketsByVBucketsCount: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + clusterTopBucketsByVBucketQueueMemory: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_vb_queue_memory_bytes{%(clusterSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{bucket}}'), + + // + // Node Overview Dashboard Targets + // + + // Node system metrics + memoryUtilization: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sys_mem_actual_used{%(nodeSelector)s} / (clamp_min(sys_mem_actual_free{%(nodeSelector)s} + sys_mem_actual_used{%(nodeSelector)s}, 1))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + cpuUtilization: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{%(nodeSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + // Memory by service + totalMemoryUsedByService: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{%(nodeSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - data'), + + totalMemoryUsedByIndexService: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'index_memory_used_total{%(nodeSelector)s}' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - index'), + + totalMemoryUsedByAnalyticsService: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'cbas_direct_memory_used_bytes{%(nodeSelector)s}' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - analytics'), + + // Node backup and connections + backupSize: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, instance, job) (backup_data_size{%(nodeSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + currentConnections: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'kv_curr_connections{%(nodeSelector)s}' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + // HTTP metrics + httpResponseCodes: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{%(nodeSelector)s}[$__rate_interval]))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - {{code}}'), + + httpRequestMethods: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{%(nodeSelector)s}[$__rate_interval]))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - {{method}}'), + + // Query service metrics + queryServiceRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - >0ms'), + + queryServiceRequestsTotal: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests{%(nodeSelector)s}[$__rate_interval]) + rate(n1ql_invalid_requests{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - total'), + + queryServiceErrors: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_errors{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - error'), + + queryServiceInvalidRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_invalid_requests{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - invalid'), + + // Query service latency buckets + queryServiceRequests250ms: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests_250ms{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - >250ms'), + + queryServiceRequests500ms: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests_500ms{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - >500ms'), + + queryServiceRequests1000ms: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests_1000ms{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - >1000ms'), + + queryServiceRequests5000ms: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'rate(n1ql_requests_5000ms{%(nodeSelector)s}[$__rate_interval])' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - >5000ms'), + + // Index service metrics + indexServiceRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, instance, job) (rate(index_num_requests{%(nodeSelector)s}[$__rate_interval]))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + indexCacheHitRatio: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{%(nodeSelector)s}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{%(nodeSelector)s}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{%(nodeSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}}'), + + indexAverageScanLatency: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{%(nodeSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{couchbase_cluster}} - {{instance}} - {{index}}'), + + // + // Bucket Overview Dashboard Targets + // + + // Detailed bucket metrics (instance-level) + bucketTopBucketsByMemoryUsed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, kv_mem_used_bytes{%(bucketSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + topBucketsByDiskUsedDetailed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, couch_docs_actual_disk_size{%(bucketSelector)s})' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + topBucketsByCurrentItems: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_curr_items{%(bucketSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + // Bucket operations + topBucketsByOperationsWithOp: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{%(bucketSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}} - {{op}}'), + + topBucketsByOperationsFailedDetailed: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{%(bucketSelector)s}[$__rate_interval])))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + topBucketsByHighPriorityRequests: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{%(bucketSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + // Bucket cache and performance + bottomBucketsByCacheHitRatio: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{%(bucketSelector)s}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{%(bucketSelector)s}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{%(bucketSelector)s}[$__rate_interval]))))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + + // Bucket vBuckets + bucketTopBucketsByVBucketsCount: + prometheusQuery.new( + '${' + vars.datasources.prometheus.name + '}', + 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{%(bucketSelector)s}))' % vars + ) + + prometheusQuery.withLegendFormat('{{instance}} - {{bucket}}'), + }, +} diff --git a/couchbase-mixin/variables.libsonnet b/couchbase-mixin/variables.libsonnet new file mode 100644 index 000000000..519144a48 --- /dev/null +++ b/couchbase-mixin/variables.libsonnet @@ -0,0 +1,100 @@ +local g = import './g.libsonnet'; +local var = g.dashboard.variable; +local commonlib = import 'common-lib/common/main.libsonnet'; +local utils = commonlib.utils; + +// Generates chained variables to use on all dashboards +{ + new(this, varMetric): + { + local filteringSelector = this.config.filteringSelector, + local groupLabels = this.config.groupLabels, + local instanceLabels = this.config.instanceLabels, + + local root = self, + // Helper function to create variables from specific label list + local variablesFromSpecificLabels(labels, filteringSelector, multiInstance=true) = + local chainVarProto(index, chainVar) = + var.query.new(chainVar.label) + + var.query.withDatasourceFromVariable(root.datasources.prometheus) + + var.query.queryTypes.withLabelValues( + chainVar.label, + // Combine filteringSelector with chainSelector, avoiding duplicate label filters + local combinedSelector = + if std.length(std.stripChars(filteringSelector, ' ')) == 0 then chainVar.chainSelector + else if std.length(chainVar.chainSelector) == 0 then std.stripChars(filteringSelector, ' ') + else + // Both exist - need to merge intelligently to avoid duplicates + local filteringParts = std.split(std.stripChars(filteringSelector, ' '), ','); + local filteringLabels = std.set([ + std.stripChars(std.split(std.stripChars(part, ' '), '=')[0], ' ') + for part in filteringParts + if std.length(std.split(part, '=')) > 1 + ]); + local chainParts = std.split(chainVar.chainSelector, ','); + local chainFiltered = std.filter( + function(part) + local label = std.stripChars(std.split(std.stripChars(part, ' '), '=')[0], ' '); + !std.setMember(label, filteringLabels), + chainParts + ); + std.join(',', std.filter(function(x) std.length(x) > 0, [std.stripChars(filteringSelector, ' ')] + chainFiltered)); + '%s{%s}' % [varMetric, combinedSelector], + ) + + var.query.generalOptions.withLabel(utils.toSentenceCase(chainVar.label)) + + var.query.selectionOptions.withIncludeAll( + value=true, + customAllValue='.+' + ) + + var.query.selectionOptions.withMulti(multiInstance) + + var.query.refresh.onTime() + + var.query.withSort( + i=1, + type='alphabetical', + asc=true, + caseInsensitive=false + ); + + // Create variables for all labels, let chainLabels handle the chaining without filteringSelector + std.mapWithIndex(chainVarProto, utils.chainLabels(labels, [])), + + datasources: { + prometheus: + var.datasource.new('prometheus_datasource', 'prometheus') + + var.datasource.generalOptions.withLabel('Prometheus data source') + + var.datasource.withRegex(''), + loki: + var.datasource.new('loki_datasource', 'loki') + + var.datasource.generalOptions.withLabel('Loki data source') + + var.datasource.withRegex(''), + }, + + // Dashboard-specific variable sets + clusterVariables: + [root.datasources.prometheus] + + variablesFromSpecificLabels(this.config.dashboardVariables.cluster, filteringSelector, multiInstance=false), + + nodeVariables: + [root.datasources.prometheus] + + variablesFromSpecificLabels(this.config.dashboardVariables.node, filteringSelector, multiInstance=true), + + bucketVariables: + [root.datasources.prometheus] + + variablesFromSpecificLabels(this.config.dashboardVariables.bucket, filteringSelector, multiInstance=true), + + clusterSelector: + '%s' % [ + utils.labelsToPromQLSelector(this.config.dashboardVariables.cluster), + ], + + nodeSelector: + '%s' % [ + utils.labelsToPromQLSelector(this.config.dashboardVariables.node), + ], + + bucketSelector: + '%s' % [ + utils.labelsToPromQLSelector(this.config.dashboardVariables.bucket), + ], + }, +}