Skip to content

Commit de0dc90

Browse files
committed
Dynamically generate the list of Prometheus servers
1 parent be61d26 commit de0dc90

File tree

118 files changed

+2530
-5102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2530
-5102
lines changed

.github/spellcheck/wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cloudflare
99
Cloudflare
1010
config
1111
Deduplicate
12+
deduplicated
1213
dir
1314
durations
1415
endraw

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test:
4343
-coverprofile=$(COVER_PROFILE) \
4444
-coverpkg=./... \
4545
-race \
46-
-count=5 \
46+
-count=3 \
4747
-timeout=15m \
4848
./...
4949

cmd/pint/ci.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,17 @@ func actionCI(c *cli.Context) error {
100100
return err
101101
}
102102

103-
for _, prom := range meta.cfg.PrometheusServers {
104-
prom.StartWorkers()
105-
}
106-
defer meta.cleanup()
107-
108103
ctx := context.WithValue(context.Background(), config.CommandKey, config.CICommand)
109-
summary := checkRules(ctx, meta.workers, meta.cfg, entries)
104+
105+
gen := config.NewPrometheusGenerator(meta.cfg, metricsRegistry)
106+
defer gen.Stop()
107+
108+
slog.Debug("Generated all Prometheus servers", slog.Int("count", gen.Count()))
109+
110+
summary, err := checkRules(ctx, meta.workers, gen, meta.cfg, entries)
111+
if err != nil {
112+
return err
113+
}
110114

