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

Commit 4e4795b

Browse files
authored
Merge pull request #337 from grafana/fix-white-space-noise
Fix white space noise
2 parents 383a286 + 8ab33eb commit 4e4795b

File tree

11 files changed

+61
-42
lines changed

11 files changed

+61
-42
lines changed

.circleci/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ workflows:
1111
jobs:
1212
lint:
1313
docker:
14-
- image: grafana/cortex-jsonnet-build-image:e19ece2
14+
- image: grafana/cortex-jsonnet-build-image:3527936
1515
steps:
1616
- checkout
17+
- run:
18+
name: "Check white noise"
19+
command: make check-white-noise
1720
- run:
1821
name: "Lint mixin"
1922
command: make lint-mixin
@@ -23,7 +26,7 @@ jobs:
2326

2427
build:
2528
docker:
26-
- image: grafana/cortex-jsonnet-build-image:e19ece2
29+
- image: grafana/cortex-jsonnet-build-image:3527936
2730
steps:
2831
- checkout
2932
- run: make build-mixin
@@ -32,7 +35,7 @@ jobs:
3235

3336
test-readme:
3437
docker:
35-
- image: grafana/cortex-jsonnet-build-image:e19ece2
38+
- image: grafana/cortex-jsonnet-build-image:3527936
3639
steps:
3740
- checkout
3841
- run: make test-readme

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## master / unreleased
44

