cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.28.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/changelog.md

831lines · modecode

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