cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.32.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/changelog.md

1058lines · modecode

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