Skip to content

Commit

Permalink
Raise promql/series severity from Warning to Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Mar 3, 2022
1 parent 2205139 commit 3374eac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/pint/tests/0055_prometheus_failover.txt
@@ -1,7 +1,7 @@
exec bash -x ./prometheus.sh &
exec bash -c 'I=0 ; while [ ! -f prometheus.pid ] && [ $I -lt 30 ]; do sleep 1; I=$((I+1)); done'

pint.ok --no-color lint rules
pint.error --no-color lint rules
! stdout .
stderr 'level=error msg="Query failed" error="Post \\"http://127.0.0.1:1055/api/v1/query\\": dial tcp 127.0.0.1:1055: connect: connection refused" query=count\(foo\) uri=http://127.0.0.1:1055'
stderr 'level=error msg="Failed to query Prometheus configuration" error="Get \\"http://127.0.0.1:1055/api/v1/status/config\\": dial tcp 127.0.0.1:1055: connect: connection refused" uri=http://127.0.0.1:1055'
Expand Down
3 changes: 2 additions & 1 deletion docs/changelog.md
@@ -1,10 +1,11 @@
# Changelog

## v0.14.1
## v0.15.0

### Changed

- Always print the number of detected problems when running `pint lint`.
- Raise `promql/series` severity from `Warning` to `Bug`.

## v0.14.0

Expand Down
2 changes: 1 addition & 1 deletion internal/checks/promql_series.go
Expand Up @@ -96,7 +96,7 @@ func (c SeriesCheck) countSeries(ctx context.Context, expr parser.PromQLExpr, se
Lines: expr.Lines(),
Reporter: c.Reporter(),
Text: fmt.Sprintf("query using %q on %s completed without any results for %s", c.prom.Name(), qr.URI, selector.String()),
Severity: Warning,
Severity: Bug,
})
return
}
Expand Down
14 changes: 7 additions & 7 deletions internal/checks/promql_series_test.go
Expand Up @@ -149,7 +149,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{2},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for notfound`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand All @@ -163,7 +163,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{2},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for notfound`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand All @@ -177,7 +177,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{2},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for notfound`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand Down Expand Up @@ -226,7 +226,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{2},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for found{job="notfound"}`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand All @@ -240,7 +240,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{2},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for notfound`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand All @@ -257,7 +257,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{3},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for {__name__="notfound",job="bar"}`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestSeriesCheck(t *testing.T) {
Lines: []int{4},
Reporter: "promql/series",
Text: fmt.Sprintf(`query using "prom" on %s completed without any results for notfound`, srv.URL),
Severity: checks.Warning,
Severity: checks.Bug,
},
},
},
Expand Down

0 comments on commit 3374eac

Please sign in to comment.