Skip to content

Commit

Permalink
Purge expired cache on interval
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Aug 1, 2022
1 parent 5f3a990 commit 6b7c568
Show file tree
Hide file tree
Showing 50 changed files with 99 additions and 69 deletions.
2 changes: 0 additions & 2 deletions cmd/pint/tests/0001_match_path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=1
level=info msg="File parsed" path=rules/0002.yml rules=1
rules/0002.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
2 | expr: sum(foo) without(job)

Expand Down
3 changes: 0 additions & 3 deletions cmd/pint/tests/0003_lint_workdir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
level=info msg="File parsed" path=rules/0002.yaml rules=2
level=info msg="File parsed" path=rules/0003.yaml rules=12
rules/0001.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
2 | expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0004_fail_invalid_yaml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=error msg="Failed to parse file content" error="yaml: line 4: did not find expected key" lines=1-7 path=rules/bad.yaml
level=info msg="File parsed" path=rules/ok.yml rules=1
rules/bad.yaml:4: did not find expected key (yaml/parse)
4 |

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0005_false_positive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
-- rules/0001.yml --
- record: "colo:test1"
expr: topk(6, sum(rate(edgeworker_subrequest_errorCount{cordon="free"}[5m])) BY (zoneId,job))
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0006_rr_labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
rules/0001.yml:8: incomplete rule, no alert or record key (yaml/parse)
8 | - expr: sum(foo)

Expand Down
2 changes: 0 additions & 2 deletions cmd/pint/tests/0007_alerts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=5
level=info msg="File parsed" path=rules/0002.yml rules=1
rules/0001.yml:1-2: url annotation is required (alerts/annotation)
1 | - alert: Always
2 | expr: up
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0008_recording_rule_prometheus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=1
rules/0001.yml:5: instance label should be removed when aggregating "^colo(?:_.+)?:.+$" rules, remove instance from by() (promql/aggregate)
5 | expr: sum by (instance) (http_inprogress_requests)

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0009_alerting_rule_prometheus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
rules/0001.yml:11-13: link annotation is required (alerts/annotation)
11 | annotations:
12 | summary: "Instance {{ $labels.instance }} down"
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0011_ignore_rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yaml rules=10
rules/1.yaml:5: syntax error: unexpected right parenthesis ')' (promql/syntax)
5 | expr: sum(errors_total) by )

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0012_issue_20.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yaml rules=1
level=warn msg="Tried to read more lines than present in the source file, this is likely due to '\n' usage in some rules, see https://github.com/cloudflare/pint/issues/20 for details" path=rules/1.yaml
rules/1.yaml:9-13: runbook_url annotation is required (alerts/annotation)
9 | annotations:
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0014_issue49_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yaml rules=1
-- rules/0001.yaml --
- record: down
expr: up == 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0018_match_alerting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="Found recording rule" lines=1-2 path=rules/0001.yml record=colo:recording
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp"] path=rules/0001.yml rule=colo:recording
level=debug msg="Found alerting rule" alert=colo:alerting lines=4-5 path=rules/0001.yml
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0019_match_recording.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="Found recording rule" lines=1-2 path=rules/0001.yml record=colo:recording
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:recording
level=debug msg="Found alerting rule" alert=colo:alerting lines=4-5 path=rules/0001.yml
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0020_ignore_kind.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="Found recording rule" lines=4-5 path=rules/0001.yml record=colo:recording
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:recording
level=debug msg="Found alerting rule" alert=colo:alerting lines=7-8 path=rules/0001.yml
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0022_ignore_multi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yaml rules=3
rules/1.yaml:2: dropped label should be removed when aggregating "^.+$" rules, remove dropped from by() (promql/aggregate)
2 | expr: sum(errors_total) by(keep,dropped)