111115
if c.Bool(requireOwnerFlag) {
112116
summary.Report(verifyOwners(entries, meta.cfg.Owners.CompileAllowed())...)

cmd/pint/lint.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ func actionLint(c *cli.Context) error {
6060
return err
6161
}
6262

63-
for _, prom := range meta.cfg.PrometheusServers {
64-
prom.StartWorkers()
65-
}
66-
defer meta.cleanup()
67-
6863
ctx := context.WithValue(context.Background(), config.CommandKey, config.LintCommand)
69-
summary := checkRules(ctx, meta.workers, meta.cfg, entries)
64+
65+
gen := config.NewPrometheusGenerator(meta.cfg, metricsRegistry)
66+
defer gen.Stop()
67+
68+
summary, err := checkRules(ctx, meta.workers, gen, meta.cfg, entries)
69+
if err != nil {
70+
return err
71+
}
7072

7173
if c.Bool(requireOwnerFlag) {
7274
summary.Report(verifyOwners(entries, meta.cfg.Owners.CompileAllowed())...)

cmd/pint/main.go

-6
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ type actionMeta struct {
8282
workers int
8383
}
8484

85-
func (meta actionMeta) cleanup() {
86-
for _, prom := range meta.cfg.PrometheusServers {
87-
prom.Close()
88-
}
89-
}
90-
9185
func actionSetup(c *cli.Context) (meta actionMeta, err error) {
9286
err = initLogger(c.String(logLevelFlag), c.Bool(noColorFlag))
9387
if err != nil {

cmd/pint/main_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ func tlsCert(ts *testscript.TestScript, _ bool, args []string) {
297297
StreetAddress: []string{""},
298298
PostalCode: []string{""},
299299
},
300+
DNSNames: []string{name},
300301
IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback},
301302
NotBefore: time.Now(),
302303
NotAfter: time.Now().AddDate(0, 0, 1),

cmd/pint/metrics.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package main
33
import "github.com/prometheus/client_golang/prometheus"
44

55
var (
6+
metricsRegistry = prometheus.NewRegistry()
7+
68
pintVersion = prometheus.NewGaugeVec(
79
prometheus.GaugeOpts{
810
Name: "pint_version",

cmd/pint/scan.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ func tryDecodingYamlError(err error) (l int, s string) {
5454
return 1, s
5555
}
5656

57-
func checkRules(ctx context.Context, workers int, cfg config.Config, entries []discovery.Entry) (summary reporter.Summary) {
57+
func checkRules(ctx context.Context, workers int, gen *config.PrometheusGenerator, cfg config.Config, entries []discovery.Entry) (summary reporter.Summary, err error) {
58+
if len(entries) > 0 {
59+
if err = gen.Generate(ctx); err != nil {
60+
return summary, err
61+
}
62+
slog.Debug("Generated all Prometheus servers", slog.Int("count", gen.Count()))
63+
} else {
64+
slog.Info("No rules found, skipping Prometheus discovery")
65+
}
66+
5867
checkIterationChecks.Set(0)
5968
checkIterationChecksDone.Set(0)
6069

@@ -108,7 +117,7 @@ func checkRules(ctx context.Context, workers int, cfg config.Config, entries []d
108117
)
109118
}
110119

111-
checkList := cfg.GetChecksForRule(ctx, entry.SourcePath, entry.Rule, entry.DisabledChecks)
120+
checkList := cfg.GetChecksForRule(ctx, gen, entry.SourcePath, entry.Rule, entry.DisabledChecks)
112121
for _, check := range checkList {
113122
checkIterationChecks.Inc()
114123
check := check
@@ -143,7 +152,7 @@ func checkRules(ctx context.Context, workers int, cfg config.Config, entries []d
143152

144153
lastRunTime.SetToCurrentTime()
145154

146-
return summary
155+
return summary, nil
147156
}
148157

149158
type scanJob struct {

cmd/pint/tests/0001_match_path.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0002.yml:2 Bug: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
89
2 | expr: sum(foo) without(job)
910

cmd/pint/tests/0002_nothing_to_lint.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pint.error --no-color lint rules
44
cmp stderr stderr.txt
55

66
-- stderr.txt --
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=ERROR msg="Fatal error" err="no matching files"

cmd/pint/tests/0003_lint_workdir.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cmp stderr stderr.txt
55

66
-- stderr.txt --
77
level=INFO msg="Loading configuration file" path=.pint.hcl
8+
level=INFO msg="Finding all rules to check" paths=["rules"]
89
rules/0001.yml:2 Warning: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
910
2 | expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)
1011

cmd/pint/tests/0004_fail_invalid_yaml.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=ERROR msg="Failed to parse file content" err="yaml: line 4: did not find expected key" path=rules/bad.yaml lines=1-7
89
rules/bad.yaml:4 Fatal: did not find expected key (yaml/parse)
910
4 |

cmd/pint/tests/0005_false_positive.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
-- rules/0001.yml --
89
- record: "colo:test1"
910
expr: topk(6, sum(rate(edgeworker_subrequest_errorCount{cordon="free"}[5m])) BY (zoneId,job))

cmd/pint/tests/0006_rr_labels.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0001.yml:8 Fatal: incomplete rule, no alert or record key (yaml/parse)
89
8 | - expr: sum(foo)
910

cmd/pint/tests/0007_alerts.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0001.yml:1-2 Bug: url annotation is required (alerts/annotation)
89
1 | - alert: Always
910
2 | expr: up

cmd/pint/tests/0008_recording_rule_prometheus.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0001.yml:5 Bug: instance label should be removed when aggregating "^colo(?:_.+)?:.+$" rules, remove instance from by() (promql/aggregate)
89
5 | expr: sum by (instance) (http_inprogress_requests)
910

cmd/pint/tests/0009_alerting_rule_prometheus.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0001.yml:11-13 Bug: link annotation is required (alerts/annotation)
89
11 | annotations:
910
12 | summary: "Instance {{ $labels.instance }} down"

cmd/pint/tests/0010_syntax_check.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=ERROR msg="Failed to parse file content" err="yaml: line 6: did not find expected '-' indicator" path=rules/1.yaml lines=1-12
89
rules/1.yaml:6 Fatal: did not find expected '-' indicator (yaml/parse)
910
6 |

cmd/pint/tests/0011_ignore_rules.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/1.yaml:5 Fatal: syntax error: unexpected right parenthesis ')' (promql/syntax)
89
5 | expr: sum(errors_total) by )
910

cmd/pint/tests/0012_issue_20.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=WARN msg="Tried to read more lines than present in the source file, this is likely due to '
89
' usage in some rules, see https://github.com/cloudflare/pint/issues/20 for details" path=rules/1.yaml
910
rules/1.yaml:9-13 Warning: runbook_url annotation is required (alerts/annotation)

cmd/pint/tests/0014_issue49_2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
-- rules/0001.yaml --
89
- record: down
910
expr: up == 0

cmd/pint/tests/0018_match_alerting.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=2
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=1-2
911
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
1012
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=4-5

cmd/pint/tests/0019_match_recording.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=2
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=1-2
911
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
1012
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=4-5

cmd/pint/tests/0020_ignore_kind.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=2
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=4-5
911
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
1012
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=7-8

cmd/pint/tests/0022_ignore_multi.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/1.yaml:2 Warning: dropped label should be removed when aggregating "^.+$" rules, remove dropped from by() (promql/aggregate)
89
2 | expr: sum(errors_total) by(keep,dropped)
910

cmd/pint/tests/0024_color_output.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cmp stderr stderr.txt
55

66
-- stderr.txt --
77
level=INFO msg="Loading configuration file" path=.pint.hcl
8+
level=INFO msg="Finding all rules to check" paths=["rules"]
89
rules/0001.yml:2 Warning: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate)
910
2 | expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)
1011

cmd/pint/tests/0027_ci_branch.txt

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cmp stderr ../stderr.txt
2121

2222
-- stderr.txt --
2323
level=INFO msg="Loading configuration file" path=.pint.hcl
24+
level=INFO msg="Finding all rules to check on current git branch using git blame" base=main
2425
level=INFO msg="Problems found" Fatal=1
2526
rules.yml:2 Fatal: syntax error: unexpected identifier "bi" (promql/syntax)
2627
2 | expr: sum(foo) bi(job)

cmd/pint/tests/0028_ci_git_error.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ cmp stderr ../stderr.txt
2323
level=INFO msg="Loading configuration file" path=.pint.hcl
2424
level=DEBUG msg="Running git command" args=["rev-parse","--abbrev-ref","HEAD"]
2525
level=DEBUG msg="Got branch information" base=notmain current=v2
26+
level=INFO msg="Finding all rules to check on current git branch using git blame" base=notmain
2627
level=DEBUG msg="Running git command" args=["log","--format=%H","--no-abbrev-commit","--reverse","notmain..HEAD"]
27-
level=ERROR msg="Fatal error" err="failed to get the list of commits to scan: fatal: ambiguous argument 'notmain..HEAD': unknown revision or path not in the working tree.
28-
Use '--' to separate paths from revisions, like this:
29-
'git <command> [<revision>...] -- [<file>...]'
30-
"
28+
level=ERROR msg="Fatal error" err="failed to get the list of commits to scan: fatal: ambiguous argument 'notmain..HEAD': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n"
3129
-- src/v1.yml --
3230
- record: rule1
3331
expr: sum(foo) by(job)

cmd/pint/tests/0029_ci_too_many_commits.txt

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cmp stderr ../stderr.txt
2828

2929
-- stderr.txt --
3030
level=INFO msg="Loading configuration file" path=.pint.hcl
31+
level=INFO msg="Finding all rules to check on current git branch using git blame" base=main
3132
level=ERROR msg="Fatal error" err="number of commits to check (3) is higher than maxCommits (2), exiting"
3233
-- src/v1.yml --
3334
- record: rule1

cmd/pint/tests/0037_disable_checks.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=3
8-
level=DEBUG msg="Starting query workers" name=prom uri=http://127.0.0.1 workers=16
9+
level=INFO msg="Configured new Prometheus server" name=prom uris=1
10+
level=DEBUG msg="Generated all Prometheus servers" count=1
911
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=default-for lines=1-3
12+
level=DEBUG msg="Starting query workers" name=prom uri=http://127.0.0.1 workers=16
1013
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/template","promql/fragile","promql/regexp","promql/vector_matching(prom)","rule/duplicate(prom)","labels/conflict(prom)"] path=rules/0001.yml rule=default-for
1114
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=sum-job lines=5-6
1215
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/template","promql/fragile","promql/regexp","promql/vector_matching(prom)","rule/duplicate(prom)","labels/conflict(prom)","promql/aggregate(job:true)"] path=rules/0001.yml rule=sum-job

cmd/pint/tests/0038_disable_checks_regex.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
rules/0001.yml:6 Warning: job label is required and should be preserved when aggregating "^.+$" rules, use by(job, ...) (promql/aggregate)
89
6 | expr: sum(foo)
910

cmd/pint/tests/0039_prom_selected_path.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=3
8-
level=DEBUG msg="Starting query workers" name=disabled uri=http://127.0.0.1:123 workers=16
9+
level=INFO msg="Configured new Prometheus server" name=disabled uris=1
10+
level=DEBUG msg="Generated all Prometheus servers" count=1
911
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=first lines=1-3
1012
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
1113
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=second lines=5-6
@@ -16,7 +18,6 @@ rules/0001.yml:6 Warning: job label is required and should be preserved when agg
1618
6 | expr: sum(bar)
1719

1820
level=INFO msg="Problems found" Warning=1
19-
level=DEBUG msg="Stopping query workers" name=disabled uri=http://127.0.0.1:123
2021
-- rules/0001.yml --
2122
- alert: first
2223
expr: foo > 1

cmd/pint/tests/0040_rule_match_label.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/rules.yml rules=4
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/rules.yml record=ignore lines=1-2
911
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
1012
level=DEBUG msg="Found recording rule" path=rules/rules.yml record=match lines=4-7

cmd/pint/tests/0042_watch_metrics.txt

-14
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,3 @@ pint_rules_parsed_total{kind="recording"}
178178
# HELP pint_version Version information
179179
# TYPE pint_version gauge
180180
pint_version{version="unknown"}
181-
# HELP prometheus_template_text_expansion_failures_total The total number of template text expansion failures.
182-
# TYPE prometheus_template_text_expansion_failures_total counter
183-
prometheus_template_text_expansion_failures_total
184-
# HELP prometheus_template_text_expansions_total The total number of template text expansions.
185-
# TYPE prometheus_template_text_expansions_total counter
186-
prometheus_template_text_expansions_total
187-
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
188-
# TYPE promhttp_metric_handler_requests_in_flight gauge
189-
promhttp_metric_handler_requests_in_flight
190-
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
191-
# TYPE promhttp_metric_handler_requests_total counter
192-
promhttp_metric_handler_requests_total{code="200"}
193-
promhttp_metric_handler_requests_total{code="500"}
194-
promhttp_metric_handler_requests_total{code="503"}

cmd/pint/tests/0052_match_multiple.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=2
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=4-5
911
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
1012
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=7-8

cmd/pint/tests/0053_ignore_multiple.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ cmp stderr stderr.txt
44

55
-- stderr.txt --
66
level=INFO msg="Loading configuration file" path=.pint.hcl
7+
level=INFO msg="Finding all rules to check" paths=["rules"]
78
level=DEBUG msg="File parsed" path=rules/0001.yml rules=2
9+
level=DEBUG msg="Generated all Prometheus servers" count=0
810
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=4-5
911
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
1012
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=7-8

0 commit comments

Comments
 (0)