cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.33.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/changelog.md

1093lines · modecode

1# Changelog
2
3## v0.33.1
4
5### Fixed
6
7- Fixed a regression causing poor query cache hit rate.
8
9## v0.33.0
10
11### Added
12
13- Added `uptime` field in `prometheus` configuration block.
14 This field can be used to set a custom metric used for Prometheus uptime checks
15 and by default uses `up` metric.
16 If you have a Prometheus with a large number of scrape targets there might
17 be a huge number of `up` time series making those uptime checks slow to run.
18 If your Prometheus is configured to scrape itself, then you most likely want to use
19 one of metrics exported by Prometheus, like `prometheus_build_info`:
20
21 ```javascript
22 prometheus "prod" {
23 uri = "https://prometheus.example.com"
24 uptime = "prometheus_build_info"
25 }
26 ```
27
28### Changed
29
30- Refactored some quries used by [promql/series](checks/promql/series.md) check to
31 avoid sending quries that might be very slow and/or return a huge amount of data.
32- Prometheus query cache now takes into account the size of cached response.
33 This makes memory usage needed for query cache more predictable.
34 As a result the `cache` option for `prometheus` config block now means
35 `the number of time series cached` instead of `the number of responses cached`
36 and the default for this option is now `50000`.
37
38## v0.32.1
39
40### Fixed
41
42- [promql/vector_matching](checks/promql/vector_matching.md) was sending expensive
43 queries resulting in high memory usage, this is now fixed.
44
45## v0.32.0
46
47### Added
48
49- Added `pint_prometheus_cache_evictions_total` metric tracking the number of times
50 cache results were evicted from query cache.
51- Allow disabling individual checks for the entire file using
52 `# pint file/disable ...` comments.
53
54### Changed
55
56- Refactored query cache to only store queries that are requested more than once.
57 This will avoid storing big responses that are never requested from the cache.
58
59### Fixed
60
61- Config validation will now check for duplicated `prometheus` block names.
62
63## v0.31.1
64
65### Fixed
66
67- Fixed performance regression slowing down `pint watch` over time.
68
69## v0.31.0
70
71### Added
72
73- `prometheus` configuration block now accepts optional `headers` field, for setting
74 request headers that will be attached to any request made to given Prometheus server.
75 Example:
76
77 ```javascript
78 prometheus "protected" {
79 uri = "https://prod.example.com"
80 headers = {
81 "X-Auth": "secret",
82 "X-User": "bob"
83 }
84 ```
85
86### Changed
87
88- Prometheus range query handling was rewritten to improve memory usage
89 caused by queries returing huge number of results.
90 As a result pint should use up to 5x less memory.
91
92### Fixed
93
94- Fixed false positive reports in [promql/vector_matching](checks/promql/vector_matching.md)
95 for rules using `on(...)`. Example:
96
97 ```
98 sum(foo) without(instance) * on(app_name) group_left() bar
99 ```
100- Don't log passwords when Prometheus URI is using basic authentication.
101- Fixed false positive reports in [alerts/template](checks/alerts/template.md)
102 suggeting to use `humanize` on queries that already use `round()`.
103- Fixed false positive reports in [alerts/comparison](checks/alerts/comparison.md)
104 when `bool` modifier is used on a condtion that is guarded by another conditon.
105 Example:
106
107 ```yaml
108 alert: Foo
109 expr: (foo > 1) > bool 1
110 ```
111- Fixed false positive reports in [alerts/template](checks/alerts/template.md)
112 warning about labels removed in a query despite being re-added by a join.
113
114## v0.30.2
115
116### Fixed
117
118- Fixed incorrect line number reporting on BitBucket annotations.
119
120## v0.30.1
121
122### Fixed
123
124- Fixed handling of symlinks when running `pint lint` and `pint watch` commands.
125
126## v0.30.0
127
128### Added
129
130- BitBucket only allows for annotations on modified lines, so when a high severity problem
131 is reported on unmodified line pint will move that annotation to the first modified line,
132 so it's still visible in BitBucket.
133 Now pint will also add a note to that annotation to make it clear that the problem is really
134 on a different line.
135- [alerts/template](checks/alerts/template.md) will now run extra checks to validate syntax
136 of queries executed from within alerting rule templates.
137
138 Example template using `sum(xxx` query that's missing closing `)`:
139
140 {% raw %}
141 ```yaml
142 - alert: ...
143 expr: ...
144 annotations:
145 summary: |
146 {{ with query "sum(xxx" }}
147 {{ . | first | value | humanize }}
148 {{ end }}
149 ```
150 {% endraw %}
151
152- If a file is ignored pint will now note that using `Information` level annotation.
153 This will make it more obvious that a CI check passed because pint didn't run any
154 checks due to file being excluded.
155
156### Changed
157
158- Prometheus rule files can be symlinked between directories.
159 If the symlink source and target files are in a different directory they can
160 end up querying different Prometheus server when running ping checks.
161 This means that when modifying symlink target file checks must be executed against
162 both symlink source and target.
163 Until now pint was ignoring symlinks but starting with this release it will try to
164 follow them. This means that if you modify a file that has symlinks pointint to them
165 pint will try run checks against those symlinks too.
166
167 **NOTE**: pint can only detect and check symlinks if they are located in the current
168 working directory (as seen by running pint process) or its subdirectories.
169
170### Fixed
171
172- Fixed a regression in [promql/vector_matching](checks/promql/vector_matching.md) that
173 would cause a panic when parsing function calls with optional arguments.
174
175## v0.29.4
176
177### Fixed
178
179- [promql/vector_matching](checks/promql/vector_matching.md) was incorrectly handling
180 queries containing function calls with multiple arguments.
181
182## v0.29.3
183
184### Fixed
185
186- Revert 'Use smaller buffers when decoding Prometheus API responses' change.
187
188## v0.29.2
189
190### Fixed
191
192- Use smaller buffers when decoding Prometheus API responses.
193
194## v0.29.1
195
196### Fixed
197
198- Fixed wrong request formatting for Prometheus metric metadata queries.
199
200## v0.29.0
201
202### Changed
203
204- Switched from using [prometheus/client_golang](https://github.com/prometheus/client_golang)
205 API client to streaming JSON library [prymitive/current](https://github.com/prymitive/current)
206
207### Fixed
208
209- Avoid reporting same issue multiple times in `promql/rate` and `promql/regexp` checks.
210
211## v0.28.7
212
213### Changed
214
215- Updated Prometheus modules to [v2.38.0](https://github.com/prometheus/prometheus/releases/tag/v2.38.0).
216 This adds support for `toTime` template function.
217
218## v0.28.6
219
220### Fixed
221
222- Fixed symlink handling when running `pint lint`.
223
224## v0.28.5
225
226### Fixed
227
228- Remove noisy debug logs.
229
230## v0.28.4
231
232### Added
233
234- Added `pint_prometheus_cache_miss_total` metric.
235
236### Changed
237
238- Reduce log level for `File parsed` messages.
239
240### Fixed
241
242- Purge expired cache entries faster to reduce memory usage.
243
244## v0.28.3
245
246### Fixed
247
248- Fix `absent()` handling in [alerts/comparison](checks/alerts/comparison.md) #330.
249
250## v0.28.2
251
252### Added
253
254- Added `--min-severity` flag to the `pint lint` command. Default value is set to `warning`.
255
256### Fixed
257
258- Fix a regression in [promql/vector_matching](checks/promql/vector_matching.md) introduced
259 in previous release.
260- Fix [promql/series](checks/promql/series.md) disable comments not working when there
261 are multiple comments on a rule.
262- [promql/series](checks/promql/series.md) no longer emits an information message
263 `metric is generated by alerts ...`.
264
265## v0.28.1
266
267### Fixed
268
269- Don't use `topk` in [promql/vector_matching](checks/promql/vector_matching.md) check to
270 avoid false positives.
271
272## v0.28.0
273
274### Added
275
276- [promql/rate](checks/promql/rate.md) check will now also validate `deriv` function usage.
277- [alerts/annotation](checks/alerts/annotation.md) check will now recommend using one of
278 humanize functions if alert query is returning results based on `rate()` and the value
279 is used in annotations.
280
281### Changed
282
283- [promql/series](checks/promql/series.md) check now supports more flexible
284 `# pint disable promql/series(...)` comments.
285 Adding a comment `# pint disable promql/series({cluster="dev"})` will disable this check
286 for any metric selector with `cluster="dev"` matcher.
287- [query/cost](checks/query/cost.md) check will now calculate how much Prometheus memory
288 will be needed for storing results of given query.
289 `bytesPerSample` option that was previously used to calculate this was removed.
290- `prometheus {}` config block now allows to pass a list of paths to explicitly ignore
291 by setting `exclude` option. Existing `paths` option was renamed to `include` for
292 consistency. Example migration:
293
294 ```javascript
295 prometheus "foo" {
296 [...]
297 paths = [ "rules/.*" ]
298 }
299 ```
300
301 becomes
302
303 ```javascript
304 prometheus "foo" {
305 [...]
306 include = [ "rules/.*" ]
307 }
308 ```
309
310
311### Fixed
312
313- `pint_last_run_checks` and `pint_last_run_checks_done` were not updated properly.
314
315## v0.27.0
316
317### Added
318
319- Deduplicate reports where possible to avoid showing same issue twice.
320- [rule/link](checks/rule/link.md) check for validating URIs found in alerting rule annotations.
321
322### Changed
323
324- Add more details to BitBucket CI reports.
325- More compact console output when running `pint lint`.
326
327## v0.26.0
328
329### Added
330
331- [promql/range_query](checks/promql/range_query.md) check.
332
333### Fixed
334
335- Strict parsing mode shouldn't fail on template errors, those will be later
336 reported by `alerts/template` check.
337
338## v0.25.0
339
340### Changed
341
342- All timeout options are now optional. This includes following config blocks:
343 * `prometheus { timeout = ... }`
344 * `repository { bitbucket { timeout = ... } }`
345 * `repository { github { timeout = ... } }`
346- `pint` will now try to discover all repository settings from environment variables
347 when run as part of GitHub Actions workflow and so it doesn't need any
348 `repository { github { ... } }` configuration block for that anymore.
349 Setting `GITHUB_AUTH_TOKEN` is the only requirement for GitHub Actions now.
350
351## v0.24.1
352
353### Fixed
354
355- Fixed line reporting on some strict parser errors.
356
357### Added
358
359- Added `--base-branch` flag to `pint ci` command.
360
361## v0.24.0
362
363### Added
364
365- Added rate limit for Prometheus API requests with a default value of 100
366 requests per second. To customize it set `rateLimit` field inside selected
367 `prometheus` server definition.
368- Added `pint_last_run_checks` and `pint_last_run_checks_done` metrics to track
369 progress when running `pint watch`.
370
371## v0.23.0
372
373### Fixed
374
375- Improved range query cache efficiency.
376
377### Added
378
379- Added extra global configuration for `promql/series` check.
380 See check [documentation](checks/promql/series.md) for details.
381- `prometheus` server definition in `pint` config file can now accept optional
382 `cache` field (defaults to 10000) to allow fine tuning of built-in Prometheus
383 API query caching.
384- Added `pint_prometheus_cache_size` metric that exposes the number of entries
385 currently in the query cache.
386
387## v0.22.2
388
389### Fixed
390
391- Improved error reporting when strict mode is enabled.
392
393## v0.22.1
394
395### Fixed
396
397- Fixed high memory usage when running range queries against Prometheus servers.
398
399## v0.22.0
400
401### Changed
402
403- The way `pint` sends API requests to Prometheus was changed to improve performance.
404
405 First change is that each `prometheus` server definition in `pint` config file can
406 now accept optional `concurrency` field (defaults to 16) that sets a limit on how
407 many concurrent requests can that server receive. There is a new metric that
408 tracks how many queries are currently being run for each Prometheus server -
409 `pint_prometheus_queries_running`.
410
411 Second change is that range queries will now be split into smaller queries, so
412 if `pint` needs to run a range query on one week of metrics, then it will break
413 this down into multiple queries each for a two hour slot, and then merge all
414 the results. Previously it would try to run a single query for a whole week
415 and if that failed it would reduce time range until a query would succeed.
416
417### Fixed
418
419- Strict parsing mode didn't fully validate rule group files, this is now fixed
420 and pint runs the same set of checks as Prometheus.
421- Fixed `promql/series` handling of rules with `{__name__=~"foo|bar"}` queries.
422- If Prometheus was stopped or restarted `promql/series` would occasionally
423 report metrics as "sometimes present". This check will now try to find time
424 ranges with no metrics in Prometheus and ignore these when checking if
425 metrics are present.
426
427## v0.21.1
428
429### Fixed
430
431- `pint_prometheus_queries_total` and `pint_prometheus_cache_hits_total` metric wasn't
432 always correctly updated.
433- Ignore `unknown` metric types in `promql/rate`.
434
435## v0.21.0
436
437### Added
438
439- `promql/rate` check will now report if `rate()` or `irate()` function is being
440 passed a non-counter metric.
441
442## v0.20.0
443
444### Fixed
445
446- pint will now correctly handle YAML anchors.
447
448## v0.19.0
449
450### Added
451
452- Parsing files in relaxed mode will now try to find rules inside multi-line strings #252.
453 This allows direct linting of k8s manifests like the one below:
454
455 ```yaml
456 ---
457 kind: ConfigMap
458 apiVersion: v1
459 metadata:
460 name: example-app-alerts
461 labels:
462 app: example-app
463 data:
464 alerts: |
465 groups:
466 - name: example-app-alerts
467 rules:
468 - alert: Example_Is_Down
469 expr: kube_deployment_status_replicas_available{namespace="example-app"} < 1
470 for: 5m
471 labels:
472 priority: "2"
473 environment: production
474 annotations:
475 summary: "No replicas for Example have been running for 5 minutes"
476 ```
477
478## v0.18.1
479
480### Fixed
481
482- Fixed incorrect line reported when pint fails to unmarshall YAML file.
483
484## v0.18.0
485
486### Added
487
488- Allow fine tuning `promql/series` check with extra control comments
489 `# pint rule/set promql/series min-age ...` and
490 `# pint rule/set promql/series ignore/label-value ...`
491 See [promql/series](checks/promql/series.md) for details.
492- `promql/regexp` will report redundant use of regex anchors.
493
494### Changed
495
496- `promql/series` will now report missing metrics only if they were last seen
497 over 2 hours ago by default. This can be customized per rule with comments.
498
499## v0.17.7
500
501### Fixed
502
503- Fix problem line reporting for `rule/owner` check.
504- Add missing `rule/owner` documentation page.
505
506## v0.17.6
507
508### Fixed
509
510- Fixed false positive reports from `promql/series` check when running
511 `pint watch`.
512
513## v0.17.5
514
515### Added
516
517- Added `pint_last_run_duration_seconds` metric.
518- Added `--require-owner` flag support to `pint ci` command.
519
520### Fixed
521
522- Better handling of YAML unmarshal errors.
523
524## v0.17.4
525
526### Fixed
527
528- Fixed false positive reports from `alerts/template` check when `absent()` is
529 used inside a binary expression.
530
531## v0.17.3
532
533### Fixed
534
535- File parse errors didn't report correct line numbers when running `pint ci`.
536
537## v0.17.2
538
539### Fixed
540
541- File parse errors were not reported correctly when running `pint ci`.
542
543## v0.17.1
544
545### Fixed
546
547- Handle `504 Gateway Timeout` HTTP responses from Prometheus same as query
548 timeouts and retry with a shorter range query.
549
550## v0.17.0
551
552### Added
553
554- When running `pint ci` all checks will be skipped if any commit contains
555 `[skip ci]` or `[no ci]` string in the commit message.
556
557### Changed
558
559- By default pint will now parse all files in strict mode, where all rule files
560 must have the exact syntax Prometheus expects:
561
562 ```yaml
563 groups:
564 - name: example
565 rules:
566 - record: ...
567 expr: ...
568 ```
569
570 Previous releases were only looking for individual rules so `groups` object
571 wasn't required. Now pint will fail to read any file that doesn't follow
572 Prometheus syntax exactly.
573 To enable old behavior add `parser { relaxed = ["(.+)", ...]}` option in
574 the config file. See [Configuration](configuration.md) for details.
575 To enable old (relaxed) behavior for all files add:
576
577 ```yaml
578 parser {
579 relaxed = ["(.*)"]
580 }
581 ```
582
583### Fixed
584
585- Improved `promql/vector_matching` checks to detect more issues.
586- Fixed reporting of problems detected on unmodified lines when running `pint ci`.
587
588## v0.16.1
589
590### Fixed
591
592- Fixed false positive reports from `alerts/template` check when `absent()` function
593 is receiving labels from a binary expression.
594
595## v0.16.0
596
597### Added
598
599- When running `pint watch` exported metric can include `owner` label for each rule.
600 This is useful to route alerts based on `pint_problem` metrics to the right team.
601 To set a rule owner add a `# pint file/owner $owner` comment in a file, to set
602 an owner for all rules in that file. You can also set an owner per rule, by adding
603 `# pint rule/owner $owner` comment around given rule.
604 To enforce ownership comments in all files pass `--require-owner` flag to `pint lint`.
605
606## v0.15.7
607
608### Fixed
609
610- `promql/series` check no longer runs duplicated checks on source metrics when
611 a query depends on a recording rule added in the same PR.
612
613## v0.15.6
614
615### Fixed
616
617- `promql/series` check was reporting that a metric stopped being exported when check
618 queries would require a few retries.
619
620## v0.15.5
621
622### Fixed
623
624- `promql/series` check was reporting both `Warning` and `Bug` problems for the
625 same metric when it was using newly added recording rule.
626
627## v0.15.4
628
629### Fixed
630
631- Fixed false positive reports from `promql/fragile` when `foo OR bar` is used inside
632 aggregation.
633
634## v0.15.3
635
636### Fixed
637
638- Use more efficient queries for `promql/series` check.
639- Fixed YAML parsing panics detected by Go 1.18 fuzzing.
640
641## v0.15.2
642
643### Fixed
644
645- Improved query cache hit rate and added `pint_prometheus_cache_hits_total` metric
646 to track the number of cache hits.
647
648## v0.15.1
649
650### Added
651
652- When a range query returns `query processing would load too many samples into memory`
653 error and we retry it with smaller time range cache this information and start with
654 that smaller time range for future calls to speed up running `pint watch`.
655
656## v0.15.0
657
658### Changed
659
660- Always print the number of detected problems when running `pint lint`.
661- `promql/series` check was refactored and will now detect a range of
662 problems. See [promql/series](checks/promql/series.md) for details.
663- `promql/regexp` severity is now `Bug` instead of a `Warning`.
664- `promql/rate` check will no longer produce warnings, it will only
665 report issues that cause queries to never return anything.
666
667## v0.14.0
668
669### Added
670
671- Allow matching alerting rules by `for` field - #148. Example:
672
673 ```js
674 rule {
675 match {
676 for = ">= 10m"
677 }
678 }
679 ```
680- Regexp matchers used in check rules can now reference rule fields.
681 See [Configuration](configuration.md) for details.
682
683### Changed
684
685- Added `filename` label to `pint_problem` metric - #170.
686- Include Prometheus server URI in reported problems.
687
688### Fixed
689
690- Fixed `pint ci` handling when a file was added to git and then removed in the
691 next commit.
692
693## v0.13.2
694
695### Fixed
696
697- `yaml/parse` was using incorrect line numbers for errors caused by duplicated
698 YAML keys.
699
700## v0.13.1
701
702### Fixed
703
704- Don't use failover Prometheus servers in case of errors caused by the query
705 itself, like `many-to-many matching not allowed`.
706
707## v0.13.0
708
709### Added
710
711- `yaml/parse` error will be raised if a rule file contains duplicated keys, example:
712
713 ```yaml
714 - record: foo
715 expr: sum(my_metric)
716 expr: sum(my_metric) without(instance)
717 ```
718
719### Changed
720
721- `prometheus` config block now allows to specify failover URIs using `failover` field.
722 If failover URIs are set and main URI fails to respond pint will attempt to use them
723 in the order specified until one of them works.
724- `prometheus` config block now allows to define how upstream errors are handled using
725 `required` field. If `required` is set to `true` any check that depends on remote
726 Prometheus server will be reported as `bug` if it's unable to talk to it.
727 If `required` is set to `false` pint will only emit `warning` level results.
728 Default value for `required` is `false`. Set it to `true` if you want to hard fail
729 in case of remote Prometheus issues. Note that setting it to `true` might block
730 PRs when running `pint ci` until pint is able to talk to Prometheus again.
731- Renamed `pint/parse` to `yaml/parse` and added missing documentation for it.
732
733## v0.12.0
734
735### Added
736
737- Added `pint_last_run_time_seconds` and `pint_rules_parsed_total` metrics when running `pint watch`.
738
739### Changed
740
741- `promql/comparison` only applies to alerts, so it was renamed to
742 `alerts/comparison`.
743- Online documentation hosted at [cloudflare.github.io/pint](https://cloudflare.github.io/pint/)
744 was reworked.
745- `alerts/count` check will now retry range queries with shorter time window
746 on `found duplicate series for the match group ...` errors from Prometheus.
747
748## v0.11.1
749
750### Fixed
751
752- `pint_prometheus_queries_total` and `pint_prometheus_query_errors_total` metrics
753 were not incremented correctly.
754
755## v0.11.0
756
757### Added
758
759- Added `promql/regexp` check that will warn about unnecessary regexp matchers.
760- Added `pint_prometheus_queries_total` and `pint_prometheus_query_errors_total`
761 metric when running `pint watch`.
762
763## v0.10.1
764
765### Fixed
766
767- Fixed a number of bug with `promql/vector_matching` check.
768
769## v0.10.0
770
771### Changed
772
773- `query/series` check was renamed to `promql/series`.
774
775### Fixed
776
777- Improved the logic of `promql/vector_matching` check.
778
779## v0.9.0
780
781### Changed
782
783- Removed `lines` label from `pint_problem` metric exported when running `pint watch`.
784- Multiple `match` and `ignore` blocks can now be specified per each `rule`.
785
786## v0.8.2
787
788### Added
789
790- Export `pint_version` metric when running `pint watch`.
791- Added `--min-severity` flag to `pint watch` command.
792
793## v0.8.1
794
795### Added
796
797- Added `--max-problems` flag to `pint watch` command.
798
799### Changed
800
801- Updated Prometheus modules to [v2.33.0](https://github.com/prometheus/prometheus/releases/tag/v2.33.0).
802 This adds support for `stripPort` template function.
803
804## v0.8.0
805
806### Added
807
808- Added new `promql/fragile` check.
809- BitBucket reports will now include a link to documentation.
810
811## v0.7.3
812
813### Added
814
815- `--workers` flag to control the number of worker threads for running checks.
816
817## v0.7.2
818
819### Changed
820
821- More aggressive range reduction for `query processing would load too many samples into memory`
822 errors when sending range queries to Prometheus servers.
823
824## v0.7.1
825
826### Added
827
828- Added `command` filter to `match` / `ignore` blocks. This allows to include
829 skip some checks when (for example) running `pint watch` but include them
830 in `pint lint` run.
831
832## v0.7.0
833
834### Added
835
836- Cache each Prometheus server responses to minimize the number of API calls.
837- `pint watch` will start a daemon that will continuously check all matching rules
838 and expose metrics describing all discovered problems.
839
840### Changed
841
842- `alerts/annotation` and `rule/label` now include `required` flag value in
843 `# pint disable ...` comments.
844 Rename `# pint disable alerts/annotation($name)` to
845 `# pint disable alerts/annotation($name:$required)` and
846 `# pint disable rule/label($name)` to `# pint disable rule/label($name:$required)`.
847- `--offline` and `--disabled` flags are now global, use `pint --offline lint` instead
848 of `pint lint --offline`.
849
850### Fixed
851
852- `promql/rate`, `query/series` and `promql/vector_matching` checks were not enabled
853 for all defined `prometheus {}` blocks unless there was at least one `rule {}` block.
854- `annotation` based `match` blocks didn't work correctly.
855
856## v0.6.6
857
858### Fixed
859
860- File renames were not handled correctly when running `git ci` on branches with
861 multiple commits.
862
863## v0.6.5
864
865### Added
866
867- Allow disabling `query/series` check for individual series using
868 `# pint disable query/series(my_metric_name)` comments.
869
870## v0.6.4
871
872### Fixed
873
874- Fixed docker builds.
875
876## v0.6.3
877
878### Fixed
879
880- `aggregate` check didn't report stripping required labels on queries
881 using aggregation with no grouping labels (`sum(foo)`).
882- `aggregate` check didn't test for name and label matches on alert rules.
883
884## v0.6.2
885
886### Changed
887
888- `template` check will now include alert query line numbers when reporting issues.
889
890## v0.6.1
891
892### Fixed
893
894- Labels returned by `absent()` are only from equal match types (`absent(foo="bar")`,
895 not `absent(foo=~"bar.+")` but `alerts/template` didn't test for match type when
896 checking for labels sourced from `absent()` queries.
897
898## v0.6.0
899
900### Changed
901
902- `aggregate` check was refactored and uses to run a single test for both
903 `by` and `without` conditions. As a result this check might now find issues
904 previously undetected.
905 Check suppression comments will need to be migrated:
906 * `# pint disable promql/by` becomes `# pint disable promql/aggregate`
907 * `# pint disable promql/without` becomes `# pint disable promql/aggregate`
908 * `# pint ignore promql/by` becomes `# pint ignore promql/aggregate`
909 * `# pint ignore promql/without` becomes `# pint ignore promql/aggregate`
910
911## v0.5.3
912
913### Fixed
914
915- Fixed false positive reports in `aggregate` check.
916
917## v0.5.2
918
919### Added
920
921- `--no-color` flag for disabling output colouring.
922
923### Fixed
924
925- Fixed duplicated warnings when multiple `rule {...}` blocks where configured.
926
927## v0.5.1
928
929### Fixed
930
931- Specifying multiple `# pint disable ...` comments on a single rule would only apply
932 last comment. This now works correctly and all comments will be applied.
933
934## v0.5.0
935
936### Added
937
938- Added `alerts/for` check that will look for invalid `for` values in alerting rules.
939 This check is enabled by default.
940
941### Changed
942
943- `comparison` check is now enabled by default and require no configuration.
944 Remove `comparison{ ... }` blocks from pint config file when upgrading.
945- `template` check is now enabled by default and require no configuration.
946 Remove `template{ ... }` blocks from pint config file when upgrading.
947- `rate` check is now enabled by default for all configured Prometheus servers.
948 Remove `rate{ ... }` blocks from pint config file when upgrading.
949- `series` check is now enabled by default for all configured Prometheus servers.
950 Remove `series{ ... }` blocks from pint config file when upgrading.
951- `vector_matching` check is now enabled by default for all configured Prometheus servers.
952 Remove `vector_matching{ ... }` blocks from pint config file when upgrading.
953
954## v0.4.4
955
956### Added
957
958- Support `parseDuration` function in alert templates added in Prometheus 2.32.0
959
960## v0.4.3
961
962### Fixed
963
964- Fixed `series` check handling of queries with `{__name__="foo"}` selectors.
965
966## v0.4.2
967
968### Fixed
969
970- Fixed `template` check handling of `absent` calls on aggregated metrics, like
971 `absent(sum(nonexistent{job="myjob"}))`.
972
973## v0.4.1
974
975### Added
976
977- `template` check will now warn if any template is referencing a label that is not passed to
978 `absent()`.
979 Example:
980
981 {% raw %}
982 ```yaml
983 - alert: Foo
984 expr: absent(foo{env="prod"})
985 annotations:
986 summary: 'foo metric is missing for job {{ $labels.job }}'
987 ```
988 {% endraw %}
989
990 Would generate a warning since `absent()` can only return labels that are explicitly
991 passed to it and the above call only passes `env` label.
992 This can be fixed by updating the query to `absent(foo{env="prod", job="bar"})`.
993
994## v0.4.0
995
996### Added
997
998- `comparison` check will now warn when alert query uses
999 [bool](https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators)
1000 modifier after condition, which can cause alert to always fire.
1001 Example:
1002
1003 ```yaml
1004 - alert: Foo
1005 expr: rate(error_count[5m]) > bool 5
1006 ```
1007
1008 Having `bool` as part of `> 5` condition means that the query will return value `1` when condition
1009 is met, and `0` when it's not. Rather than returning value of `rate(error_count[5m])` only when
1010 that value is `> 5`. Since all results of an alerting rule `expr` are considered alerts such alert
1011 rule could always fire, regardless of the value returned by `rate(error_count[5m])`.
1012
1013### Fixed
1014
1015- `comparison` check will now ignore `absent(foo)` alert queries without any condition.
1016
1017## v0.3.1
1018
1019### Added
1020
1021- `--offline` flag for `pint ci` command.
1022
1023### Fixed
1024
1025- Fixed `template` check panic when alert query had a syntax error.
1026
1027## v0.3.0
1028
1029### Added
1030
1031- `rule` block can now specify `ignore` conditions that have the same syntax as `match`
1032 but will disable `rule` for matching alerting and recording rules #48.
1033- `match` and `ignore` blocks can now filter alerting and recording rules by name.
1034 `record` will be used as name for recording rules and `alert` for alerting rules.
1035
1036## v0.2.0
1037
1038### Added
1039
1040- `--offline` flag for `pint lint` command. When passed only checks that don't send
1041 any live queries to Prometheus server will be run.
1042- `template` check will now warn if template if referencing a label that is being
1043 stripped by aggregation.
1044 Example:
1045
1046 {% raw %}
1047 ```yaml
1048 - alert: Foo
1049 expr: count(up) without(instance) == 0
1050 annotations:
1051 summary: 'foo is down on {{ $labels.instance }}'
1052 ```
1053 {% endraw %}
1054
1055 Would generate a warning since `instance` label is being stripped by `without(instance)`.
1056
1057## v0.1.5
1058
1059### Fixed
1060
1061- Fixed file descriptor leak due to missing file `Close()` #69.
1062
1063## v0.1.4
1064
1065### Changed
1066
1067- Retry queries that error with `query processing would load too many samples into memory`
1068 using a smaller time range.
1069
1070## v0.1.3
1071
1072### Added
1073
1074- `vector_matching` check for finding queries with incorrect `on()` or `ignoring()`
1075 keywords.
1076
1077### Fixed
1078
1079- `comparison` check would trigger false positive for rules using `unless` keyword.
1080
1081## v0.1.2
1082
1083### Fixed
1084
1085- `# pint skip/line` place between `# pint skip/begin` and `# pint skip/end` lines would
1086 reset ignore rules causing lines that should be ignored to be parsed.
1087
1088## v0.1.1
1089
1090### Changed
1091
1092- `value` check was replaced by `template`, which covers the same functionality and more.
1093 See [docs](/docs/CONFIGURATION.md#template) for details.