cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
docs/changelog.md
590lines · modecode
| 1 | # Changelog |
| 2 | |
| 3 | ## v0.17.6 |
| 4 | |
| 5 | ### Fixed |
| 6 | |
| 7 | - Fixed false positive reports from `promql/series` check when running |
| 8 | `pint watch`. |
| 9 | |
| 10 | ## v0.17.5 |
| 11 | |
| 12 | ### Added |
| 13 | |
| 14 | - Added `pint_last_run_duration_seconds` metric. |
| 15 | - Added `--require-owner` flag support to `pint ci` command. |
| 16 | |
| 17 | ### Fixed |
| 18 | |
| 19 | - Better handling of YAML unmarshal errors. |
| 20 | |
| 21 | ## v0.17.4 |
| 22 | |
| 23 | ### Fixed |
| 24 | |
| 25 | - Fixed false positive reports from `alerts/template` check when `absent()` is |
| 26 | used inside a binary expression. |
| 27 | |
| 28 | ## v0.17.3 |
| 29 | |
| 30 | ### Fixed |
| 31 | |
| 32 | - File parse errors didn't report correct line numbers when running `pint ci`. |
| 33 | |
| 34 | ## v0.17.2 |
| 35 | |
| 36 | ### Fixed |
| 37 | |
| 38 | - File parse errors were not reported correctly when running `pint ci`. |
| 39 | |
| 40 | ## v0.17.1 |
| 41 | |
| 42 | ### Fixed |
| 43 | |
| 44 | - Handle `504 Gateway Timeout` HTTP responses from Prometheus same as query |
| 45 | timeouts and retry with a shorter range query. |
| 46 | |
| 47 | ## v0.17.0 |
| 48 | |
| 49 | ### Added |
| 50 | |
| 51 | - When running `pint ci` all checks will be skipped if any commit contains |
| 52 | `[skip ci]` or `[no ci]` string in the commit message. |
| 53 | |
| 54 | ### Changed |
| 55 | |
| 56 | - By default pint will now parse all files in strict mode, where all rule files |
| 57 | must have the exact syntax Prometheus expects: |
| 58 | |
| 59 | ```yaml |
| 60 | groups: |
| 61 | - name: example |
| 62 | rules: |
| 63 | - record: ... |
| 64 | expr: ... |
| 65 | ``` |
| 66 | |
| 67 | Previous releases were only looking for individual rules so `groups` object |
| 68 | wasn't required. Now pint will fail to read any file that doesn't follow |
| 69 | Prometheus syntax exactly. |
| 70 | To enable old behavior add `parser { relaxed = ["(.+)", ...]}` option in |
| 71 | the config file. See [Configuration](/docs/configuration.md) for details. |
| 72 | To enable old (relaxed) behavior for all files add: |
| 73 | |
| 74 | ```yaml |
| 75 | parser { |
| 76 | relaxed = ["(.*)"] |
| 77 | } |
| 78 | ``` |
| 79 | |
| 80 | ### Fixed |
| 81 | |
| 82 | - Improved `promql/vector_matching` checks to detect more issues. |
| 83 | - Fixed reporting of problems detected on unmodified lines when running `pint ci`. |
| 84 | |
| 85 | ## v0.16.1 |
| 86 | |
| 87 | ### Fixed |
| 88 | |
| 89 | - Fixed false positive reports from `alerts/template` check when `absent()` function |
| 90 | is receiving labels from a binary expression. |
| 91 | |
| 92 | ## v0.16.0 |
| 93 | |
| 94 | ### Added |
| 95 | |
| 96 | - When running `pint watch` exported metric can include `owner` label for each rule. |
| 97 | This is useful to route alerts based on `pint_problem` metrics to the right team. |
| 98 | To set a rule owner add a `# pint file/owner $owner` comment in a file, to set |
| 99 | an owner for all rules in that file. You can also set an owner per rule, by adding |
| 100 | `# pint rule/owner $owner` comment around given rule. |
| 101 | To enforce ownership comments in all files pass `--require-owner` flag to `pint lint`. |
| 102 | |
| 103 | ## v0.15.7 |
| 104 | |
| 105 | ### Fixed |
| 106 | |
| 107 | - `promql/series` check no longer runs duplicated checks on source metrics when |
| 108 | a query depends on a recording rule added in the same PR. |
| 109 | |
| 110 | ## v0.15.6 |
| 111 | |
| 112 | ### Fixed |
| 113 | |
| 114 | - `promql/series` check was reporting that a metric stopped being exported when check |
| 115 | queries would require a few retries. |
| 116 | |
| 117 | ## v0.15.5 |
| 118 | |
| 119 | ### Fixed |
| 120 | |
| 121 | - `promql/series` check was reporting both `Warning` and `Bug` problems for the |
| 122 | same metric when it was using newly added recording rule. |
| 123 | |
| 124 | ## v0.15.4 |
| 125 | |
| 126 | ### Fixed |
| 127 | |
| 128 | - Fixed false positive reports from `promql/fragile` when `foo OR bar` is used inside |
| 129 | aggregation. |
| 130 | |
| 131 | ## v0.15.3 |
| 132 | |
| 133 | ### Fixed |
| 134 | |
| 135 | - Use more efficient queries for `promql/series` check. |
| 136 | - Fixed YAML parsing panics detected by Go 1.18 fuzzing. |
| 137 | |
| 138 | ## v0.15.2 |
| 139 | |
| 140 | ### Fixed |
| 141 | |
| 142 | - Improved query cache hit rate and added `pint_prometheus_cache_hits_total` metric |
| 143 | to track the number of cache hits. |
| 144 | |
| 145 | ## v0.15.1 |
| 146 | |
| 147 | ### Added |
| 148 | |
| 149 | - When a range query returns `query processing would load too many samples into memory` |
| 150 | error and we retry it with smaller time range cache this information and start with |
| 151 | that smaller time range for future calls to speed up running `pint watch`. |
| 152 | |
| 153 | ## v0.15.0 |
| 154 | |
| 155 | ### Changed |
| 156 | |
| 157 | - Always print the number of detected problems when running `pint lint`. |
| 158 | - `promql/series` check was refactored and will now detect a range of |
| 159 | problems. See [promql/series](checks/promql/series.md) for details. |
| 160 | - `promql/regexp` severity is now `Bug` instead of a `Warning`. |
| 161 | - `promql/rate` check will no longer produce warnings, it will only |
| 162 | report issues that cause queries to never return anything. |
| 163 | |
| 164 | ## v0.14.0 |
| 165 | |
| 166 | ### Added |
| 167 | |
| 168 | - Allow matching alerting rules by `for` field - #148. Example: |
| 169 | |
| 170 | ```js |
| 171 | rule { |
| 172 | match { |
| 173 | for = ">= 10m" |
| 174 | } |
| 175 | } |
| 176 | ``` |
| 177 | - Regexp matchers used in check rules can now reference rule fields. |
| 178 | See [Configuration](configuration.md) for details. |
| 179 | |
| 180 | ### Changed |
| 181 | |
| 182 | - Added `filename` label to `pint_problem` metric - #170. |
| 183 | - Include Prometheus server URI in reported problems. |
| 184 | |
| 185 | ### Fixed |
| 186 | |
| 187 | - Fixed `pint ci` handling when a file was added to git and then removed in the |
| 188 | next commit. |
| 189 | |
| 190 | ## v0.13.2 |
| 191 | |
| 192 | ### Fixed |
| 193 | |
| 194 | - `yaml/parse` was using incorrect line numbers for errors caused by duplicated |
| 195 | YAML keys. |
| 196 | |
| 197 | ## v0.13.1 |
| 198 | |
| 199 | ### Fixed |
| 200 | |
| 201 | - Don't use failover Prometheus servers in case of errors caused by the query |
| 202 | itself, like `many-to-many matching not allowed`. |
| 203 | |
| 204 | ## v0.13.0 |
| 205 | |
| 206 | ### Added |
| 207 | |
| 208 | - `yaml/parse` error will be raised if a rule file contains duplicated keys, example: |
| 209 | |
| 210 | ```yaml |
| 211 | - record: foo |
| 212 | expr: sum(my_metric) |
| 213 | expr: sum(my_metric) without(instance) |
| 214 | ``` |
| 215 | |
| 216 | ### Changed |
| 217 | |
| 218 | - `prometheus` config block now allows to specify failover URIs using `failover` field. |
| 219 | If failover URIs are set and main URI fails to respond pint will attempt to use them |
| 220 | in the order specified until one of them works. |
| 221 | - `prometheus` config block now allows to define how upstream errors are handled using |
| 222 | `required` field. If `required` is set to `true` any check that depends on remote |
| 223 | Prometheus server will be reported as `bug` if it's unable to talk to it. |
| 224 | If `required` is set to `false` pint will only emit `warning` level results. |
| 225 | Default value for `required` is `false`. Set it to `true` if you want to hard fail |
| 226 | in case of remote Prometheus issues. Note that setting it to `true` might block |
| 227 | PRs when running `pint ci` until pint is able to talk to Prometheus again. |
| 228 | - Renamed `pint/parse` to `yaml/parse` and added missing documentation for it. |
| 229 | |
| 230 | ## v0.12.0 |
| 231 | |
| 232 | ### Added |
| 233 | |
| 234 | - Added `pint_last_run_time_seconds` and `pint_rules_parsed_total` metrics when running `pint watch`. |
| 235 | |
| 236 | ### Changed |
| 237 | |
| 238 | - `promql/comparison` only applies to alerts, so it was renamed to |
| 239 | `alerts/comparison`. |
| 240 | - Online documentation hosted at [cloudflare.github.io/pint](https://cloudflare.github.io/pint/) |
| 241 | was reworked. |
| 242 | - `alerts/count` check will now retry range queries with shorter time window |
| 243 | on `found duplicate series for the match group ...` errors from Prometheus. |
| 244 | |
| 245 | ## v0.11.1 |
| 246 | |
| 247 | ### Fixed |
| 248 | |
| 249 | - `pint_prometheus_queries_total` and `pint_prometheus_query_errors_total` metrics |
| 250 | were not incremented correctly. |
| 251 | |
| 252 | ## v0.11.0 |
| 253 | |
| 254 | ### Added |
| 255 | |
| 256 | - Added `promql/regexp` check that will warn about unnecessary regexp matchers. |
| 257 | - Added `pint_prometheus_queries_total` and `pint_prometheus_query_errors_total` |
| 258 | metric when running `pint watch`. |
| 259 | |
| 260 | ## v0.10.1 |
| 261 | |
| 262 | ### Fixed |
| 263 | |
| 264 | - Fixed a number of bug with `promql/vector_matching` check. |
| 265 | |
| 266 | ## v0.10.0 |
| 267 | |
| 268 | ### Changed |
| 269 | |
| 270 | - `query/series` check was renamed to `promql/series`. |
| 271 | |
| 272 | ### Fixed |
| 273 | |
| 274 | - Improved the logic of `promql/vector_matching` check. |
| 275 | |
| 276 | ## v0.9.0 |
| 277 | |
| 278 | ### Changed |
| 279 | |
| 280 | - Removed `lines` label from `pint_problem` metric exported when running `pint watch`. |
| 281 | - Multiple `match` and `ignore` blocks can now be specified per each `rule`. |
| 282 | |
| 283 | ## v0.8.2 |
| 284 | |
| 285 | ### Added |
| 286 | |
| 287 | - Export `pint_version` metric when running `pint watch`. |
| 288 | - Added `--min-severity` flag to `pint watch` command. |
| 289 | |
| 290 | ## v0.8.1 |
| 291 | |
| 292 | ### Added |
| 293 | |
| 294 | - Added `--max-problems` flag to `pint watch` command. |
| 295 | |
| 296 | ### Changed |
| 297 | |
| 298 | - Updated Prometheus modules to [v2.33.0](https://github.com/prometheus/prometheus/releases/tag/v2.33.0). |
| 299 | This adds support for `stripPort` template function. |
| 300 | |
| 301 | ## v0.8.0 |
| 302 | |
| 303 | ### Added |
| 304 | |
| 305 | - Added new `promql/fragile` check. |
| 306 | - BitBucket reports will now include a link to documentation. |
| 307 | |
| 308 | ## v0.7.3 |
| 309 | |
| 310 | ### Added |
| 311 | |
| 312 | - `--workers` flag to control the number of worker threads for running checks. |
| 313 | |
| 314 | ## v0.7.2 |
| 315 | |
| 316 | ### Changed |
| 317 | |
| 318 | - More aggressive range reduction for `query processing would load too many samples into memory` |
| 319 | errors when sending range queries to Prometheus servers. |
| 320 | |
| 321 | ## v0.7.1 |
| 322 | |
| 323 | ### Added |
| 324 | |
| 325 | - Added `command` filter to `match` / `ignore` blocks. This allows to include |
| 326 | skip some checks when (for example) running `pint watch` but include them |
| 327 | in `pint lint` run. |
| 328 | |
| 329 | ## v0.7.0 |
| 330 | |
| 331 | ### Added |
| 332 | |
| 333 | - Cache each Prometheus server responses to minimize the number of API calls. |
| 334 | - `pint watch` will start a daemon that will continuously check all matching rules |
| 335 | and expose metrics describing all discovered problems. |
| 336 | |
| 337 | ### Changed |
| 338 | |
| 339 | - `alerts/annotation` and `rule/label` now include `required` flag value in |
| 340 | `# pint disable ...` comments. |
| 341 | Rename `# pint disable alerts/annotation($name)` to |
| 342 | `# pint disable alerts/annotation($name:$required)` and |
| 343 | `# pint disable rule/label($name)` to `# pint disable rule/label($name:$required)`. |
| 344 | - `--offline` and `--disabled` flags are now global, use `pint --offline lint` instead |
| 345 | of `pint lint --offline`. |
| 346 | |
| 347 | ### Fixed |
| 348 | |
| 349 | - `promql/rate`, `query/series` and `promql/vector_matching` checks were not enabled |
| 350 | for all defined `prometheus {}` blocks unless there was at least one `rule {}` block. |
| 351 | - `annotation` based `match` blocks didn't work correctly. |
| 352 | |
| 353 | ## v0.6.6 |
| 354 | |
| 355 | ### Fixed |
| 356 | |
| 357 | - File renames were not handled correctly when running `git ci` on branches with |
| 358 | multiple commits. |
| 359 | |
| 360 | ## v0.6.5 |
| 361 | |
| 362 | ### Added |
| 363 | |
| 364 | - Allow disabling `query/series` check for individual series using |
| 365 | `# pint disable query/series(my_metric_name)` comments. |
| 366 | |
| 367 | ## v0.6.4 |
| 368 | |
| 369 | ### Fixed |
| 370 | |
| 371 | - Fixed docker builds. |
| 372 | |
| 373 | ## v0.6.3 |
| 374 | |
| 375 | ### Fixed |
| 376 | |
| 377 | - `aggregate` check didn't report stripping required labels on queries |
| 378 | using aggregation with no grouping labels (`sum(foo)`). |
| 379 | - `aggregate` check didn't test for name and label matches on alert rules. |
| 380 | |
| 381 | ## v0.6.2 |
| 382 | |
| 383 | ### Changed |
| 384 | |
| 385 | - `template` check will now include alert query line numbers when reporting issues. |
| 386 | |
| 387 | ## v0.6.1 |
| 388 | |
| 389 | ### Fixed |
| 390 | |
| 391 | - Labels returned by `absent()` are only from equal match types (`absent(foo="bar")`, |
| 392 | not `absent(foo=~"bar.+")` but `alerts/template` didn't test for match type when |
| 393 | checking for labels sourced from `absent()` queries. |
| 394 | |
| 395 | ## v0.6.0 |
| 396 | |
| 397 | ### Changed |
| 398 | |
| 399 | - `aggregate` check was refactored and uses to run a single test for both |
| 400 | `by` and `without` conditions. As a result this check might now find issues |
| 401 | previously undetected. |
| 402 | Check suppression comments will need to be migrated: |
| 403 | * `# pint disable promql/by` becomes `# pint disable promql/aggregate` |
| 404 | * `# pint disable promql/without` becomes `# pint disable promql/aggregate` |
| 405 | * `# pint ignore promql/by` becomes `# pint ignore promql/aggregate` |
| 406 | * `# pint ignore promql/without` becomes `# pint ignore promql/aggregate` |
| 407 | |
| 408 | ## v0.5.3 |
| 409 | |
| 410 | ### Fixed |
| 411 | |
| 412 | - Fixed false positive reports in `aggregate` check. |
| 413 | |
| 414 | ## v0.5.2 |
| 415 | |
| 416 | ### Added |
| 417 | |
| 418 | - `--no-color` flag for disabling output colouring. |
| 419 | |
| 420 | ### Fixed |
| 421 | |
| 422 | - Fixed duplicated warnings when multiple `rule {...}` blocks where configured. |
| 423 | |
| 424 | ## v0.5.1 |
| 425 | |
| 426 | ### Fixed |
| 427 | |
| 428 | - Specifying multiple `# pint disable ...` comments on a single rule would only apply |
| 429 | last comment. This now works correctly and all comments will be applied. |
| 430 | |
| 431 | ## v0.5.0 |
| 432 | |
| 433 | ### Added |
| 434 | |
| 435 | - Added `alerts/for` check that will look for invalid `for` values in alerting rules. |
| 436 | This check is enabled by default. |
| 437 | |
| 438 | ### Changed |
| 439 | |
| 440 | - `comparison` check is now enabled by default and require no configuration. |
| 441 | Remove `comparison{ ... }` blocks from pint config file when upgrading. |
| 442 | - `template` check is now enabled by default and require no configuration. |
| 443 | Remove `template{ ... }` blocks from pint config file when upgrading. |
| 444 | - `rate` check is now enabled by default for all configured Prometheus servers. |
| 445 | Remove `rate{ ... }` blocks from pint config file when upgrading. |
| 446 | - `series` check is now enabled by default for all configured Prometheus servers. |
| 447 | Remove `series{ ... }` blocks from pint config file when upgrading. |
| 448 | - `vector_matching` check is now enabled by default for all configured Prometheus servers. |
| 449 | Remove `vector_matching{ ... }` blocks from pint config file when upgrading. |
| 450 | |
| 451 | ## v0.4.4 |
| 452 | |
| 453 | ### Added |
| 454 | |
| 455 | - Support `parseDuration` function in alert templates added in Prometheus 2.32.0 |
| 456 | |
| 457 | ## v0.4.3 |
| 458 | |
| 459 | ### Fixed |
| 460 | |
| 461 | - Fixed `series` check handling of queries with `{__name__="foo"}` selectors. |
| 462 | |
| 463 | ## v0.4.2 |
| 464 | |
| 465 | ### Fixed |
| 466 | |
| 467 | - Fixed `template` check handling of `absent` calls on aggregated metrics, like |
| 468 | `absent(sum(nonexistent{job="myjob"}))`. |
| 469 | |
| 470 | ## v0.4.1 |
| 471 | |
| 472 | ### Added |
| 473 | |
| 474 | - `template` check will now warn if any template is referencing a label that is not passed to |
| 475 | `absent()`. |
| 476 | Example: |
| 477 | |
| 478 | {% raw %} |
| 479 | ```yaml |
| 480 | - alert: Foo |
| 481 | expr: absent(foo{env="prod"}) |
| 482 | annotations: |
| 483 | summary: 'foo metric is missing for job {{ $labels.job }}' |
| 484 | ``` |
| 485 | {% endraw %} |
| 486 | |
| 487 | Would generate a warning since `absent()` can only return labels that are explicitly |
| 488 | passed to it and the above call only passes `env` label. |
| 489 | This can be fixed by updating the query to `absent(foo{env="prod", job="bar"})`. |
| 490 | |
| 491 | ## v0.4.0 |
| 492 | |
| 493 | ### Added |
| 494 | |
| 495 | - `comparison` check will now warn when alert query uses |
| 496 | [bool](https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators) |
| 497 | modifier after condition, which can cause alert to always fire. |
| 498 | Example: |
| 499 | |
| 500 | ```yaml |
| 501 | - alert: Foo |
| 502 | expr: rate(error_count[5m]) > bool 5 |
| 503 | ``` |
| 504 | |
| 505 | Having `bool` as part of `> 5` condition means that the query will return value `1` when condition |
| 506 | is met, and `0` when it's not. Rather than returning value of `rate(error_count[5m])` only when |
| 507 | that value is `> 5`. Since all results of an alerting rule `expr` are considered alerts such alert |
| 508 | rule could always fire, regardless of the value returned by `rate(error_count[5m])`. |
| 509 | |
| 510 | ### Fixed |
| 511 | |
| 512 | - `comparison` check will now ignore `absent(foo)` alert queries without any condition. |
| 513 | |
| 514 | ## v0.3.1 |
| 515 | |
| 516 | ### Added |
| 517 | |
| 518 | - `--offline` flag for `pint ci` command. |
| 519 | |
| 520 | ### Fixed |
| 521 | |
| 522 | - Fixed `template` check panic when alert query had a syntax error. |
| 523 | |
| 524 | ## v0.3.0 |
| 525 | |
| 526 | ### Added |
| 527 | |
| 528 | - `rule` block can now specify `ignore` conditions that have the same syntax as `match` |
| 529 | but will disable `rule` for matching alerting and recording rules #48. |
| 530 | - `match` and `ignore` blocks can now filter alerting and recording rules by name. |
| 531 | `record` will be used as name for recording rules and `alert` for alerting rules. |
| 532 | |
| 533 | ## v0.2.0 |
| 534 | |
| 535 | ### Added |
| 536 | |
| 537 | - `--offline` flag for `pint lint` command. When passed only checks that don't send |
| 538 | any live queries to Prometheus server will be run. |
| 539 | - `template` check will now warn if template if referencing a label that is being |
| 540 | stripped by aggregation. |
| 541 | Example: |
| 542 | |
| 543 | {% raw %} |
| 544 | ```yaml |
| 545 | - alert: Foo |
| 546 | expr: count(up) without(instance) == 0 |
| 547 | annotations: |
| 548 | summary: 'foo is down on {{ $labels.instance }}' |
| 549 | ``` |
| 550 | {% endraw %} |
| 551 | |
| 552 | Would generate a warning since `instance` label is being stripped by `without(instance)`. |
| 553 | |
| 554 | ## v0.1.5 |
| 555 | |
| 556 | ### Fixed |
| 557 | |
| 558 | - Fixed file descriptor leak due to missing file `Close()` #69. |
| 559 | |
| 560 | ## v0.1.4 |
| 561 | |
| 562 | ### Changed |
| 563 | |
| 564 | - Retry queries that error with `query processing would load too many samples into memory` |
| 565 | using a smaller time range. |
| 566 | |
| 567 | ## v0.1.3 |
| 568 | |
| 569 | ### Added |
| 570 | |
| 571 | - `vector_matching` check for finding queries with incorrect `on()` or `ignoring()` |
| 572 | keywords. |
| 573 | |
| 574 | ### Fixed |
| 575 | |
| 576 | - `comparison` check would trigger false positive for rules using `unless` keyword. |
| 577 | |
| 578 | ## v0.1.2 |
| 579 | |
| 580 | ### Fixed |
| 581 | |
| 582 | - `# pint skip/line` place between `# pint skip/begin` and `# pint skip/end` lines would |
| 583 | reset ignore rules causing lines that should be ignored to be parsed. |
| 584 | |
| 585 | ## v0.1.1 |
| 586 | |
| 587 | ### Changed |
| 588 | |
| 589 | - `value` check was replaced by `template`, which covers the same functionality and more. |
| 590 | See [docs](/docs/CONFIGURATION.md#template) for details. |
| 591 | |