mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-10-14 05:18:54 +00:00
Add exerciseLatencyMetrics, proving the new upstream-latency histograms render correctly under the real Yaegi interpreter, not merely that a compiled go test accepts the same bytes. Compiled tests have repeatedly passed on this codebase while the interpreted shape failed, which is exactly what this probe caught: two bugs in the core feature commit, found and fixed only because this harness exists. Parse the rendered body with prometheus/common/expfmt's real TextParser, the same library a real Prometheus server's scrape loop uses, instead of this project's own hand-rolled parser. A malformed histogram fails to parse outright under a real parser, matching the failure mode a live scrape target actually hits, rather than merely failing one hand-written assertion. No new traffic is driven here: the existing exerciseAttemptAccounting sub-probe already posts one real, non-streaming chat completion against the openai provider, so the duration histogram already carries a real observation by the time this probe runs. Add github.com/prometheus/common/expfmt as a dependency of this harness module only, isolated from the plugin's own stdlib-only go.mod by design (this package's own doc comment). Go raised this module's go directive from 1.22 to 1.25.0 to satisfy the new dependency; the plugin module itself is untouched.
13 lines
322 B
AMPL
13 lines
322 B
AMPL
module llmgw-yaegi-check
|
|
|
|
go 1.25.0
|
|
|
|
require github.com/traefik/yaegi v0.16.1
|
|
|
|
require (
|
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
|
github.com/prometheus/client_model v0.6.2 // indirect
|
|
github.com/prometheus/common v0.70.1 // indirect
|
|
google.golang.org/protobuf v1.36.11 // indirect
|
|
)
|