github.com/thanos-io/thanos@v0.32.5/mixin/dashboards/bucket-replicate.libsonnet (about)

     1  local g = import '../lib/thanos-grafana-builder/builder.libsonnet';
     2  
     3  {
     4    local thanos = self,
     5    bucketReplicate+:: {
     6      selector: error 'must provide selector for Thanos Bucket Replicate dashboard',
     7      title: error 'must provide title for Thanos Bucket Replicate dashboard',
     8      dashboard:: {
     9        selector: std.join(', ', thanos.dashboard.selector + ['job=~"$job"']),
    10        dimensions: std.join(', ', thanos.dashboard.dimensions + ['job']),
    11      },
    12    },
    13    grafanaDashboards+:: {
    14      [if thanos.bucketReplicate != null then 'bucket-replicate.json']:
    15        g.dashboard(thanos.bucketReplicate.title)
    16        .addRow(
    17          g.row('Bucket Replicate Runs')
    18          .addPanel(
    19            g.panel('Rate') +
    20            g.qpsErrTotalPanel(
    21              'thanos_replicate_replication_runs_total{result="error", %s}' % thanos.bucketReplicate.dashboard.selector,
    22              'thanos_replicate_replication_runs_total{%s}' % thanos.bucketReplicate.dashboard.selector,
    23              thanos.bucketReplicate.dashboard.dimensions
    24            )
    25          )
    26          .addPanel(
    27            g.panel('Errors', 'Shows rate of errors.') +
    28            g.queryPanel(
    29              'sum by (%(dimensions)s, result) (rate(thanos_replicate_replication_runs_total{result="error", %(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    30              '{{result}}'
    31            ) +
    32            { yaxes: g.yaxes('percentunit') } +
    33            g.stack
    34          )
    35          .addPanel(
    36            g.panel('Duration', 'Shows how long has it taken to run a replication cycle.') +
    37            g.latencyPanel(
    38              'thanos_replicate_replication_run_duration_seconds',
    39              'result="success",  %s' % thanos.bucketReplicate.dashboard.selector,
    40              thanos.bucketReplicate.dashboard.dimensions
    41            )
    42          )
    43        )
    44        .addRow(
    45          g.row('Bucket Replication')
    46          .addPanel(
    47            g.panel('Metrics') +
    48            g.queryPanel(
    49              [
    50                'sum by (%(dimensions)s) (rate(blocks_meta_synced{state="loaded", %(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    51                'sum by (%(dimensions)s) (rate(blocks_meta_synced{state="failed", %(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    52                'sum by (%(dimensions)s) (rate(thanos_replicate_blocks_already_replicated_total{%(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    53                'sum by (%(dimensions)s) (rate(thanos_replicate_blocks_replicated_total{%(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    54                'sum by (%(dimensions)s) (rate(thanos_replicate_objects_replicated_total{%(selector)s}[$__rate_interval]))' % thanos.bucketReplicate.dashboard,
    55              ],
    56              ['meta loads', 'partial meta reads', 'already replicated blocks', 'replicated blocks', 'replicated objects']
    57            )
    58          )
    59        ),
    60    },
    61  }