cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.33.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/changelog.md

1087lines · modecode

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