github.com/thanos-io/thanos@v0.32.5/mixin/dashboards/compact.libsonnet (about) 1 local g = import '../lib/thanos-grafana-builder/builder.libsonnet'; 2 3 { 4 local thanos = self, 5 compact+:: { 6 selector: error 'must provide selector for Thanos Compact dashboard', 7 title: error 'must provide title for Thanos Compact 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.compact != null then 'compact.json']: 15 g.dashboard(thanos.compact.title) 16 .addRow( 17 g.row('Group Compaction') 18 .addPanel( 19 g.panel( 20 'Rate', 21 'Shows rate of execution for compactions against blocks that are stored in the bucket by compaction resolution.' 22 ) + 23 g.queryPanel( 24 'sum by (%(dimensions)s, resolution) (rate(thanos_compact_group_compactions_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 25 'compaction {{job}} {{resolution}}' 26 ) + 27 g.stack 28 ) 29 .addPanel( 30 g.panel( 31 'Errors', 32 'Shows ratio of errors compared to the total number of executed compactions against blocks that are stored in the bucket.' 33 ) + 34 g.qpsErrTotalPanel( 35 'thanos_compact_group_compactions_failures_total{%(selector)s}' % thanos.compact.dashboard.selector, 36 'thanos_compact_group_compactions_total{%(selector)s}' % thanos.compact.dashboard.selector, 37 thanos.compact.dashboard.dimensions 38 ) 39 ) 40 ) 41 .addRow( 42 g.row('Downsample') 43 .addPanel( 44 g.panel( 45 'Rate', 46 'Shows rate of execution for downsampling against blocks that are stored in the bucket by compaction resolution.' 47 ) + 48 g.queryPanel( 49 'sum by (%(dimensions)s, resolution) (rate(thanos_compact_downsample_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 50 'downsample {{job}} {{resolution}}' 51 ) + 52 g.stack 53 ) 54 .addPanel( 55 g.panel('Errors', 'Shows ratio of errors compared to the total number of executed downsampling against blocks that are stored in the bucket.') + 56 g.qpsErrTotalPanel( 57 'thanos_compact_downsample_failed_total{%(selector)s}' % thanos.compact.dashboard.selector, 58 'thanos_compact_downsample_total{%(selector)s}' % thanos.compact.dashboard.selector, 59 thanos.compact.dashboard.dimensions 60 ) 61 ) 62 ) 63 .addRow( 64 g.row('Garbage Collection') 65 .addPanel( 66 g.panel( 67 'Rate', 68 'Shows rate of execution for removals of blocks if their data is available as part of a block with a higher compaction level.' 69 ) + 70 g.queryPanel( 71 'sum by (%(dimensions)s) (rate(thanos_compact_garbage_collection_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 72 'garbage collection {{job}}' 73 ) + 74 g.stack 75 ) 76 .addPanel( 77 g.panel('Errors', 'Shows ratio of errors compared to the total number of executed garbage collections.') + 78 g.qpsErrTotalPanel( 79 'thanos_compact_garbage_collection_failures_total{%(selector)s}' % thanos.compact.dashboard.selector, 80 'thanos_compact_garbage_collection_total{%(selector)s}' % thanos.compact.dashboard.selector, 81 thanos.compact.dashboard.dimensions 82 ) 83 ) 84 .addPanel( 85 g.panel('Duration', 'Shows how long has it taken to execute garbage collection in quantiles.') + 86 g.latencyPanel('thanos_compact_garbage_collection_duration_seconds', thanos.compact.dashboard.selector, thanos.compact.dashboard.dimensions) 87 ) 88 ) 89 .addRow( 90 g.row('Blocks deletion') 91 .addPanel( 92 g.panel( 93 'Deletion Rate', 94 'Shows deletion rate of blocks already marked for deletion.' 95 ) + 96 g.queryPanel( 97 'sum by (%(dimensions)s) (rate(thanos_compact_blocks_cleaned_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 98 'Blocks cleanup {{job}}' 99 ) + 100 g.stack 101 ) 102 .addPanel( 103 g.panel( 104 'Deletion Error Rate', 105 'Shows deletion failures rate of blocks already marked for deletion.' 106 ) + 107 g.queryPanel( 108 'sum by (%(dimensions)s) (rate(thanos_compact_block_cleanup_failures_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 109 'Blocks cleanup failures {{job}}' 110 ) 111 ) 112 .addPanel( 113 g.panel( 114 'Marking Rate', 115 'Shows rate at which blocks are marked for deletion (from GC and retention policy).' 116 ) + 117 g.queryPanel( 118 'sum by (%(dimensions)s) (rate(thanos_compact_blocks_marked_for_deletion_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 119 'Blocks marked {{job}}' 120 ) 121 ) 122 ) 123 .addRow( 124 g.row('Sync Meta') 125 .addPanel( 126 g.panel( 127 'Rate', 128 'Shows rate of execution for all meta files from blocks in the bucket into the memory.' 129 ) + 130 g.queryPanel( 131 'sum by (%(dimensions)s) (rate(thanos_blocks_meta_syncs_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 132 'sync {{job}}' 133 ) + 134 g.stack 135 ) 136 .addPanel( 137 g.panel('Errors', 'Shows ratio of errors compared to the total number of executed meta file sync.') + 138 g.qpsErrTotalPanel( 139 'thanos_blocks_meta_sync_failures_total{%(selector)s}' % thanos.compact.dashboard.selector, 140 'thanos_blocks_meta_syncs_total{%(selector)s}' % thanos.compact.dashboard.selector, 141 thanos.compact.dashboard.dimensions 142 ) 143 ) 144 .addPanel( 145 g.panel('Duration', 'Shows how long has it taken to execute meta file sync, in quantiles.') + 146 g.latencyPanel('thanos_blocks_meta_sync_duration_seconds', thanos.compact.dashboard.selector, thanos.compact.dashboard.dimensions) 147 ) 148 ) 149 .addRow( 150 g.row('Object Store Operations') 151 .addPanel( 152 g.panel('Rate', 'Shows rate of execution for operations against the bucket.') + 153 g.queryPanel( 154 'sum by (%(dimensions)s, operation) (rate(thanos_objstore_bucket_operations_total{%(selector)s}[$__rate_interval]))' % thanos.compact.dashboard, 155 '{{job}} {{operation}}' 156 ) + 157 g.stack 158 ) 159 .addPanel( 160 g.panel('Errors', 'Shows ratio of errors compared to the total number of executed operations against the bucket.') + 161 g.qpsErrTotalPanel( 162 'thanos_objstore_bucket_operation_failures_total{%(selector)s}' % thanos.compact.dashboard.selector, 163 'thanos_objstore_bucket_operations_total{%(selector)s}' % thanos.compact.dashboard.selector, 164 thanos.compact.dashboard.dimensions 165 ) 166 ) 167 .addPanel( 168 g.panel('Duration', 'Shows how long has it taken to execute operations against the bucket, in quantiles.') + 169 g.latencyPanel('thanos_objstore_bucket_operation_duration_seconds', thanos.compact.dashboard.selector, thanos.compact.dashboard.dimensions) 170 ) 171 ) 172 .addRow( 173 g.resourceUtilizationRow(thanos.compact.dashboard.selector, thanos.compact.dashboard.dimensions) 174 ), 175 176 __overviewRows__+:: if thanos.compact == null then [] else [ 177 g.row('Compact') 178 .addPanel( 179 g.panel( 180 'Compaction Rate', 181 'Shows rate of execution for compactions against blocks that are stored in the bucket.' 182 ) + 183 g.queryPanel( 184 'sum by (%(dimensions)s) (rate(thanos_compact_group_compactions_total{%(selector)s}[$__rate_interval]))' % thanos.dashboard.overview, 185 'compaction {{job}}' 186 ) + 187 g.stack + 188 g.addDashboardLink(thanos.compact.title) 189 ) 190 .addPanel( 191 g.panel( 192 'Compaction Errors', 193 'Shows ratio of errors compared to the total number of executed compactions against blocks that are stored in the bucket.' 194 ) + 195 g.qpsErrTotalPanel( 196 'thanos_compact_group_compactions_failures_total{%(selector)s}' % thanos.dashboard.overview.selector, 197 'thanos_compact_group_compactions_total{%(selector)s}' % thanos.dashboard.overview.selector, 198 thanos.compact.dashboard.dimensions 199 ) + 200 g.addDashboardLink(thanos.compact.title) 201 ) + 202 g.collapse, 203 ], 204 }, 205 }