Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 1c18e66

Browse files
authored
Merge pull request #255 from grafana/alert-on-unshipper-blocks
Added alert CortexIngesterHasUnshippedBlocks
2 parents eafaee4 + 55efcd2 commit 1c18e66

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Alerts: added "CortexBucketIndexNotUpdated" (bucket index only) and "CortexTenantHasPartialBlocks"
1010
* [ENHANCEMENT] The name of the overrides configmap is now customisable via `$._config.overrides_configmap`. #244
1111
* [ENHANCEMENT] Added flag to control usage of bucket-index, and enable it by default when using blocks. #254
12+
* [ENHANCEMENT] Added the alert `CortexIngesterHasUnshippedBlocks`. #255
1213
* [BUGFIX] Honor configured `per_instance_label` in all panels. #239
1314
* [BUGFIX] `CortexRequestLatency` alert now ignores long-running requests on query-scheduler. #242
1415
* [BUGFIX] Honor configured `job_names` in the "Memory (go heap inuse)" panel. #247

cortex-mixin/alerts/blocks.libsonnet

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@
3939
message: 'Cortex Ingester {{ $labels.namespace }}/{{ $labels.instance }} has not shipped any block in the last 4 hours.',
4040
},
4141
},
42+
{
43+
// Alert if the ingester has compacted some blocks that haven't been successfully uploaded to the storage yet since
44+
// more than 1 hour. The metric tracks the time of the oldest unshipped block, measured as the time when the
45+
// TSDB head has been compacted to a block. The metric is 0 if all blocks have been shipped.
46+
alert: 'CortexIngesterHasUnshippedBlocks',
47+
'for': '15m',
48+
expr: |||
49+
(time() - cortex_ingester_oldest_unshipped_block_timestamp_seconds > 3600)
50+
and
51+
(cortex_ingester_oldest_unshipped_block_timestamp_seconds > 0)
52+
|||,
53+
labels: {
54+
severity: 'critical',
55+
},
56+
annotations: {
57+
message: "Cortex Ingester {{ $labels.namespace }}/{{ $labels.instance }} has compacted a block {{ $value | humanizeDuration }} ago but it hasn't been successfully uploaded to the storage yet.",
58+
},
59+
},
4260
{
4361
// Alert if the ingester is failing to compact TSDB head into a block, for any opened TSDB. Once the TSDB head is
4462
// compactable, the ingester will try to compact it every 1 minute. Repeatedly failing it is a critical condition

cortex-mixin/docs/playbooks.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ If the ingester hit the disk capacity, any attempt to append samples will fail.
9292

9393
Same as [`CortexIngesterHasNotShippedBlocks`](#CortexIngesterHasNotShippedBlocks).
9494

95+
### CortexIngesterHasUnshippedBlocks
96+
97+
This alert fires when a Cortex ingester has compacted some blocks but such blocks haven't been successfully uploaded to the storage yet.
98+
99+
How to **investigate**:
100+
- Look for details in the ingester logs
101+
95102
### CortexIngesterTSDBHeadCompactionFailed
96103

97104
This alert fires when a Cortex ingester is failing to compact the TSDB head into a block.

0 commit comments

Comments
 (0)