Name log fields, metrics and the Core Rule Set package for what they are (closes #192)
check / check (push) Failing after 5m32s
check / check (push) Failing after 5m32s
Log field, metric, action and event names now say what they count and, for timings, the unit. Package internal/waf is internal/coreruleset. Model: opus-5-5
This commit is contained in:
1 parent
aede434f6a
commit
9e6abf8496
58 files changed
+743
-691
No files matched your search
@@ -962,7 +962,7 @@ func TestStalledRemoteLogEndpointHoldsUpNoRequest(t *testing.T) {
|
||||
metrics := metricsText(t, url+"_sww/metrics", token)
|
||||
for _, series := range []string{
|
||||
`sww_remote_log_lines_sent_total{instance="fsn1app1/blog"} 0`,
|
||||
`sww_remote_log_buffer_depth{instance="fsn1app1/blog"} 1`,
|
||||
`sww_remote_log_lines_waiting{instance="fsn1app1/blog"} 1`,
|
||||
} {
|
||||
if !strings.Contains(metrics, "\n"+series+"\n") {
|
||||
t.Errorf("no %q in the metrics:\n%s", series, metrics)
|
||||
@@ -1068,8 +1068,12 @@ func TestBanIsAlertedAndAnAlertNotSentIsKeptAcrossARestart(t *testing.T) {
|
||||
metrics := metricsWith(t, url+"_sww/metrics", token,
|
||||
"\nsww_alerts_sent_total"+ofWebhook+" 1\n")
|
||||
|
||||
for _, series := range []string{"failed", "suppressed", "dropped"} {
|
||||
zero := "\nsww_alerts_" + series + "_total" + ofWebhook + " 0\n"
|
||||
for _, series := range []string{
|
||||
"sww_alert_send_failures_total",
|
||||
"sww_alerts_suppressed_total",
|
||||
"sww_alerts_dropped_total",
|
||||
} {
|
||||
zero := "\n" + series + ofWebhook + " 0\n"
|
||||
if !strings.Contains(metrics, zero) {
|
||||
t.Errorf("no %q in the metrics:\n%s", zero, metrics)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user