Expand Down
3 changes: 0 additions & 3 deletions cmd/pint/tests/0024_color_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
level=info msg="File parsed" path=rules/0002.yaml rules=1
level=info msg="File parsed" path=rules/0003.yaml rules=10
rules/0001.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
2 | expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0027_ci_branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cmp stderr ../stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules.yml rules=2
level=info msg="Problems found" Fatal=1
rules.yml:2: syntax error: unexpected identifier "bi" (promql/syntax)
2 | expr: sum(foo) bi(job)
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0037_disable_checks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
rules/0001.yml:6: job label is required and should be preserved when aggregating "^.+$" rules, use by(job, ...) (promql/aggregate)
6 | expr: sum(foo)

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0038_disable_checks_regex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
rules/0001.yml:6: job label is required and should be preserved when aggregating "^.+$" rules, use by(job, ...) (promql/aggregate)
6 | expr: sum(foo)

Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0039_prom_selected_path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
level=debug msg="File parsed" path=rules/0001.yml rules=3
level=debug msg="Starting query workers" name=disabled uri=http://127.0.0.1:123 workers=16
level=debug msg="Found alerting rule" alert=first lines=1-3 path=rules/0001.yml
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp"] path=rules/0001.yml rule=first
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0040_rule_match_label.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/rules.yml rules=4
level=debug msg="File parsed" path=rules/rules.yml rules=4
level=debug msg="Found recording rule" lines=1-2 path=rules/rules.yml record=ignore
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp"] path=rules/rules.yml rule=ignore
level=debug msg="Found recording rule" lines=4-7 path=rules/rules.yml record=match
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0052_match_multiple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="Found recording rule" lines=4-5 path=rules/0001.yml record=colo:recording
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:recording
level=debug msg="Found alerting rule" alert=colo:alerting lines=7-8 path=rules/0001.yml
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0053_ignore_multiple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="File parsed" path=rules/0001.yml rules=2
level=debug msg="Found recording rule" lines=4-5 path=rules/0001.yml record=colo:recording
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp"] path=rules/0001.yml rule=colo:recording
level=debug msg="Found alerting rule" alert=colo:alerting lines=7-8 path=rules/0001.yml
Expand Down
8 changes: 8 additions & 0 deletions cmd/pint/tests/0054_watch_metrics_prometheus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ pint_problem{filename="rules/2.yml",kind="alerting",name="comparison",owner="bob
# HELP pint_problems Total number of problems reported by pint
# TYPE pint_problems gauge
pint_problems
# HELP pint_prometheus_cache_miss_total Total number of all prometheus queries resulting in a cache miss
# TYPE pint_prometheus_cache_miss_total counter
pint_prometheus_cache_miss_total{endpoint="/api/v1/query",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/query",name="prom2"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/config",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/config",name="prom2"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/flags",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/flags",name="prom2"}
# HELP pint_prometheus_queries_running Total number of in-flight prometheus queries
# TYPE pint_prometheus_queries_running gauge
pint_prometheus_queries_running{endpoint="/api/v1/query",name="prom1"}
Expand Down
8 changes: 8 additions & 0 deletions cmd/pint/tests/0057_watch_metrics_prometheus_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ pint_problem{filename="rules/1.yml",kind="recording",name="broken",owner="",prob
# HELP pint_problems Total number of problems reported by pint
# TYPE pint_problems gauge
pint_problems
# HELP pint_prometheus_cache_miss_total Total number of all prometheus queries resulting in a cache miss
# TYPE pint_prometheus_cache_miss_total counter
pint_prometheus_cache_miss_total{endpoint="/api/v1/query",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/query",name="prom2"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/config",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/config",name="prom2"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/flags",name="prom1"}
pint_prometheus_cache_miss_total{endpoint="/api/v1/status/flags",name="prom2"}
# HELP pint_prometheus_queries_running Total number of in-flight prometheus queries
# TYPE pint_prometheus_queries_running gauge
pint_prometheus_queries_running{endpoint="/api/v1/query",name="prom1"}
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0058_templated_check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/0001.yml rules=3
rules/0001.yml:4-6: alert_for annotation is required (alerts/annotation)
4 | - alert: Instance Is Down 2
5 | expr: up == 0
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0060_ci_noop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cmp stderr ../stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=b.yml rules=1
level=info msg="Problems found" Fatal=1
b.yml:2: syntax error: unexpected identifier "bi" (promql/syntax)
2 | expr: sum(foo) bi()
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0063_lint_offline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/ok.yml rules=1
-- rules/ok.yml --
- record: sum:foo
expr: sum(foo)
Expand Down
3 changes: 0 additions & 3 deletions cmd/pint/tests/0066_lint_owner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yml rules=3
level=info msg="File parsed" path=rules/2.yml rules=1
level=info msg="File parsed" path=rules/3.yml rules=1
rules/1.yml:4-5: rule/owner comments are required in all files, please add a "# pint file/owner $owner" somewhere in this file and/or "# pint rule/owner $owner" on top of each rule (rule/owner)
4 | - alert: No Owner
5 | expr: up > 0
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0067_relaxed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/relaxed.yml rules=1
level=error msg="Failed to unmarshal file content" error="yaml: unmarshal errors:\n line 2: cannot unmarshal !!seq into rulefmt.RuleGroups" lines=1-4 path=rules/strict.yml
rules/strict.yml:2: cannot unmarshal !!seq into rulefmt.RuleGroups (yaml/parse)
2 | - alert: No Owner
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0073_lint_k8s.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cmp stderr stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yml rules=4
rules/1.yml:22-23: summary annotation is required (alerts/annotation)
22 | - alert: Example_High_Restart_Rate
23 | expr: sum(rate(kube_pod_container_status_restarts_total{namespace="example-app"}[5m])) > ( 3/60 )
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0080_lint_online.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exec bash -c 'cat prometheus.pid | xargs kill'

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yml rules=1
rules/1.yml:2: http_errors_total[2d] selector is trying to query Prometheus for 2d worth of metrics, but prometheus "prom1" at http://127.0.0.1:7080 is configured to only keep 1d of metrics history (promql/range_query)
2 | expr: rate(http_errors_total[2d]) > 0

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0081_rulefmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.error --no-color lint rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/strict.yml rules=1
rules/strict.yml:4: missing expr key (yaml/parse)
4 | - record: foo

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0086_rulefmt_ignored_errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.error --no-color lint rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/strict.yml rules=5
rules/strict.yml:4: incomplete rule, no alert or record key (yaml/parse)
4 | - expr: MissingAlertOrRecord

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0087_dedup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.error --no-color lint rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/01.yml rules=1
rules/01.yml:5: alert query doesn't have any condition, it will always fire if the metric exists (alerts/comparison)
5 | expr: sum(up{job="bar"}) / sum(foo) / sum(bar)

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0088_rule_link.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exec bash -c 'cat webserver.pid | xargs kill'

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=info msg="File parsed" path=rules/1.yml rules=1
rules/1.yml:10: GET request for http://127.0.0.1:7088/404 returned invalid status code: 404 Not Found (rule/link)
10 | r404: http://127.0.0.1:7088/404

Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0089_lint_min_severity_bug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.ok --no-color lint --min-severity=bug rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/0001.yml rules=1
-- rules/0001.yml --
groups:
- name: foo
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0090_lint_min_severity_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.ok --no-color lint --min-severity=info rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/0001.yml rules=1
rules/0001.yml:5-7: using the value of rate(errors[2m]) inside this annotation might be hard to read, consider using one of humanize template functions to make it more human friendly (alerts/template)
5 | expr: rate(errors[2m]) > 0
.
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/tests/0091_lint_min_severity_invalid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pint.error --no-color lint --min-severity=xxx rules
cmp stderr stderr.txt

-- stderr.txt --
level=info msg="File parsed" path=rules/0001.yml rules=1
level=fatal msg="Fatal error" error="invalid min-severity value: unknown severity: xxx"
-- rules/0001.yml --
groups:
Expand Down
3 changes: 3 additions & 0 deletions cmd/pint/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func startTimer(ctx context.Context, cfg config.Config, workers int, interval ti
log.Error().Err(err).Msg("Got an error when running checks")
}
checkIterationsTotal.Inc()
for _, prom := range cfg.PrometheusServers {
prom.CleanCache()
}
case <-stop:
ticker.Stop()
log.Info().Msg("Background worker finished")
Expand Down
14 changes: 14 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## v0.28.4

### Added

- Added `pint_prometheus_cache_miss_total` metric.

### Changed

- Reduce log level for `File parsed` messages.

### Fixed

- Purge expired cache entries faster to reduce memory usage.

## v0.28.3

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion internal/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func readFile(path string, isStrict bool) (entries []Entry, err error) {
})
}

log.Info().Str("path", path).Int("rules", len(entries)).Msg("File parsed")
log.Debug().Str("path", path).Int("rules", len(entries)).Msg("File parsed")
return entries, nil
}

Expand Down
Loading

0 comments on commit 6b7c568

Please sign in to comment.