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

Commit e816ac2

Browse files
authored
Merge branch 'master' into flusher-job-blocks
2 parents 60c4e27 + 0bf59b4 commit e816ac2

33 files changed

+423
-116
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ workflows:
1111
jobs:
1212
lint:
1313
docker:
14-
- image: grafana/cortex-jsonnet-build-image:55f5699
14+
- image: grafana/cortex-jsonnet-build-image:8ce0de1
1515
steps:
1616
- checkout
1717
- run: make lint
1818

1919
build:
2020
docker:
21-
- image: grafana/cortex-jsonnet-build-image:55f5699
21+
- image: grafana/cortex-jsonnet-build-image:8ce0de1
2222
steps:
2323
- checkout
2424
- run: make build-mixin
2525
- store_artifacts:
26-
path: cortex-mixin.zip
26+
path: cortex-mixin/cortex-mixin.zip
2727
test-readme:
2828
docker:
29-
- image: grafana/cortex-jsonnet-build-image:55f5699
29+
- image: grafana/cortex-jsonnet-build-image:8ce0de1
3030
steps:
3131
- checkout
3232
- run: make test-readme

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@
22

33
## master / unreleased
44

5+
* [CHANGE] Add the default preset 'extra_small_user' and reference it in the CLI flags. This will raise the limits of the 'small_user' preset to the defaults for `ingester.max-samples-per-query` and `ingester.max-series-per-query`. #200
6+
* [ENHANCEMENT] Add the Ruler to the read resources dashboard #205
7+
* [ENHANCEMENT] Read dashboards now use `cortex_querier_request_duration_seconds` metrics to allow for accurate dashboards when deploying Cortex as a single-binary. #199
8+
* [ENHANCEMENT] Improved Ruler dashboard. Includes information about notifications, reads/writes, and per user per rule group evaluation. #197, #205
9+
* [ENHANCEMENT] Add `flusher-job-blocks.libsonnet` with support for flushing blocks disks. #187
10+
* [FEATURE] Latency recording rules for the metric`cortex_querier_request_duration_seconds` are now part of a `cortex_querier_api` rule group. #199
11+
* [FEATURE] Add overrides-exporter as optional deployment to expose configured runtime overrides and presets. #198
12+
* [FEATURE] Add a dashboard for the alertmanager. #207
13+
* [BUGFIX] Added `ingester-blocks` to ingester's job label matcher, in order to correctly get metrics when migrating a Cortex cluster from chunks to blocks. #203
14+
15+
## 1.4.0 / 2020-10-02
16+
517
* [CHANGE] Lower the default overrides configs for ingestion and create a new overrides user out of the previous config #183
618
* [CHANGE] The project is now licensed with Apache-2.0 license. #169
719
* [CHANGE] Add overrides config to tsdb store-gateway. #167
820
* [CHANGE] Ingesters now default to running as `StatefulSet` with WAL enabled. It is controlled by the config `$._config.ingester_deployment_without_wal` which is `false` by default. Setting the config to `true` will yield the old behaviour (stateless `Deployment` without WAL enabled). #72
921
* [CHANGE] We now allow queries that are 32 days long. For example, rate(metric[32d]). Before it was 31d. #173
1022
* [CHANGE] Renamed `container_name` and `pod_name` label names to `container` and `pod` respectively. This is required in order to comply with cAdvisor metrics changes shipped with Kubernetes 1.16. #179
1123
* [CHANGE] Removed the `experimental` prefix from blocks storage CLI flags. #179
24+
* [CHANGE] Rename flags `store-gateway.replication-factor` and `store-gateway.tokens-file-path` to `store-gateway.sharding-ring.replication-factor` and `store-gateway.sharding-ring.tokens-file-path` in anticipation of v1.4 release. #191
1225
* [ENHANCEMENT] Enable support for HA in the Cortex Alertmanager #147
1326
* [ENHANCEMENT] Support `alertmanager.fallback_config` option in the Alertmanager. #179
1427
* [ENHANCEMENT] Add support for S3 block storage. #181
15-
* [ENHANCEMENT] Add support for Azure block storage. #182
16-
* [ENHANCEMENT] Add `flusher-job-blocks.libsonnet` with support for flushing blocks disks. #187
28+
* [ENHANCEMENT] Add support for Azure block storage. #182 #190
1729
* [BUGFIX] Add support the `local` ruler client type #175
1830
* [BUGFIX] Fixes `ruler.storage.s3.url` argument for the Ruler. It used an incorrect argument. #177
1931

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
JSONNET_FMT := jsonnetfmt
44

