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