Skip to content

Commit 438dc67

Browse files
authored
feat: Split +Inf overflow alerts by label-set (#5)
* Split +Inf overflow alerts by label-set; show metric description * Improve the message wording to not assume that vales are durations * Add histogram unit guesser * Add changelog and bump version to 005 * Fix e2e tests. Ensure CI runs them
1 parent bb22534 commit 438dc67

13 files changed

Lines changed: 665 additions & 204 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,32 @@ jobs:
3737
exit 1
3838
fi
3939
40-
- name: Run tests
41-
run: go test -v -race -coverprofile=coverage.out ./...
40+
- name: Run unit tests
41+
run: go test -v -race -coverprofile=coverage.out ./internal/...
4242

4343
- name: Upload coverage
4444
uses: codecov/codecov-action@v4
4545
with:
4646
files: coverage.out
4747
fail_ci_if_error: false
4848

49+
e2e:
50+
runs-on: ubuntu-latest
51+
needs: build
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Go
56+
uses: actions/setup-go@v5
57+
with:
58+
go-version: '1.21'
59+
60+
- name: Build binary
61+
run: go build -o bin/metrics-analyzer ./cmd/metrics-analyzer
62+
63+
- name: Run E2E tests
64+
run: go test -v ./cmd/...
65+
4966
validate-rules:
5067
runs-on: ubuntu-latest
5168
needs: build

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
## 0.0.5
6+
7+
- Split histogram `+Inf` overflow reporting by label-set so problematic series are listed individually.
8+
- Added metric description (Prometheus HELP text) to overflow findings.
9+
- Improved overflow wording and added on-the-fly unit guessing for histogram outputs.
10+
- Improved release/docs workflow (release target, GitHub Pages docs, container registry update).
11+
12+
## 0.0.4
13+
14+
- Added containerization and Helm chart support for deployment.
15+
- Fixed Helm chart packaging/versioning issues for `0.0.4`.
16+
- Continued rule quality improvements and review metadata propagation.
17+
18+
## 0.0.3
19+
20+
- Introduced rule review metadata and broader rule/test polishing.
21+
- Added/expanded tests for gauge-threshold rules.
22+
- Improved readability of numeric output formatting in reports.
23+
24+
## 0.0.2
25+
26+
- Added web server mode for serving analyzer output.
27+
28+
## 0.0.1
29+
30+
- Initial usable release with the results of the AI hackathon, including:
31+
- interactive TUI mode,
32+
- demo assets,
33+
- generic histogram rule support,
34+
- first web-server iteration.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.4
1+
0.0.5

cmd/metrics-analyzer/main_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func TestE2EAnalyzeCommand(t *testing.T) {
2828
"analyze",
2929
"--rules", "../../testdata/fixtures",
3030
"--format", "markdown",
31+
"--template", "../../templates/markdown.tmpl",
3132
"--output", "/tmp/test_e2e_report.md",
3233
"../../testdata/fixtures/sample_metrics.txt",
3334
},
@@ -209,9 +210,12 @@ func TestE2EFullWorkflow(t *testing.T) {
209210
metricsPath := filepath.Join("..", "..", "testdata", "fixtures", "sample_metrics.txt")
210211
rulesPath := filepath.Join("..", "..", "testdata", "fixtures")
211212

213+
templatePath := filepath.Join("..", "..", "templates", "markdown.tmpl")
214+
212215
cmd := exec.Command(absPath, "analyze",
213216
"--rules", rulesPath,
214217
"--format", "markdown",
218+
"--template", templatePath,
215219
"--output", "/tmp/e2e_test_report.md",
216220
metricsPath,
217221
)

internal/evaluator/evaluator_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func EvaluateAllRules(rulesList []rules.Rule, metrics parser.MetricsData, loadLe
155155
}
156156

157157
// Apply general histogram +Inf overflow rule to all histogram metrics
158-
infOverflowResults := EvaluateHistogramInfOverflow(metrics, loadLevel)
158+
infOverflowResults := EvaluateHistogramInfOverflow(metrics)
159159
for _, result := range infOverflowResults {
160160
report.Results = append(report.Results, result)
161161

0 commit comments

Comments
 (0)