v8.5.29
Versioned cache: a compacted rule set, followed incrementally and shared through APCu
Every store instance used to load the whole rules stream with one XRANGE, and under
PHP-FPM every request is a fresh instance: at 1 147 rules in production that was
~110 KB and a parse per request, linear in the invalidation rate.
Rules now keeps the newest rule per tag (the all rules whole), and a refresh
fetches only what was appended since the last id it holds. SharedRules keeps the set
in APCu, keyed by the rules key and the connection, so a request adopts it instead of
loading the stream. One worker is elected with apcu_add to refresh a stale set while
the others keep it for the read; on an emptied APCu one worker loads and the others
wait briefly.
A process still sees its own invalidation at once, a wipe drops the shared set whatever
the wiping instance's option, a slower refresh never rolls the entry back, and exact
reads (rules_cache_ms 0) elect nobody.
New option rules_shared_cache, on where APCu is enabled. The Lua is unchanged, so
no FUNCTION reload is needed.
Tests: fourteen new cases through a probe that records every rules fetch, plus a
fresh-instance (FPM) benchmark scenario with a NoSharedRules twin on the versioned
benchmarks.
Console: the batch carries the deployment's tags
console.tags — a yml list, or one comma string such as !ENV CONSOLE[TAGS] — is
stamped on every event of the batch as the top-level tags list the console indexes
(a tenant, a region, a team; its TAGS column, one filter per tag). Trimmed, empties
dropped, at most ten; the console lowercases and validates each. Per-event tags keep
riding a capture's extra bag as tags, which the console unions with these.
Over OTLP the same list goes out as the resource attribute tags — OTEL has no tags
concept of its own, so this is the console's own attribute, beside service.version
and deployment.environment.name.
Docs
README.CACHE described the per-read walk over every unseen rule (O(1 + R)) that the
compacted rule set removed, and still spoke of a short-lived per-instance cache. Reads
are now O(T) against the newest rule per tag, the set is shared and refreshed
incrementally, the measured table is marked as predating the change, and the two new
FPM benchmark rows are named with their re-run noted as pending rather than filled in
with invented numbers.