mirror of
https://github.com/luxfi/monitoring.git
synced 2026-10-30 15:24:48 +00:00
The validator-health exporter and the rpc-tip-gate were both stdlib-only
Python scripts living in ConfigMaps on a stock python image. That choice
bought one thing — no build step — and it cost the backend standard: the
serving side of this stack is Go, and these two are serving processes.
internal/luxd — what one node says it believes (tip, finalized, peers,
bootstrapped, health-with-check-names). /v1 only.
internal/kube — the four apiserver calls fleet health makes. Not
client-go: a scheme, a codec and an informer machinery
to unmarshal four fields is not a dependency, it is a
liability.
internal/fleet — what the numbers MEAN, separated from the process that
serves them, so a metric's meaning can be tested
without a cluster.
Proven, not asserted. Both implementations were pointed at one fake
cluster and diffed:
exporter : 234 lines, 22 metric families — byte-for-byte identical.
tip-gate : same 5 decisions, same 3 merge-patches, byte-for-byte.
The differential earned its keep: the gate had been ported to
eth_getBlockByNumber when the deployed one calls eth_blockNumber. Same
answer today, a different call tomorrow. Fixed to match.
Two deliberate improvements over the Python, neither a scrape-visible
change: exposition series are sorted (Python's thread-completion order
made two scrapes of a steady fleet textually different), and the gate
refuses to start on a missing setting rather than defaulting quietly.
Co-authored-by: Hanzo Dev <[email protected]>
18 lines
758 B
Docker
18 lines
758 B
Docker
# One image, two fleet daemons. They share the luxd client and the apiserver
|
|
# client, so they share a build; they are separate binaries because observing
|
|
# the fleet and actuating on it are separate jobs that fail separately.
|
|
FROM golang:1.24-alpine AS build
|
|
WORKDIR /src
|
|
COPY go.mod ./
|
|
COPY internal ./internal
|
|
COPY cmd ./cmd
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/validator-exporter ./cmd/validator-exporter \
|
|
&& CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/rpc-tip-gate ./cmd/rpc-tip-gate
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/validator-exporter /validator-exporter
|
|
COPY --from=build /out/rpc-tip-gate /rpc-tip-gate
|
|
USER 65532:65532
|
|
EXPOSE 9101
|
|
ENTRYPOINT ["/validator-exporter"]
|