Small Go packages shared by a handful of exporters and probes: metrics plumbing,
caches, HTTP and WebSocket clients, and a few helpers. Each package stands alone;
import only what you need.
Prometheus plumbing: collector/vec constructors, turning collected metrics into a remote-write request (BuildWriteRequest), batched remote write with retry and backoff (BatchRemoteWriteWithRetry) and with resumable progress (BatchRemoteWriteProgress), plus a small query client (/api/v1/query, query_range, export, label values).
Counts observations from a partitioned log (e.g. Kafka) in windows of their own event time and remote-writes each window stamped with that time, instead of the export time. A per-partition watermark decides when a window is first written; later arrivals re-write it at the same timestamp, and a published watermark tells a reader how far the windows are complete. Counter, distinct-count and histogram families. With Config.Lineage, it also writes what a reader needs to prove a window final from storage alone: terminal and claim records per writer, a write gate held until the log names the writer, and books that balance (see lineage.go). See the package doc.
Memory limit and usage from cgroups (v1 and v2, with a root fallback), heap dumps, and a watchdog that dumps and uploads a heap profile past a usage threshold.
A byte-size-bounded least-recently-used cache with optional expiry and an eviction callback, and ShardedCache, which splits it so concurrent writers do not serialise on one lock.
A bounded stack, and a binary tree with slice conversions.
Testing
go test -race ./...
eventtime checks its own sources for leftovers a private codebase leaves in
comments (dates, issue numbers, addresses). A second check reads a list of words
that must not appear from the file named by TOOLKITS_PRIVATE_WORDS, kept outside
the repository; without it that check is skipped.