Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 42 additions & 2 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
- name: Start Cortex
run: |
docker run -d --name cortex \
-p 9009:9009 \
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
cortexproject/cortex:v1.20.1 \
cortexproject/cortex:v1.21.0 \
-config.file=/etc/cortex/config.yaml \
-target=all,alertmanager
- name: Wait for Cortex
Expand All @@ -46,3 +46,43 @@ jobs:
- name: Cleanup
if: always()
run: docker stop cortex && docker rm cortex
integration-utf8:
name: Integration Tests (UTF-8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.25
- name: Start Cortex (UTF-8 mode)
run: |
docker run -d --name cortex-utf8 \
-p 9009:9009 \
-v ${{ github.workspace }}/integration/cortex-config.yaml:/etc/cortex/config.yaml \
cortexproject/cortex:v1.21.0 \
-config.file=/etc/cortex/config.yaml \
-target=all,alertmanager \
-name-validation-scheme=utf8
- name: Wait for Cortex
run: |
for i in $(seq 1 30); do
if wget -qO- http://localhost:9009/ready > /dev/null 2>&1; then
echo "Cortex is ready"
exit 0
fi
echo "Waiting for Cortex... ($i)"
sleep 2
done
echo "Cortex failed to start"
docker logs cortex-utf8
exit 1
- name: Run UTF-8 Integration Tests
env:
CORTEX_ADDRESS: http://localhost:9009
run: go test -mod=vendor -tags=integration_utf8 -v -count=1 ./integration/...
- name: Cortex Logs
if: failure()
run: docker logs cortex-utf8
- name: Cleanup
if: always()
run: docker stop cortex-utf8 && docker rm cortex-utf8
10 changes: 5 additions & 5 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.64
version: v2.11.4
unit_tests:
name: Unit-Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
- name: Unit Tests
run: make test
build:
Expand All @@ -37,6 +37,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25
- name: Build All
run: make all
50 changes: 36 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
version: "2"
run:
timeout: 10m
modules-download-mode: vendor
build-tags:
- netgo
- require_docker

modules-download-mode: vendor
output:
formats:
- format: line-number

text:
path: stdout
colors: false
linters:
enable:
- goimports
- revive
- misspell
- revive
disable:
- staticcheck
settings:
errcheck:
exclude-functions:
- (github.com/go-kit/log.Logger).Log
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt

linters-settings:
errcheck:
exclude-functions:
- (github.com/go-kit/log.Logger).Log
goimports:
local-prefixes: "github.com/cortexproject/cortex-tools"
- goimports
settings:
goimports:
local-prefixes:
- github.com/cortexproject/cortex-tools
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## v0.21.0
* [CHANGE] Upgrade cortex to v1.21.0
* [CHANGE] Upgrade Go to 1.25
* [CHANGE] Upgrade golangci-lint to v2
* [FEATURE] Add `--validation-scheme` flag to rules commands for UTF-8 metric name support #59

## v0.20.0
* [CHANGE] Upgrade cortex to v1.20.1
* [CHANGE] Upgrade Go to 1.24
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ This commands checks rules against the recommended [best practices](https://prom

cortextool rules check ./example_rules_one.yaml

##### Validation Scheme

All rule commands support the `--validation-scheme` flag to control how metric and label names are validated:

- `legacy` (default) — metric/label names must match `[a-zA-Z_:][a-zA-Z0-9_:]*` (standard Prometheus naming)
- `utf8` — only requires valid UTF-8 strings (for Cortex instances running with `-name-validation-scheme=utf8`)

```bash
# Validate rules with UTF-8 metric names
cortextool rules check --validation-scheme=utf8 ./rules_with_dotted_names.yaml

# Load rules with UTF-8 metric names
cortextool rules load --validation-scheme=utf8 ./rules_with_dotted_names.yaml
```


#### Remote Read

Expand Down
36 changes: 36 additions & 0 deletions changelogs/v0.21.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# v0.21.0 Release

## Changes

* [CHANGE] Upgrade cortex to v1.21.0
* [CHANGE] Upgrade Go to 1.25
* [CHANGE] Upgrade golangci-lint to v2
* [FEATURE] Add `--validation-scheme` flag to rules commands for UTF-8 metric name support #59

## Installation

## cortextool

```console
# download the binary (adapt os and arch as needed)
$ curl -fSL -o "cortextool" "https://github.com/cortexproject/cortex-tools/releases/download/v0.21.0/cortextool_0.21.0_linux_x86_64"

# make it executable
$ chmod a+x "cortextool"

# have fun :)
$ ./cortextool --help
```

## benchtool

```console
# download the binary (adapt os and arch as needed)
$ curl -fSL -o "benchtool" "https://github.com/cortexproject/cortex-tools/releases/download/v0.21.0/benchtool_0.21.0_linux_x86_64"

# make it executable
$ chmod a+x "benchtool"

# have fun :)
$ ./benchtool --help
```
Loading
Loading