5-
* [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328
5+
* [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328
66
* [CHANGE] `namespace` template variable in dashboards now only selects namespaces for selected clusters. #311
77
* [CHANGE] Alertmanager: mounted overrides configmap to alertmanager too. #315
88
* [CHANGE] Memcached: upgraded memcached from `1.5.17` to `1.6.9`. #316

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
JSONNET_FMT := jsonnetfmt
44

5+
# Support gsed/gfind on OSX (installed via brew), falling back to sed/find. On Linux
6+
# systems gsed/gfind won't be installed, so will use sed/gfind as expected.
7+
SED ?= $(shell which gsed 2>/dev/null || which sed)
8+
FIND ?= $(shell which gfind 2>/dev/null || which find)
9+
510
lint: lint-mixin lint-playbooks
611

712
lint-mixin: lint-mixin-with-mixtool lint-mixin-with-jsonnetfmt
@@ -50,3 +55,10 @@ test-readme:
5055
cp -r ../cortex ./vendor/ && \
5156
cp vendor/cortex/cortex-manifests.jsonnet.example environments/default/main.jsonnet && \
5257
PAGER=cat tk show environments/default
58+
59+
clean-white-noise:
60+
@$(FIND) . -type f -regextype posix-extended -regex '.*(md|libsonnet)' -print | \
61+
SED_BIN="$(SED)" xargs ./scripts/cleanup-white-noise.sh
62+
63+
check-white-noise: clean-white-noise
64+
@git diff --exit-code --quiet || (echo "Please remove trailing whitespaces running 'make clean-white-noise'" && false)

build-image/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FROM golang:1.15-alpine AS mixtool-builder
3030
RUN GO111MODULE=on go get github.com/monitoring-mixins/mixtool/cmd/mixtool@ae18e31161ea10545b9c1ac0d23c10122f2c12b5
3131

3232
FROM alpine:3.13
33-
RUN apk add --no-cache git make libgcc libstdc++ zip
33+
RUN apk add --no-cache git make libgcc libstdc++ zip findutils sed
3434
COPY --from=jsonnet-builder /usr/bin/jsonnetfmt /usr/bin
3535
COPY --from=jsonnet-builder /usr/bin/jsonnet /usr/bin
3636
COPY --from=jb-builder /usr/bin/jb /usr/bin

cortex-mixin/alerts/alerts.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@
599599
container_memory_working_set_bytes{container="etcd"}
600600
/
601601
container_spec_memory_limit_bytes{container="etcd"}
602-
) > 0.65
602+
) > 0.65
603603
|||,
604604
'for': '15m',
605605
labels: {

cortex-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
383383
name="%(cacheName)s"
384384
}[$__rate_interval]
385385
)
386-
)
387-
/
386+
)
387+
/
388388
sum(
389389
rate(
390390
thanos_cache_memcached_requests_total{
@@ -405,20 +405,20 @@ local utils = import 'mixin-utils/utils.libsonnet';
405405
ignoring(%s) group_right() (
406406
label_replace(
407407
count by(
408-
%s,
409-
%s,
408+
%s,
409+
%s,
410410
device
411-
)
411+
)
412412
(
413413
container_fs_writes_bytes_total{
414414
%s,
415415
container="%s",
416416
device!~".*sda.*"
417417
}
418-
),
419-
"device",
420-
"$1",
421-
"device",
418+
),
419+
"device",
420+
"$1",
421+
"device",
422422
"/dev/(.*)"
423423
) * 0
424424
)

cortex-mixin/dashboards/reads.libsonnet

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ local utils = import 'mixin-utils/utils.libsonnet';
1616
Incoming queries travel from the gateway → query frontend → query scheduler → querier → ingester and/or store-gateway (depending on the time range of the query).
1717
<br/>
1818
For each service, there are 3 panels showing (1) requests per second to that service, (2) average, median, and p99 latency of requests to that service, and (3) p99 latency of requests to each instance of that service.
19-
</p>
19+
</p>
2020
<p>
21-
The dashboard also shows metrics for the 4 optional caches that can be deployed with Cortex:
22-
the query results cache, the metadata cache, the chunks cache, and the index cache.
21+
The dashboard also shows metrics for the 4 optional caches that can be deployed with Cortex:
22+
the query results cache, the metadata cache, the chunks cache, and the index cache.
2323
<br/>
24-
These panels will show “no data” if the caches are not deployed.
24+
These panels will show “no data” if the caches are not deployed.
2525
</p>
2626
<p>
27-
Lastly, it also includes metrics for how the ingester and store-gateway interact with object storage.
27+
Lastly, it also includes metrics for how the ingester and store-gateway interact with object storage.
2828
</p>
2929
|||),
3030
)
@@ -45,7 +45,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
4545
route=~"(prometheus|api_prom)_api_v1_query"
4646
}[$__rate_interval]
4747
)
48-
) +
48+
) +
4949
sum(
5050
rate(
5151
cortex_prometheus_rule_evaluations_total{
@@ -61,7 +61,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
6161
'Instant queries per second',
6262
|||
6363
Rate of instant queries per second being made to the system.
64-
Includes both queries made to the <tt>/prometheus</tt> API as
64+
Includes both queries made to the <tt>/prometheus</tt> API as
6565
well as queries from the ruler.
6666
|||
6767
),
@@ -83,8 +83,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
8383
$.panelDescription(
8484
'Range queries per second',
8585
|||
86-
Rate of range queries per second being made to
87-
Cortex via the <tt>/prometheus</tt> API.
86+
Rate of range queries per second being made to
87+
Cortex via the <tt>/prometheus</tt> API.
8888
|||
8989
),
9090
)
@@ -135,7 +135,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
135135
The query scheduler is an optional service that moves
136136
the internal queue from the query-frontend into a
137137
separate component.
138-
If this service is not deployed,
138+
If this service is not deployed,
139139
these panels will show "No data."
140140
</p>
141141
|||
@@ -286,8 +286,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
286286
%s
287287
}[$__rate_interval]
288288
)
289-
)
290-
/
289+
)
290+
/
291291
sum by(item_type) (
292292
rate(
293293
thanos_store_index_cache_requests_total{
@@ -307,7 +307,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
307307
'Hit Ratio',
308308
|||
309309
Even if you do not set up memcached for the blocks index cache, you will still see data in this panel because Cortex by default has an
310-
in-memory blocks index cache.
310+
in-memory blocks index cache.
311311
|||
312312
),
313313
)

cortex-mixin/dashboards/writes.libsonnet

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ local utils = import 'mixin-utils/utils.libsonnet';
1111
$.textPanel('', |||
1212
<p>
1313
This dashboard shows various health metrics for the Cortex write path.
14-
It is broken into sections for each service on the write path,
14+
It is broken into sections for each service on the write path,
1515
and organized by the order in which the write request flows.
1616
<br/>
1717
Incoming metrics data travels from the gateway → distributor → ingester.
1818
<br/>
1919
For each service, there are 3 panels showing
20-
(1) requests per second to that service,
21-
(2) average, median, and p99 latency of requests to that service, and
20+
(1) requests per second to that service,
21+
(2) average, median, and p99 latency of requests to that service, and
2222
(3) p99 latency of requests to each instance of that service.
23-
</p>
23+
</p>
2424
<p>
2525
It also includes metrics for the key-value (KV) stores used to manage
2626
the high-availability tracker and the ingesters.
@@ -216,7 +216,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
216216
$.panelDescription(
217217
'Uploaded blocks / sec',
218218
|||
219-
The rate of blocks being uploaded from the ingesters
219+
The rate of blocks being uploaded from the ingesters
220220
to object storage.
221221
|||
222222
),
@@ -227,7 +227,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
227227
$.panelDescription(
228228
'Upload latency',
229229
|||
230-
The average, median (50th percentile), and 99th percentile time
230+
The average, median (50th percentile), and 99th percentile time
231231
the ingesters take to upload blocks to object storage.
232232
|||
233233
),
@@ -247,7 +247,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
247247
|||
248248
Ingesters maintain a local TSDB per-tenant on disk. Each TSDB maintains a head block for each
249249
active time series; these blocks get periodically compacted (by default, every 2h).
250-
This panel shows the rate of compaction operations across all TSDBs on all ingesters.
250+
This panel shows the rate of compaction operations across all TSDBs on all ingesters.
251251
|||
252252
),
253253
)
@@ -275,7 +275,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
275275
$.panelDescription(
276276
'WAL truncations per second',
277277
|||
278-
The WAL is truncated each time a new TSDB block is written. This panel measures the rate of
278+
The WAL is truncated each time a new TSDB block is written. This panel measures the rate of
279279
truncations.
280280
|||
281281
),
@@ -289,7 +289,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
289289
$.panelDescription(
290290
'Checkpoints created per second',
291291
|||
292-
Checkpoints are created as part of the WAL truncation process.
292+
Checkpoints are created as part of the WAL truncation process.
293293
This metric measures the rate of checkpoint creation.
294294
|||
295295
),
@@ -301,7 +301,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
301301
$.panelDescription(
302302
'WAL truncations latency (including checkpointing)',
303303
|||
304-
Average time taken to perform a full WAL truncation,
304+
Average time taken to perform a full WAL truncation,
305305
including the time taken for the checkpointing to complete.
306306
|||
307307
),