5-
lint:
5+
lint: lint-mixin
66
@RESULT=0; \
77
for f in $$(find . -name '*.libsonnet' -print -o -name '*.jsonnet' -print); do \
88
$(JSONNET_FMT) -- "$$f" | diff -u "$$f" -; \
99
RESULT=$$(($$RESULT + $$?)); \
1010
done; \
11-
exit $$RESULT
11+
RESULT=$$(($$RESULT + $$?)); \
12+
13+
lint-mixin:
14+
cd cortex-mixin && \
15+
jb install && \
16+
mixtool lint mixin.libsonnet
1217

1318
fmt:
1419
@find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
@@ -24,10 +29,8 @@ build-mixin:
2429
cd cortex-mixin && \
2530
rm -rf out && mkdir out && \
2631
jb install && \
27-
jsonnet -J vendor -S dashboards.jsonnet -m out/ && \
28-
jsonnet -J vendor -S recording_rules.jsonnet > out/rules.yaml && \
29-
jsonnet -J vendor -S alerts.jsonnet > out/alerts.yaml
30-
zip -r cortex-mixin.zip cortex-mixin/out
32+
mixtool generate all --output-alerts out/alerts.yaml --output-rules out/rules.yaml --directory out/dashboards mixin.libsonnet && \
33+
zip -r cortex-mixin.zip out
3134

3235
test-readme:
3336
rm -rf test-readme && \

build-image/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ RUN curl -fSL -o "/usr/bin/tk" "https://github.com/grafana/tanka/releases/downlo
2525
RUN echo "${TANKA_CHECKSUM}" | sha256sum -c || (printf "wanted: %s\n got: %s\n" "${TANKA_CHECKSUM}" "$(sha256sum /usr/bin/tk)"; exit 1)
2626
RUN chmod +x /usr/bin/tk
2727

28+
# Build mixtool
29+
FROM golang:1.15-alpine AS mixtool-builder
30+
RUN GO111MODULE=on go get github.com/monitoring-mixins/mixtool/cmd/mixtool@59d44357240d
31+
2832
FROM alpine:3.11
2933
RUN apk add --no-cache git make libgcc libstdc++ zip
3034
COPY --from=jsonnet-builder /usr/bin/jsonnetfmt /usr/bin
3135
COPY --from=jsonnet-builder /usr/bin/jsonnet /usr/bin
3236
COPY --from=jb-builder /usr/bin/jb /usr/bin
3337
COPY --from=tk-builder /usr/bin/tk /usr/bin
38+
COPY --from=mixtool-builder /go/bin/mixtool /usr/bin

cortex-mixin/alerts.jsonnet

Lines changed: 0 additions & 3 deletions
This file was deleted.

