zeekay e754dc03f2 fix(deps): correct moved-tag hashes for luxfi modules in go.sum
Several luxfi versions carry TWO different contents across this workspace,
because published tags were moved instead of a new patch being cut:
age@v1.5.0, pq@v1.0.3, threshold@v1.9.4, zap@v0.6.0, zap@v0.8.1.

Adjudicated before editing, since "checksum mismatch / SECURITY ERROR" is also
what a real supply-chain attack looks like. It is not one here: sum.golang.org
holds the OLD hash while proxy.golang.org and a direct fetch BOTH serve the same
NEW bytes. Two independent transports agreeing means nothing is rewriting
content in flight — the tag moved at source. The sumdb entry is a fossil:
GOPRIVATE covers github.com/luxfi/* with GOSUMDB=off, so our own modules never
consult the checksum DB and a moved tag splits consumers silently.

The old bytes are served by nothing now, so a stale pin can never build.
Corrected to the only content that exists, in BOTH line forms (h1: and
/go.mod h1:) — Go reports these one at a time, so a partial fix just relocates
the error.

Deliberately no `go mod tidy`: this changes no selected version, only the
recorded hash of versions already chosen.

Verified: `go list -m all` resolves with no checksum error.

The durable fix is upstream: never move a published tag, cut x.y.z+1 instead.
2026-07-26 02:48:00 -07:00
2026-02-13 16:09:16 -08:00
2026-02-13 16:09:16 -08:00
2025-09-24 09:55:53 +00:00
2026-06-28 20:55:47 -07:00

metric

Lux Metrics Library

github.com/luxfi/metric is the native metrics library for Lux. It produces a scrape-compatible text exposition format and is designed for low overhead in hot paths.

Features

  • Single, native API for counters, gauges, histograms, summaries, and vectors
  • Scrape-compatible text format encoder and HTTP handler
  • Registry + gatherer model for composition
  • Optional no-op build for benchmark runs (build-tagged swap)

Installation

go get github.com/luxfi/metric@latest

Quick Start

package main

import (
	"net/http"

	"github.com/luxfi/metric"
)

func main() {
	m := metric.New("myapp")

	requests := m.NewCounter("requests_total", "Total requests")
	latency := m.NewHistogram("request_seconds", "Request latency (s)", metric.DefBuckets)

	requests.Inc()
	latency.Observe(0.123)

	http.Handle("/metrics", metric.Handler())
	_ = http.ListenAndServe(":8080", nil)
}

Custom Registry

reg := metric.NewRegistry()
m := metric.NewWithRegistry("myapp", reg)

requests := m.NewCounter("requests_total", "Total requests")
requests.Inc()

handler := metric.NewHTTPHandler(reg, metric.HandlerOpts{})

Vector Metrics

m := metric.New("myapp")
byRoute := m.NewCounterVec("requests_total", "Requests by route", []string{"method", "route"})

byRoute.WithLabelValues("GET", "/").Inc()

Metrics Off Build

For benchmark runs, you can swap the entire package to no-op implementations using build tags. This keeps call sites unchanged while minimizing overhead.

go test -tags metrics ./...

When built without the metrics tag, metric.NewRegistry() and the package defaults return no-op implementations. Pre-bind label values in hot paths to avoid argument construction overhead.

S
Description
Prometheus metrics helpers: standard counters, gauges, histograms, and instrumentation conventions for all Lux components.
Readme BSD-3-Clause
810 KiB
Languages
Go 88.1%
HTML 10.8%
Makefile 1.1%