cortex-mixin/docs/playbooks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In events you're looking for things like:
1616
```
1717
57m Normal NodeControllerEviction Pod Marking for deletion Pod ingester-01 from Node cloud-provider-node-01
1818
37m Normal SuccessfulDelete ReplicaSet (combined from similar events): Deleted pod: ingester-01
19-
32m Normal NodeNotReady Node Node cloud-provider-node-01 status is now: NodeNotReady
19+
32m Normal NodeNotReady Node Node cloud-provider-node-01 status is now: NodeNotReady
2020
28m Normal DeletingAllPods Node Node cloud-provider-node-01 event: Deleting all Pods from Node cloud-provider-node-01.
2121
```
2222

@@ -313,7 +313,7 @@ gsutil mv gs://BUCKET/TENANT/BLOCK gs://BUCKET/TENANT/corrupted-BLOCK
313313

314314
### CortexBucketIndexNotUpdated
315315

316-
This alert fires when the bucket index, for a given tenant, is not updated since a long time. The bucket index is expected to be periodically updated by the compactor and is used by queriers and store-gateways to get an almost-updated view over the bucket store.
316+
This alert fires when the bucket index, for a given tenant, is not updated since a long time. The bucket index is expected to be periodically updated by the compactor and is used by queriers and store-gateways to get an almost-updated view over the bucket store.
317317

318318
How to **investigate**:
319319
- Ensure the compactor is successfully running
@@ -557,7 +557,7 @@ metadata:
557557
spec:
558558
accessModes:
559559
- ReadWriteOnce
560-
capacity:
560+
capacity:
561561
storage: 150Gi
562562
gcePersistentDisk:
563563
fsType: ext4

cortex-mixin/groups.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
if alert_aggregation_labels_override != null
3030
then std.trace(
3131
|||
32-
Deprecated: _config.alert_aggregation_labels
32+
Deprecated: _config.alert_aggregation_labels
3333
This field has been explicitly overridden to "%s".
3434
Instead, express the override in terms of _config.cluster_labels.
3535
E.g., cluster_labels: %s will automatically convert to "%s".

0 commit comments

Comments
 (0)