cortex-mixin/config.libsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
// These are used by the dashboards and allow for the simultaneous display of
2727
// microservice and single binary cortex clusters.
2828
job_names: {
29-
ingester: '(ingester|cortex$)',
29+
ingester: '(ingester.*|cortex$)', // Match also ingester-blocks, which is used during the migration from chunks to blocks.
3030
distributor: '(distributor|cortex$)',
3131
querier: '(querier|cortex$)',
32+
ruler: '(ruler|cortex$)',
3233
query_frontend: '(query-frontend|cortex$)',
3334
table_manager: '(table-manager|cortex$)',
3435
store_gateway: '(store-gateway|cortex$)',

cortex-mixin/dashboards.jsonnet

Lines changed: 0 additions & 6 deletions
This file was deleted.

cortex-mixin/dashboards.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
(import 'dashboards/queries.libsonnet') +
55
(import 'dashboards/reads.libsonnet') +
66
(import 'dashboards/ruler.libsonnet') +
7+
(import 'dashboards/alertmanager.libsonnet') +
78
(import 'dashboards/scaling.libsonnet') +
89
(import 'dashboards/writes.libsonnet') +
910

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
local utils = import 'mixin-utils/utils.libsonnet';
2+
3+
(import 'dashboard-utils.libsonnet') {
4+
5+
'alertmanager.json':
6+
($.dashboard('Cortex / Alertmanager') + { uid: 'a76bee5913c97c918d9e56a3cc88cc28' })
7+
.addClusterSelectorTemplates()
8+
.addRow(
9+
($.row('Headlines') + {
10+
height: '100px',
11+
showTitle: false,
12+
})
13+
.addPanel(
14+
$.panel('Total Alerts') +
15+
$.statPanel('sum(cortex_alertmanager_alerts{%s})' % $.jobMatcher('alertmanager'), format='short')
16+
)
17+
.addPanel(
18+
$.panel('Total Silences') +
19+
$.statPanel('sum(cortex_alertmanager_silences{%s})' % $.jobMatcher('alertmanager'), format='short')
20+
)
21+
)
22+
.addRow(
23+
$.row('Alerts Received')
24+
.addPanel(
25+
$.panel('APS') +
26+
$.queryPanel(
27+
[
28+
|||
29+
sum(rate(cortex_alertmanager_alerts_received_total{%s}[$__interval]))
30+
-
31+
sum(rate(cortex_alertmanager_alerts_invalid_total{%s}[$__interval]))
32+
||| % [$.jobMatcher('alertmanager'), $.jobMatcher('alertmanager')],
33+
'sum(rate(cortex_alertmanager_alerts_invalid_total{%s}[$__interval]))' % $.jobMatcher('alertmanager'),
34+
],
35+
['success', 'failed']
36+
)
37+
)
38+
)
39+
.addRow(
40+
$.row('Alert Notifications')
41+
.addPanel(
42+
$.panel('NPS') +
43+
$.queryPanel(
44+
[
45+
|||
46+
sum(rate(cortex_alertmanager_notifications_total{%s}[$__interval]))
47+
-
48+
sum(rate(cortex_alertmanager_notifications_failed_total{%s}[$__interval]))
49+
||| % [$.jobMatcher('alertmanager'), $.jobMatcher('alertmanager')],
50+
'sum(rate(cortex_alertmanager_notifications_failed_total{%s}[$__interval]))' % $.jobMatcher('alertmanager'),
51+
],
52+
['success', 'failed']
53+
)
54+
)
55+
.addPanel(
56+
$.panel('NPS by integration') +
57+
$.queryPanel(
58+
[
59+
|||
60+
(
61+
sum(rate(cortex_alertmanager_notifications_total{%s}[$__interval])) by(integration)
62+
-
63+
sum(rate(cortex_alertmanager_notifications_failed_total{%s}[$__interval])) by(integration)
64+
) > 0
65+
or on () vector(0)
66+
||| % [$.jobMatcher('alertmanager'), $.jobMatcher('alertmanager')],
67+
'sum(rate(cortex_alertmanager_notifications_failed_total{%s}[$__interval])) by(integration)' % $.jobMatcher('alertmanager'),
68+
],
69+
['success - {{ integration }}', 'failed - {{ integration }}']
70+
)
71+
)
72+
.addPanel(
73+
$.panel('Latency') +
74+
$.latencyPanel('cortex_alertmanager_notification_latency_seconds', '{%s}' % $.jobMatcher('alertmanager'))
75+
)
76+
)
77+
.addRow(
78+
$.row('Configuration API (gateway) + Alertmanager UI')
79+
.addPanel(
80+
$.panel('QPS') +
81+
$.qpsPanel('cortex_request_duration_seconds_count{%s, route=~"api_v1_alerts|alertmanager"}' % $.jobMatcher($._config.job_names.gateway))
82+
)
83+
.addPanel(
84+
$.panel('Latency') +
85+
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.gateway) + [utils.selector.re('route', 'api_v1_alerts|alertmanager')])
86+
)
87+
),
88+
}

cortex-mixin/dashboards/chunks.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
22

33
(import 'dashboard-utils.libsonnet') {
44
'cortex-chunks.json':
5-
$.dashboard('Cortex / Chunks')
5+
($.dashboard('Cortex / Chunks') + { uid: 'a56a3fa6284064eb392a115f3acbf744' })
66
.addClusterSelectorTemplates()
77
.addRow(
88
$.row('Active Series / Chunks')
@@ -52,7 +52,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
5252
),
5353

5454
'cortex-wal.json':
55-
$.dashboard('Cortex / WAL')
55+
($.dashboard('Cortex / WAL') + { uid: 'd4fb924cdc1581cd8e870e3eb0110bda' })
5656
.addClusterSelectorTemplates()
5757
.addRow(
5858
$.row('')

0 commit comments

Comments
 (0)