mirror of
https://github.com/hanzoai/livekit.git
synced 2026-10-30 18:29:34 +00:00
This repo did not compile, and had not before any of the KV work: at the commit prior to it, `go build ./...` failed identically in pkg/telemetry/prometheus. That failure masked every package downstream of it, which is why the KV rename could only be type-checked in isolation. The telemetry code was written against an older luxfi/metric API: metric.CounterVec/HistogramVec/GaugeVec are INTERFACES, but 28 declarations said *metric.X — a pointer to an interface, which nothing satisfies. metric.MustRegister does not exist, and is not needed: NewHistogramVec and friends already register into DefaultRegistry at construction. 36 calls removed. metric.ExponentialBucketsRange does not exist; the bucket helper comes from prometheus/client_golang. rpc.InitPSRPCStats / webhook.InitWebhookStats come from livekit/protocol and take prometheus.Labels, not metric.Labels. Those two call sites now pass the type the upstream signature actually declares. metric.DefaultGatherer does not exist. Replaced with metric.DefaultRegistry, which satisfies Gatherer (Registry embeds it). NOT metric.Handler() — that wraps a FRESH NewRegistry(), so the endpoint would have served zero metrics while looking healthy. `go build ./...` and `go vet ./pkg/...` now pass.