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..38ee660a8 100644 --- a/couchbase-mixin/config.libsonnet +++ b/couchbase-mixin/config.libsonnet @@ -1,19 +1,41 @@ { - _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', + enableMultiCluster: false, + filteringSelector: 'job=~"integrations/couchbase"', + groupLabels: if self.enableMultiCluster then ['job', 'cluster', 'couchbase_cluster'] else ['job', 'couchbase_cluster'], + instanceLabels: ['instance'], + dashboardTags: ['couchbase-mixin'], + uid: 'couchbase', + dashboardNamePrefix: 'Couchbase', - // alerts thresholds - alertsCriticalCPUUsage: 85, // % - alertsCriticalMemoryUsage: 85, // % - alertsWarningMemoryEvictionRate: 10, // count - alertsWarningInvalidRequestVolume: 1000, // count - enableLokiLogs: true, + // 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 + + // metrics source for signals library + metricsSource: 'prometheus', + + // expose signals library + local config = self, + signals+: { + cluster: (import './signals/cluster.libsonnet')(config), + node: (import './signals/node.libsonnet')(config), + query: (import './signals/query.libsonnet')(config), + bucket: (import './signals/bucket.libsonnet')(config), + index: (import './signals/index.libsonnet')(config), }, } diff --git a/couchbase-mixin/dashboards.libsonnet b/couchbase-mixin/dashboards.libsonnet new file mode 100644 index 000000000..659321c20 --- /dev/null +++ b/couchbase-mixin/dashboards.libsonnet @@ -0,0 +1,155 @@ +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.json': + 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.multiInstance, + uid + '_couchbase_bucket_overview', + tags, + links { couchbaseBucketOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + 'couchbase-node-overview.json': + g.dashboard.new(prefix + ' node overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + 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.multiInstance, + uid + '_couchbase_node_overview', + tags, + links { couchbaseNodeOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + 'couchbase-cluster-overview.json': + 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.multiInstance, + uid + '_couchbase_cluster_overview', + tags, + links { couchbaseClusterOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + } + + + if this.config.enableLokiLogs then + { + 'logs.json': + 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 index 2e340e339..6911c5687 100644 --- a/couchbase-mixin/dashboards_out/couchbase-bucket-overview.json +++ b/couchbase-mixin/dashboards_out/couchbase-bucket-overview.json @@ -1,88 +1,56 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, "links": [ { - "asDropdown": false, - "icon": "external link", + "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" ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" } ], "panels": [ { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, - "unit": "Bps" - }, - "overrides": [ ] + "unit": "decbytes" + } }, "gridPos": { "h": 8, @@ -90,28 +58,29 @@ "x": 0, "y": 0 }, - "id": 2, + "id": 1, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", + "expr": "topk(5, kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket memory used" } ], "title": "Top buckets by memory used", @@ -119,33 +88,23 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Total space on disk used for the top buckets.", + "description": "Disk used for the top buckets.", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, + "min": 0, "thresholds": { - "mode": "absolute", "steps": [ { - "color": "green", + "color": "light-green", "value": null - }, - { - "color": "red", - "value": 80 } ] }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -153,32 +112,22 @@ "x": 12, "y": 0 }, - "id": 3, + "id": 2, "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" + "orientation": "horizontal" }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "topk(5, couch_docs_actual_disk_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", + "expr": "topk(5, couch_docs_actual_disk_size{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket disk used" } ], "title": "Top buckets by disk used", @@ -186,61 +135,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "none" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -248,28 +158,29 @@ "x": 0, "y": 8 }, - "id": 4, + "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "topk(5, kv_curr_items{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" })", + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_curr_items{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket current items" } ], "title": "Top buckets by current items", @@ -277,61 +188,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ops" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -339,28 +211,29 @@ "x": 8, "y": 8 }, - "id": 5, + "id": 4, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])))", + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}} - {{op}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}} - {{op}}", + "refId": "Bucket operations by operation type" } ], "title": "Top buckets by operations", @@ -368,61 +241,22 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Rate of failed operations for the most problematic buckets.", + "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", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ops" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -430,28 +264,29 @@ "x": 16, "y": 8 }, - "id": 6, + "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }[$__rate_interval])))", + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket operations failed" } ], "title": "Top buckets by operations failed", @@ -459,61 +294,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -521,28 +317,29 @@ "x": 0, "y": 16 }, - "id": 7, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }))", + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket high priority requests" } ], "title": "Top buckets by high priority requests", @@ -550,62 +347,23 @@ }, { "datasource": { + "type": "prometheus", "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" - } + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": true }, - "mappings": [ ], "max": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "percentunit" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -613,28 +371,29 @@ "x": 12, "y": 16 }, - "id": 8, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", 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])))", + "expr": "bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket cache hit ratio" } ], "title": "Bottom buckets by cache hit ratio", @@ -642,32 +401,23 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Number of virtual buckets across the cluster for the top buckets.", + "description": "The number of vBuckets for the top buckets.", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, + "min": 0, "thresholds": { - "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "light-green", + "value": null } ] }, "unit": "none" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -675,32 +425,22 @@ "x": 0, "y": 24 }, - "id": 9, + "id": 8, "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" + "orientation": "horizontal" }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "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\" }))", + "expr": "topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{instance}} - {{bucket}}", + "refId": "Bucket vBuckets count" } ], "title": "Top buckets by vBuckets count", @@ -708,60 +448,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -769,28 +471,29 @@ "x": 12, "y": 24 }, - "id": 10, + "id": 9, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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_vb_queue_memory_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\", bucket=~\"$bucket\" }))", + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_vb_queue_memory_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{instance}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by vBucket queue memory" } ], "title": "Top buckets by vBucket queue memory", @@ -798,134 +501,71 @@ } ], "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "schemaVersion": 39, "tags": [ "couchbase-mixin" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "refresh": 1, "regex": "", "type": "datasource" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "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", + "label": "Job", "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"}, cluster)", + "name": "job", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, - "label": "Couchbase cluster", + "label": "Couchbase_cluster", "multi": true, "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"},couchbase_cluster)", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\"}, couchbase_cluster)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Instance", "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(kv_mem_used_bytes{job=~\"$job\"},instance)", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}, instance)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "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, + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "datasource" } ] }, @@ -933,33 +573,7 @@ "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 + "uid": "couchbase_couchbase_bucket_overview" } \ 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 index 748eaa542..1e6891d1f 100644 --- a/couchbase-mixin/dashboards_out/couchbase-cluster-overview.json +++ b/couchbase-mixin/dashboards_out/couchbase-cluster-overview.json @@ -1,88 +1,56 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, "links": [ { - "asDropdown": false, - "icon": "external link", + "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" ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" } ], "panels": [ { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "percentunit" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -90,28 +58,29 @@ "x": 0, "y": 0 }, - "id": 2, + "id": 1, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\"}))", + "expr": "topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Top nodes by memory usage" } ], "title": "Top nodes by memory usage", @@ -119,61 +88,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -181,28 +111,29 @@ "x": 12, "y": 0 }, - "id": 3, + "id": 2, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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])))", + "expr": "topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Top nodes by HTTP requests" } ], "title": "Top nodes by HTTP requests", @@ -210,61 +141,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -272,28 +164,29 @@ "x": 0, "y": 8 }, - "id": 4, + "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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])))", + "expr": "topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Top nodes by query service requests" } ], "title": "Top nodes by query service requests", @@ -301,61 +194,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ns" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -363,28 +217,29 @@ "x": 12, "y": 8 }, - "id": 5, + "id": 4, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\"}))", + "expr": "topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Top nodes by index average scan latency" } ], "title": "Top nodes by index average scan latency", @@ -392,61 +247,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "Bps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -454,28 +270,29 @@ "x": 0, "y": 16 }, - "id": 6, + "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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]))", + "expr": "sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}}", + "refId": "XDCR replication rate" } ], "title": "XDCR replication rate", @@ -483,61 +300,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "mut/sec" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -545,28 +323,29 @@ "x": 8, "y": 16 }, - "id": 7, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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]))", + "expr": "sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}}", + "refId": "XDCR docs received" } ], "title": "XDCR docs received", @@ -574,66 +353,29 @@ }, { "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": [ ] + "type": "datasource", + "uid": "-- Mixed --" }, + "description": "Size of the local backup for a node.", "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", + "id": 7, + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by(couchbase_cluster, job, instance) (backup_data_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\"})", + "expr": "sum by(couchbase_cluster, job, instance) (backup_data_size{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Local backup size" } ], "title": "Local backup size", @@ -641,77 +383,35 @@ }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, - "x": 0, + "w": 0, + "x": 24, "y": 24 }, - "id": 9, - "targets": [ ], + "id": 8, + "panels": [ ], "title": "Buckets", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Memory used for the top buckets.", + "description": "Memory used for the top buckets across the 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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -719,28 +419,29 @@ "x": 0, "y": 25 }, - "id": 10, + "id": 9, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\"}))", + "expr": "topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by memory used" } ], "title": "Top buckets by memory used", @@ -748,33 +449,23 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Space on disk used for the top buckets.", + "description": "Disk used for the top buckets across the cluster.", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, + "min": 0, "thresholds": { - "mode": "absolute", "steps": [ { - "color": "green", + "color": "light-green", "value": null - }, - { - "color": "red", - "value": 80 } ] }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -782,32 +473,22 @@ "x": 12, "y": 25 }, - "id": 11, + "id": 10, "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" + "orientation": "horizontal" }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", + "pluginVersion": "v11.4.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\"}))", + "expr": "topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by disk used" } ], "title": "Top buckets by disk used", @@ -815,89 +496,52 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Rate of operations for the busiest buckets.", + "description": "Rate of operations for the busiest buckets across the 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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ops" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, - "w": 8, + "w": 12, "x": 0, "y": 33 }, - "id": 12, + "id": 11, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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])))", + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by operations" } ], "title": "Top buckets by operations", @@ -905,89 +549,52 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Rate of operations failed for the most problematic buckets.", + "description": "Rate of operations failed for the most problematic buckets across the 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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ops" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, - "w": 8, - "x": 8, + "w": 12, + "x": 12, "y": 33 }, - "id": 13, + "id": 12, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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])))", + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by operations failed" } ], "title": "Top buckets by operations failed", @@ -995,156 +602,171 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, - "description": "Number of virtual buckets across the cluster for the top buckets.", + "description": "The number of vBuckets for the top buckets across the cluster.", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, + "min": 0, "thresholds": { - "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "light-green", + "value": null } ] }, "unit": "none" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, - "w": 8, - "x": 16, - "y": 33 + "w": 12, + "x": 0, + "y": 41 }, - "id": 14, + "id": 13, "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "valueMode": "color" + "orientation": "horizontal" }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", + "pluginVersion": "v11.4.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\"}))", + "expr": "topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{bucket}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by vBuckets count" } ], "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=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}))", + "format": "time_series", + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{bucket}}", + "refId": "Top buckets by vBucket queue memory" + } + ], + "title": "Top buckets by vBucket queue memory", + "type": "timeseries" } ], "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "schemaVersion": 39, "tags": [ "couchbase-mixin" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "refresh": 1, "regex": "", "type": "datasource" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, + "includeAll": true, "label": "Job", - "multi": false, + "multi": true, "name": "job", - "options": [ ], - "query": "label_values(kv_num_vbuckets,job)", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": ".*", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, "includeAll": true, - "label": "Cluster", + "label": "Couchbase_cluster", "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(kv_num_vbuckets{job=~\"$job\"}, cluster)", + "name": "couchbase_cluster", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\"}, couchbase_cluster)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, - "label": "Couchbase cluster", + "label": "Instance", "multi": true, - "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(kv_num_vbuckets{job=~\"$job\"},couchbase_cluster)", + "name": "instance", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}, instance)", "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "datasource" } ] }, @@ -1152,33 +774,7 @@ "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 + "uid": "couchbase_couchbase_cluster_overview" } \ 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 index c29407795..b1a9c629f 100644 --- a/couchbase-mixin/dashboards_out/couchbase-node-overview.json +++ b/couchbase-mixin/dashboards_out/couchbase-node-overview.json @@ -1,88 +1,56 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", - "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, "links": [ { - "asDropdown": false, - "icon": "external link", + "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" ], - "targetBlank": false, - "title": "Other Couchbase dashboards", - "type": "dashboards", - "url": "" + "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": { - "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "percentunit" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -90,28 +58,29 @@ "x": 0, "y": 0 }, - "id": 2, + "id": 1, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", 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))", + "expr": "sys_mem_actual_used{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"} / (clamp_min(sys_mem_actual_free{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"} + sys_mem_actual_used{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}, 1))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Memory utilization" } ], "title": "Memory utilization", @@ -119,61 +88,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -181,28 +111,29 @@ "x": 12, "y": 0 }, - "id": 3, + "id": 2, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", + "expr": "sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "CPU utilization" } ], "title": "CPU utilization", @@ -210,61 +141,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -272,46 +164,51 @@ "x": 0, "y": 8 }, - "id": 4, + "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "index_memory_used_total{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", + "expr": "sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - index" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - data", + "refId": "Data service memory used" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "cbas_direct_memory_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", + "expr": "index_memory_used_total{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - analytics" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - index", + "refId": "Index service memory used" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", + "expr": "cbas_direct_memory_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - data" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - analytics", + "refId": "Analytics service memory used" } ], "title": "Total memory used by service", @@ -319,33 +216,22 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Size of locally replicated cluster data for a Couchbase node.", + "description": "Size of the backup for a node.", "fieldConfig": { "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [ ], - "min": 1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "decbytes" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -353,95 +239,52 @@ "x": 8, "y": 8 }, - "id": 5, + "id": 4, "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [ ], + "displayMode": "list" }, - "showUnfilled": true, - "valueMode": "color" + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "pluginVersion": "10.0.2-cloud.1.94a6f396", + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "sum by(couchbase_cluster, instance, job) (backup_data_size{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", + "expr": "sum by(couchbase_cluster, instance, job) (backup_data_size{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Backup size" } ], "title": "Backup size", - "type": "bargauge" + "type": "timeseries" }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "none" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -449,28 +292,29 @@ "x": 16, "y": 8 }, - "id": 6, + "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "kv_curr_connections{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}", + "expr": "kv_curr_connections{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Current connections" } ], "title": "Current connections", @@ -478,62 +322,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -541,28 +345,29 @@ "x": 0, "y": 16 }, - "id": 7, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval]))", + "expr": "sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{code}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{code}}", + "refId": "HTTP response codes" } ], "title": "HTTP response codes", @@ -570,61 +375,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -632,28 +398,29 @@ "x": 12, "y": 16 }, - "id": 8, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval]))", + "expr": "sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{method}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{method}}", + "refId": "HTTP request methods" } ], "title": "HTTP request methods", @@ -661,61 +428,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -723,46 +451,51 @@ "x": 0, "y": 24 }, - "id": 9, + "id": 8, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "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])", + "expr": "rate(n1ql_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]) + rate(n1ql_invalid_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - total" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - total", + "refId": "Query service requests total" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_errors{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_errors{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - error" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - error", + "refId": "Query service errors" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_invalid_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_invalid_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - invalid" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - invalid", + "refId": "Query service invalid requests" } ], "title": "Query service requests", @@ -770,61 +503,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -832,64 +526,73 @@ "x": 12, "y": 24 }, - "id": 10, + "id": 9, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_requests{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >0ms" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >0ms", + "refId": "Query service requests" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_requests_250ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_requests_250ms{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >250ms" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >250ms", + "refId": "Query service requests >250ms" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_requests_500ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_requests_500ms{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >500ms" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >500ms", + "refId": "Query service requests >500ms" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_requests_1000ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_requests_1000ms{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >1000ms" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >1000ms", + "refId": "Query service requests >1000ms" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(n1ql_requests_5000ms{job=~\"$job\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(n1ql_requests_5000ms{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - >5000ms" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - >5000ms", + "refId": "Query service requests >5000ms" } ], "title": "Query service request processing time", @@ -897,61 +600,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -959,28 +623,29 @@ "x": 0, "y": 32 }, - "id": 11, + "id": 10, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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{couchbase_cluster=~\"$couchbase_cluster\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]))", + "expr": "sum by(couchbase_cluster, instance, job) (rate(index_num_requests{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Index service requests" } ], "title": "Index service requests", @@ -988,62 +653,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": true }, "unit": "percentunit" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1051,28 +676,29 @@ "x": 8, "y": 32 }, - "id": 12, + "id": 11, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", 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])))", + "expr": "sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"}[$__rate_interval])))", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}}", + "refId": "Index cache hit ratio" } ], "title": "Index cache hit ratio", @@ -1080,61 +706,22 @@ }, { "datasource": { + "type": "prometheus", "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 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "ns" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1142,224 +729,101 @@ "x": 16, "y": 32 }, - "id": 13, + "id": 12, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "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\", couchbase_cluster=~\"$couchbase_cluster\", instance=~\"$instance\"})", + "expr": "sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\",instance=~\"$instance\"})", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{index}}" + "instant": false, + "legendFormat": "{{couchbase_cluster}} - {{instance}} - {{index}}", + "refId": "Index average scan latency" } ], "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", + "schemaVersion": 39, "tags": [ "couchbase-mixin" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data Source", + "label": "Prometheus 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": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, "includeAll": true, - "label": "Cluster", + "label": "Job", "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"}, cluster)", + "name": "job", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\"}, job)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, - "label": "Couchbase cluster", + "label": "Couchbase_cluster", "multi": true, "name": "couchbase_cluster", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"},couchbase_cluster)", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\"}, couchbase_cluster)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Instance", "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(sys_mem_actual_used{job=~\"$job\"},instance)", + "query": "label_values(kv_mem_used_bytes{job=~\"integrations/couchbase\",job=~\"$job\",couchbase_cluster=~\"$couchbase_cluster\"}, instance)", "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "datasource" } ] }, @@ -1367,33 +831,7 @@ "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 + "uid": "couchbase_couchbase_node_overview" } \ No newline at end of file diff --git a/couchbase-mixin/dashboards_out/logs.json b/couchbase-mixin/dashboards_out/logs.json new file mode 100644 index 000000000..21c5ac386 --- /dev/null +++ b/couchbase-mixin/dashboards_out/logs.json @@ -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..e6a2060ee --- /dev/null +++ b/couchbase-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/main.libsonnet' diff --git a/couchbase-mixin/jsonnetfile.json b/couchbase-mixin/jsonnetfile.json index 65cebf84b..89c9bd0da 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-v11.4.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..4f7d2b4a2 --- /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.json'].uid) + + link.link.options.withKeepTime(true), + + couchbaseNodeOverview: + link.link.new('Couchbase Node Overview', '/d/' + this.grafana.dashboards['couchbase-node-overview.json'].uid) + + link.link.options.withKeepTime(true), + + couchbaseClusterOverview: + link.link.new('Couchbase Cluster Overview', '/d/' + this.grafana.dashboards['couchbase-cluster-overview.json'].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.json'].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..7f26e8cee --- /dev/null +++ b/couchbase-mixin/main.libsonnet @@ -0,0 +1,49 @@ +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 commonlib = import 'common-lib/common/main.libsonnet'; + +{ + withConfigMixin(config): { + config+: config, + }, + + new(): { + + local this = self, + config: config, + + signals: + { + [sig]: commonlib.signals.unmarshallJsonMulti( + this.config.signals[sig], + type=this.config.metricsSource + ) + for sig in std.objectFields(this.config.signals) + }, + + grafana: { + variables: commonlib.variables.new( + filteringSelector=this.config.filteringSelector, + groupLabels=this.config.groupLabels, + instanceLabels=this.config.instanceLabels, + varMetric='kv_mem_used_bytes', + customAllValue='.+', + enableLokiLogs=this.config.enableLokiLogs, + ), + 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..b4bb38e44 --- /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 signals = this.signals, + local barGauge = g.panel.barGauge, + + // + // Bucket Overview Dashboard Panels + // + + bucket_topBucketsByMemoryUsedPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Top buckets by memory used', + targets=[ + signals.bucket.bucketMemoryUsed.asTarget(), + ], + 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([ + signals.bucket.bucketDiskUsed.asTarget(), + ]) + + 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=[ + signals.bucket.bucketCurrentItems.asTarget(), + ], + 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=[ + signals.bucket.bucketOperationsWithOp.asTarget(), + ], + 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=[ + signals.bucket.bucketOperationsFailed.asTarget(), + ], + 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=[ + signals.bucket.bucketHighPriorityRequests.asTarget(), + ], + 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=[ + signals.bucket.bucketCacheHitRatio.asTarget(), + ], + 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([ + signals.bucket.bucketVBucketsCount.asTarget(), + ]) + + 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=[ + signals.cluster.topBucketsByVBucketQueueMemory.asTarget(), + ], + 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=[ + signals.node.memoryUtilization.asTarget(), + ], + 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=[ + signals.node.cpuUtilization.asTarget(), + ], + 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=[ + signals.node.dataServiceMemoryUsed.asTarget(), + signals.node.indexServiceMemoryUsed.asTarget(), + signals.node.analyticsServiceMemoryUsed.asTarget(), + ], + 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=[ + signals.node.backupSize.asTarget(), + ], + 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=[ + signals.node.currentConnections.asTarget(), + ], + 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=[ + signals.node.httpResponseCodes.asTarget(), + ], + 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=[ + signals.node.httpRequestMethods.asTarget(), + ], + 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=[ + signals.query.queryServiceRequestsTotal.asTarget(), + signals.query.queryServiceErrors.asTarget(), + signals.query.queryServiceInvalidRequests.asTarget(), + ], + 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=[ + signals.query.queryServiceRequests.asTarget(), + signals.query.queryServiceRequests250ms.asTarget(), + signals.query.queryServiceRequests500ms.asTarget(), + signals.query.queryServiceRequests1000ms.asTarget(), + signals.query.queryServiceRequests5000ms.asTarget(), + ], + 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=[ + signals.index.indexServiceRequests.asTarget(), + ], + 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=[ + signals.index.indexCacheHitRatio.asTarget(), + ], + 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=[ + signals.index.indexAverageScanLatency.asTarget(), + ], + 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=[ + signals.cluster.topNodesByMemoryUsage.asTarget(), + ], + 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=[ + signals.cluster.topNodesByHTTPRequests.asTarget(), + ], + 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=[ + signals.cluster.topNodesByQueryServiceRequests.asTarget(), + ], + 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=[ + signals.cluster.topNodesByIndexAverageScanLatency.asTarget(), + ], + 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=[ + signals.cluster.xdcrReplicationRate.asTarget(), + ], + 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=[ + signals.cluster.xdcrDocsReceived.asTarget(), + ], + 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([ + signals.cluster.localBackupSize.asTarget(), + ]) + + 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=[ + signals.cluster.topBucketsByMemoryUsed.asTarget(), + ], + 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([ + signals.cluster.topBucketsByDiskUsed.asTarget(), + ]) + + 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=[ + signals.cluster.topBucketsByOperations.asTarget(), + ], + 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=[ + signals.cluster.topBucketsByOperationsFailed.asTarget(), + ], + 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([ + signals.cluster.topBucketsByVBucketsCount.asTarget(), + ]) + + 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=[ + signals.cluster.topBucketsByVBucketQueueMemory.asTarget(), + ], + 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/signals/bucket.libsonnet b/couchbase-mixin/signals/bucket.libsonnet new file mode 100644 index 000000000..cb42d0a6e --- /dev/null +++ b/couchbase-mixin/signals/bucket.libsonnet @@ -0,0 +1,129 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '2m', + discoveryMetric: { + prometheus: 'kv_mem_used_bytes', + }, + signals: { + // Bucket memory and disk usage + bucketMemoryUsed: { + name: 'Bucket memory used', + nameShort: 'Memory', + type: 'gauge', + description: 'Memory used for the top buckets.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'topk(5, kv_mem_used_bytes{%(queriesSelector)s})', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + bucketDiskUsed: { + name: 'Bucket disk used', + nameShort: 'Disk', + type: 'gauge', + description: 'Disk used for the top buckets.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'topk(5, couch_docs_actual_disk_size{%(queriesSelector)s})', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + bucketCurrentItems: { + name: 'Bucket current items', + nameShort: 'Items', + type: 'gauge', + description: 'Number of active items for the largest buckets.', + unit: 'none', + sources: { + prometheus: { + expr: 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_curr_items{%(queriesSelector)s}))', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + + // Bucket operations + bucketOperationsWithOp: { + name: 'Bucket operations by operation type', + nameShort: 'Operations', + type: 'raw', + description: 'Rate of operations for the busiest buckets by operation type.', + unit: 'ops', + sources: { + prometheus: { + expr: 'topk(5, sum by(bucket, couchbase_cluster, instance, job, op) (rate(kv_ops{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{instance}} - {{bucket}} - {{op}}', + }, + }, + }, + bucketOperationsFailed: { + name: 'Bucket operations failed', + nameShort: 'Failed Ops', + type: 'raw', + description: 'Rate of operations failed for the most problematic buckets.', + unit: 'ops', + sources: { + prometheus: { + expr: 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (rate(kv_ops_failed{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + bucketHighPriorityRequests: { + name: 'Bucket high priority requests', + nameShort: 'High Priority', + type: 'gauge', + description: 'Rate of high priority requests processed by the KV engine for the top buckets.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_high_pri_requests{%(queriesSelector)s}))', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + + // Bucket cache performance + bucketCacheHitRatio: { + name: 'Bucket cache hit ratio', + nameShort: 'Cache Hit %', + type: 'raw', + description: 'Worst buckets by cache hit ratio.', + unit: 'percentunit', + sources: { + prometheus: { + expr: 'bottomk(5, sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{%(queriesSelector)s}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_hits{%(queriesSelector)s}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance, bucket) (increase(index_cache_misses{%(queriesSelector)s}[$__rate_interval]))))', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + + // Bucket vBuckets + bucketVBucketsCount: { + name: 'Bucket vBuckets count', + nameShort: 'vBuckets', + type: 'raw', + description: 'The number of vBuckets for the top buckets.', + unit: 'none', + sources: { + prometheus: { + expr: 'topk(5, sum by(bucket, couchbase_cluster, instance, job) (kv_num_vbuckets{%(queriesSelector)s}))', + legendCustomTemplate: '{{instance}} - {{bucket}}', + }, + }, + }, + }, + } diff --git a/couchbase-mixin/signals/cluster.libsonnet b/couchbase-mixin/signals/cluster.libsonnet new file mode 100644 index 000000000..38592fbea --- /dev/null +++ b/couchbase-mixin/signals/cluster.libsonnet @@ -0,0 +1,193 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '2m', + discoveryMetric: { + prometheus: 'sys_mem_actual_used', + }, + signals: { + // Top nodes metrics + topNodesByMemoryUsage: { + name: 'Top nodes by memory usage', + nameShort: 'Memory', + type: 'raw', + description: 'Top nodes by memory usage across the Couchbase cluster.', + unit: 'percentunit', + sources: { + prometheus: { + expr: 'topk(5, sum by(job, couchbase_cluster, instance) (sys_mem_actual_used{%(queriesSelector)s})) / (sum by(job, couchbase_cluster, instance) (clamp_min(sys_mem_actual_free{%(queriesSelector)s}, 1)) + sum by(couchbase_cluster, instance, job) (sys_mem_actual_used{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + topNodesByHTTPRequests: { + name: 'Top nodes by HTTP requests', + nameShort: 'HTTP Requests', + type: 'raw', + description: 'Rate of HTTP requests handled by the cluster manager for the top nodes.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'topk(5, sum by(job, couchbase_cluster, instance) (rate(cm_http_requests_total{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + topNodesByQueryServiceRequests: { + name: 'Top nodes by query service requests', + nameShort: 'N1QL Requests', + type: 'raw', + description: 'Rate of N1QL requests processed by the query service for the top nodes.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'topk(5, sum by(job, instance, couchbase_cluster) (rate(n1ql_requests{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + topNodesByIndexAverageScanLatency: { + name: 'Top nodes by index average scan latency', + nameShort: 'Scan Latency', + type: 'raw', + description: 'Average time to serve an index service scan request for the top nodes.', + unit: 'ns', + sources: { + prometheus: { + expr: 'topk(5, avg by(instance, couchbase_cluster, job) (index_avg_scan_latency{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // XDCR metrics + xdcrReplicationRate: { + name: 'XDCR replication rate', + nameShort: 'XDCR Rate', + type: 'raw', + description: 'Rate of replication through the Cross Data Center Replication feature.', + unit: 'Bps', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, job) (rate(xdcr_data_replicated_bytes{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{couchbase_cluster}}', + }, + }, + }, + xdcrDocsReceived: { + name: 'XDCR docs received', + nameShort: 'XDCR Docs', + type: 'raw', + description: 'The rate of mutations received by this cluster.', + unit: 'mut/sec', + sources: { + prometheus: { + expr: 'sum by(job, couchbase_cluster) (rate(xdcr_docs_received_from_dcp_total{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{couchbase_cluster}}', + }, + }, + }, + + // Backup metrics + localBackupSize: { + name: 'Local backup size', + nameShort: 'Backup', + type: 'raw', + description: 'Size of the local backup for a node.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, job, instance) (backup_data_size{%(queriesSelector)s})', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // Top buckets metrics (cluster level) + topBucketsByMemoryUsed: { + name: 'Top buckets by memory used', + nameShort: 'Bucket Memory', + type: 'raw', + description: 'Memory used for the top buckets across the cluster.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'topk(5, sum by(bucket, couchbase_cluster, job) (kv_mem_used_bytes{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + topBucketsByDiskUsed: { + name: 'Top buckets by disk used', + nameShort: 'Bucket Disk', + type: 'raw', + description: 'Disk used for the top buckets across the cluster.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'topk(5, sum by(job, couchbase_cluster, bucket) (couch_docs_actual_disk_size{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + topBucketsByOperations: { + name: 'Top buckets by operations', + nameShort: 'Bucket Ops', + type: 'raw', + description: 'Rate of operations for the busiest buckets across the cluster.', + unit: 'ops', + sources: { + prometheus: { + expr: 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + topBucketsByOperationsFailed: { + name: 'Top buckets by operations failed', + nameShort: 'Bucket Failed Ops', + type: 'raw', + description: 'Rate of operations failed for the most problematic buckets across the cluster.', + unit: 'ops', + sources: { + prometheus: { + expr: 'topk(5, sum by(couchbase_cluster, job, bucket) (rate(kv_ops_failed{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + topBucketsByVBucketsCount: { + name: 'Top buckets by vBuckets count', + nameShort: 'vBuckets', + type: 'raw', + description: 'The number of vBuckets for the top buckets across the cluster.', + unit: 'none', + sources: { + prometheus: { + expr: 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_num_vbuckets{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + topBucketsByVBucketQueueMemory: { + name: 'Top buckets by vBucket queue memory', + nameShort: 'vBucket Memory', + type: 'raw', + description: 'Memory occupied by the queue for a virtual bucket for the top buckets across the cluster.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'topk(5, sum by(couchbase_cluster, job, bucket) (kv_vb_queue_memory_bytes{%(queriesSelector)s}))', + legendCustomTemplate: '{{couchbase_cluster}} - {{bucket}}', + }, + }, + }, + }, + } diff --git a/couchbase-mixin/signals/index.libsonnet b/couchbase-mixin/signals/index.libsonnet new file mode 100644 index 000000000..4db3f9833 --- /dev/null +++ b/couchbase-mixin/signals/index.libsonnet @@ -0,0 +1,61 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '2m', + discoveryMetric: { + prometheus: 'index_num_requests', + }, + signals: { + // Index service requests + indexServiceRequests: { + name: 'Index service requests', + nameShort: 'Index Requests', + type: 'raw', + description: 'Rate of index service requests served.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, instance, job) (rate(index_num_requests{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // Index cache hit ratio + indexCacheHitRatio: { + name: 'Index cache hit ratio', + nameShort: 'Cache Hit %', + type: 'raw', + description: 'Ratio at which cache scans result in a hit rather than a miss.', + unit: 'percentunit', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{%(queriesSelector)s}[$__rate_interval])) / (clamp_min(sum by(couchbase_cluster, job, instance) (increase(index_cache_hits{%(queriesSelector)s}[$__rate_interval])), 1) + sum by(couchbase_cluster, job, instance) (increase(index_cache_misses{%(queriesSelector)s}[$__rate_interval])))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // Index average scan latency + indexAverageScanLatency: { + name: 'Index average scan latency', + nameShort: 'Scan Latency', + type: 'raw', + description: 'Average time to serve a scan request per index.', + unit: 'ns', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, index, instance, job) (index_avg_scan_latency{%(queriesSelector)s})', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - {{index}}', + }, + }, + }, + }, + } diff --git a/couchbase-mixin/signals/node.libsonnet b/couchbase-mixin/signals/node.libsonnet new file mode 100644 index 000000000..0234b817b --- /dev/null +++ b/couchbase-mixin/signals/node.libsonnet @@ -0,0 +1,141 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '2m', + discoveryMetric: { + prometheus: 'sys_mem_actual_used', + }, + signals: { + // Node system metrics + memoryUtilization: { + name: 'Memory utilization', + nameShort: 'Memory %', + type: 'raw', + description: 'Percentage of memory allocated to Couchbase on this node actually in use.', + unit: 'percentunit', + sources: { + prometheus: { + expr: 'sys_mem_actual_used{%(queriesSelector)s} / (clamp_min(sys_mem_actual_free{%(queriesSelector)s} + sys_mem_actual_used{%(queriesSelector)s}, 1))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + cpuUtilization: { + name: 'CPU utilization', + nameShort: 'CPU %', + type: 'raw', + description: 'CPU utilization percentage across all available cores on this Couchbase node.', + unit: 'percent', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, job, instance) (sys_cpu_utilization_rate{%(queriesSelector)s})', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // Memory by service + dataServiceMemoryUsed: { + name: 'Data service memory used', + nameShort: 'Data Memory', + type: 'gauge', + description: 'Memory used by the data service for a node.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, instance, job) (kv_mem_used_bytes{%(queriesSelector)s})', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - data', + }, + }, + }, + indexServiceMemoryUsed: { + name: 'Index service memory used', + nameShort: 'Index Memory', + type: 'gauge', + description: 'Memory used by the index service for a node.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'index_memory_used_total{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - index', + }, + }, + }, + analyticsServiceMemoryUsed: { + name: 'Analytics service memory used', + nameShort: 'Analytics Memory', + type: 'gauge', + description: 'Memory used by the analytics service for a node.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'cbas_direct_memory_used_bytes{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - analytics', + }, + }, + }, + + // Node backup and connections + backupSize: { + name: 'Backup size', + nameShort: 'Backup', + type: 'raw', + description: 'Size of the backup for a node.', + unit: 'decbytes', + sources: { + prometheus: { + expr: 'sum by(couchbase_cluster, instance, job) (backup_data_size{%(queriesSelector)s})', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + currentConnections: { + name: 'Current connections', + nameShort: 'Connections', + type: 'gauge', + description: 'Number of active connections to a node.', + unit: 'none', + sources: { + prometheus: { + expr: 'kv_curr_connections{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}}', + }, + }, + }, + + // HTTP metrics + httpResponseCodes: { + name: 'HTTP response codes', + nameShort: 'HTTP Codes', + type: 'raw', + description: 'Rate of HTTP response codes handled by the cluster manager.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'sum by(job, instance, couchbase_cluster, code) (rate(cm_http_requests_total{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - {{code}}', + }, + }, + }, + httpRequestMethods: { + name: 'HTTP request methods', + nameShort: 'HTTP Methods', + type: 'raw', + description: 'Rate of HTTP request methods handled by the cluster manager.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'sum by(job, instance, couchbase_cluster, method) (rate(cm_http_requests_total{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - {{method}}', + }, + }, + }, + }, + } diff --git a/couchbase-mixin/signals/query.libsonnet b/couchbase-mixin/signals/query.libsonnet new file mode 100644 index 000000000..10c9262f9 --- /dev/null +++ b/couchbase-mixin/signals/query.libsonnet @@ -0,0 +1,124 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '2m', + discoveryMetric: { + prometheus: 'n1ql_requests', + }, + signals: { + // Query service requests + queryServiceRequests: { + name: 'Query service requests', + nameShort: 'N1QL >0ms', + type: 'counter', + description: 'Rate of N1QL requests processed by the query service for a node.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_requests{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - >0ms', + }, + }, + }, + queryServiceRequestsTotal: { + name: 'Query service requests total', + nameShort: 'N1QL Total', + type: 'raw', + description: 'Total rate of N1QL requests processed by the query service (including valid and invalid).', + unit: 'reqps', + sources: { + prometheus: { + expr: 'rate(n1ql_requests{%(queriesSelector)s}[$__rate_interval]) + rate(n1ql_invalid_requests{%(queriesSelector)s}[$__rate_interval])', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - total', + }, + }, + }, + queryServiceErrors: { + name: 'Query service errors', + nameShort: 'N1QL Errors', + type: 'counter', + description: 'Rate of N1QL query errors.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_errors{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - error', + }, + }, + }, + queryServiceInvalidRequests: { + name: 'Query service invalid requests', + nameShort: 'N1QL Invalid', + type: 'counter', + description: 'Rate of invalid N1QL requests.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_invalid_requests{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - invalid', + }, + }, + }, + + // Query service latency buckets + queryServiceRequests250ms: { + name: 'Query service requests >250ms', + nameShort: 'N1QL >250ms', + type: 'counter', + description: 'Rate of N1QL requests taking more than 250ms.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_requests_250ms{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - >250ms', + }, + }, + }, + queryServiceRequests500ms: { + name: 'Query service requests >500ms', + nameShort: 'N1QL >500ms', + type: 'counter', + description: 'Rate of N1QL requests taking more than 500ms.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_requests_500ms{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - >500ms', + }, + }, + }, + queryServiceRequests1000ms: { + name: 'Query service requests >1000ms', + nameShort: 'N1QL >1s', + type: 'counter', + description: 'Rate of N1QL requests taking more than 1000ms.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_requests_1000ms{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - >1000ms', + }, + }, + }, + queryServiceRequests5000ms: { + name: 'Query service requests >5000ms', + nameShort: 'N1QL >5s', + type: 'counter', + description: 'Rate of N1QL requests taking more than 5000ms.', + unit: 'reqps', + sources: { + prometheus: { + expr: 'n1ql_requests_5000ms{%(queriesSelector)s}', + legendCustomTemplate: '{{couchbase_cluster}} - {{instance}} - >5000ms', + }, + }, + }, + }, + }