Documentation
¶
Overview ¶
Package limits counts hits on Snellius's own size limits and logs them, rate-limited, so operators can spot capacity problems or abuse (D-100, D-112). A record names the limit and the install, never an object or a namespace.
Index ¶
Constants ¶
const Message = "size limit hit"
Message is the log line's message.
const Window = time.Minute
Window is the shortest time between two log lines for one limit and install.
Variables ¶
var All = []Limit{AuthzChecks, DelegationEdges, DelegationContexts, DelegationMatchers, DelegationDepth, DelegationRetained}
All lists every Limit: the counter's only label values.
Functions ¶
This section is empty.
Types ¶
type Limit ¶
type Limit string
Limit names one of Snellius's own size limits: the counter's label value.
const ( // AuthzChecks is the per-request cap on uncached permission checks (D-100). AuthzChecks Limit = "authz-checks" // DelegationEdges caps the selected delegation edges of an install (rules §5.7). DelegationEdges Limit = "delegation-edges" // DelegationContexts caps the delegation contexts computed for an install. DelegationContexts Limit = "delegation-contexts" // DelegationMatchers caps the matcher steps of an install's delegation traversal. DelegationMatchers Limit = "delegation-matchers" // DelegationDepth caps the routes on one delegation path. DelegationDepth Limit = "delegation-depth" // DelegationRetained caps the delegation contexts an install keeps for display. DelegationRetained Limit = "delegation-retained-contexts" )
The limits. The delegation ones are per install, hit while a model is built.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder counts every hit in snellius_limit_hits_total{limit} and logs at most one warning per limit and install per Window; an ended window's held-back hits are logged when a later line drops it. Safe for concurrent use.