Skip to content

Commit daf157d

Browse files
authored
Cortex upgrade v1.21 (#55)
* Upgrade to cortex v1.21.0 Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * Update changelog Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * Update golangci-lint-action to v7 Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * Disable staticcheck Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * Fix #59 Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * include docs Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --------- Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
1 parent cb85db0 commit daf157d

1,820 files changed

Lines changed: 153780 additions & 127459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integration_test.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-go@v5
1616
with:
17-
go-version: 1.24
17+
go-version: 1.25
1818
- name: Start Cortex
1919
run: |
2020
docker run -d --name cortex \
2121
-p 9009:9009 \
2222
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
23-
cortexproject/cortex:v1.20.1 \
23+
cortexproject/cortex:v1.21.0 \
2424
-config.file=/etc/cortex/config.yaml \
2525
-target=all,alertmanager
2626
- name: Wait for Cortex
@@ -46,3 +46,43 @@ jobs:
4646
- name: Cleanup
4747
if: always()
4848
run: docker stop cortex && docker rm cortex
49+
integration-utf8:
50+
name: Integration Tests (UTF-8)
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-go@v5
55+
with:
56+
go-version: 1.25
57+
- name: Start Cortex (UTF-8 mode)
58+
run: |
59+
docker run -d --name cortex-utf8 \
60+
-p 9009:9009 \
61+
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
62+
cortexproject/cortex:v1.21.0 \
63+
-config.file=/etc/cortex/config.yaml \
64+
-target=all,alertmanager \
65+
-name-validation-scheme=utf8
66+
- name: Wait for Cortex
67+
run: |
68+
for i in $(seq 1 30); do
69+
if wget -qO- http://localhost:9009/ready > /dev/null 2>&1; then
70+
echo "Cortex is ready"
71+
exit 0
72+
fi
73+
echo "Waiting for Cortex... ($i)"
74+
sleep 2
75+
done
76+
echo "Cortex failed to start"
77+
docker logs cortex-utf8
78+
exit 1
79+
- name: Run UTF-8 Integration Tests
80+
env:
81+
CORTEX_ADDRESS: http://localhost:9009
82+
run: go test -mod=vendor -tags=integration_utf8 -v -count=1 ./integration/...
83+
- name: Cortex Logs
84+
if: failure()
85+
run: docker logs cortex-utf8
86+
- name: Cleanup
87+
if: always()
88+
run: docker stop cortex-utf8 && docker rm cortex-utf8

.github/workflows/validate_pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-go@v5
1616
with:
17-
go-version: 1.24
17+
go-version: 1.25
1818
cache: false
1919
- name: golangci-lint
20-
uses: golangci/golangci-lint-action@v6
20+
uses: golangci/golangci-lint-action@v7
2121
with:
22-
version: v1.64
22+
version: v2.11.4
2323
unit_tests:
2424
name: Unit-Tests
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v4
2828
- uses: actions/setup-go@v5
2929
with:
30-
go-version: 1.24
30+
go-version: 1.25
3131
- name: Unit Tests
3232
run: make test
3333
build:
@@ -37,6 +37,6 @@ jobs:
3737
- uses: actions/checkout@v4
3838
- uses: actions/setup-go@v5
3939
with:
40-
go-version: 1.24
40+
go-version: 1.25
4141
- name: Build All
4242
run: make all

.golangci.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
1+
version: "2"
12
run:
2-
timeout: 10m
3-
modules-download-mode: vendor
43
build-tags:
54
- netgo
65
- require_docker
7-
6+
modules-download-mode: vendor
87
output:
98
formats:
10-
- format: line-number
11-
9+
text:
10+
path: stdout
11+
colors: false
1212
linters:
1313
enable:
14-
- goimports
15-
- revive
1614
- misspell
15+
- revive
16+
disable:
17+
- staticcheck
18+
settings:
19+
errcheck:
20+
exclude-functions:
21+
- (github.com/go-kit/log.Logger).Log
22+
exclusions:
23+
generated: lax
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- legacy
28+
- std-error-handling
29+
paths:
30+
- third_party$
31+
- builtin$
32+
- examples$
33+
formatters:
34+
enable:
1735
- gofmt
18-
19-
linters-settings:
20-
errcheck:
21-
exclude-functions:
22-
- (github.com/go-kit/log.Logger).Log
23-
goimports:
24-
local-prefixes: "github.com/cortexproject/cortex-tools"
36+
- goimports
37+
settings:
38+
goimports:
39+
local-prefixes:
40+
- github.com/cortexproject/cortex-tools
41+
exclusions:
42+
generated: lax
43+
paths:
44+
- third_party$
45+
- builtin$
46+
- examples$

CHANGELOG.md

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

33
Order should be `CHANGE`, `FEATURE`, `ENHANCEMENT`, and `BUGFIX`
44

5+
## v0.21.0
6+
* [CHANGE] Upgrade cortex to v1.21.0
7+
* [CHANGE] Upgrade Go to 1.25
8+
* [CHANGE] Upgrade golangci-lint to v2
9+
* [FEATURE] Add `--validation-scheme` flag to rules commands for UTF-8 metric name support #59
10+
511
## v0.20.0
612
* [CHANGE] Upgrade cortex to v1.20.1
713
* [CHANGE] Upgrade Go to 1.24

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@ This commands checks rules against the recommended [best practices](https://prom
178178

179179
cortextool rules check ./example_rules_one.yaml
180180

181+
##### Validation Scheme
182+
183+
All rule commands support the `--validation-scheme` flag to control how metric and label names are validated:
184+
185+
- `legacy` (default) — metric/label names must match `[a-zA-Z_:][a-zA-Z0-9_:]*` (standard Prometheus naming)
186+
- `utf8` — only requires valid UTF-8 strings (for Cortex instances running with `-name-validation-scheme=utf8`)
187+
188+
```bash
189+
# Validate rules with UTF-8 metric names
190+
cortextool rules check --validation-scheme=utf8 ./rules_with_dotted_names.yaml
191+
192+
# Load rules with UTF-8 metric names
193+
cortextool rules load --validation-scheme=utf8 ./rules_with_dotted_names.yaml
194+
```
195+
181196

182197
#### Remote Read
183198

changelogs/v0.21.0.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# v0.21.0 Release
2+
3+
## Changes
4+
5+
* [CHANGE] Upgrade cortex to v1.21.0
6+
* [CHANGE] Upgrade Go to 1.25
7+
* [CHANGE] Upgrade golangci-lint to v2
8+
* [FEATURE] Add `--validation-scheme` flag to rules commands for UTF-8 metric name support #59
9+
10+
## Installation
11+
12+
## cortextool
13+
14+
```console
15+
# download the binary (adapt os and arch as needed)
16+
$ curl -fSL -o "cortextool" "https://github.com/cortexproject/cortex-tools/releases/download/v0.21.0/cortextool_0.21.0_linux_x86_64"
17+
18+
# make it executable
19+
$ chmod a+x "cortextool"
20+
21+
# have fun :)
22+
$ ./cortextool --help
23+
```
24+
25+
## benchtool
26+
27+
```console
28+
# download the binary (adapt os and arch as needed)
29+
$ curl -fSL -o "benchtool" "https://github.com/cortexproject/cortex-tools/releases/download/v0.21.0/benchtool_0.21.0_linux_x86_64"
30+
31+
# make it executable
32+
$ chmod a+x "benchtool"
33+
34+
# have fun :)
35+
$ ./benchtool --help
36+
```

0 commit comments

Comments
 (0)