Files
lukaszraczylo 935df1a3f0 docs(metrics): add README section, testData, and a scrape example
The metrics feature shipped in code only: no README section, no
metrics block in .traefik.yml testData, nothing under examples/. The
Go doc comments were the entire manual for a human operator or a
config-generating assistant.

Add a README Metrics section covering the served path, both auth
modes (admin bearer token, optional CIDR allowlist), the CIDR-sizing
warning with the live-reproduced SNAT failure mode, the modelLabel
cardinality trade-off, the exposed metric families, the cross-replica
aggregation contract, label escaping, and store-outage behaviour. Add
a MetricsConfig reference table matching the existing AdminConfig
one, and a metrics row in the top-level Config table.

Add metrics: {enabled: true} to .traefik.yml's testData, the
catalog-facing smoke-test config, deliberately without allowedCIDRs
so a copy-pasted example never skips the README's own sizing
guidance.

Add a metrics block to the Kubernetes Middleware example and a
VMServiceScrape resource: the target cluster runs VictoriaMetrics, not
Prometheus, so the CRD differs even though the exposition format does
not. Verified the VMServiceScrape shape (apiVersion, selector,
endpoints, path) against the victoriametrics/operator documentation
rather than assuming it. Notes that /metrics is served by Traefik
itself, not by any backend service, since this middleware intercepts
the path before a backend is ever reached.
2026-08-23 00:59:13 +01:00

38 lines
1.5 KiB
YAML

displayName: LLM Gateway
type: middleware
import: github.com/lukaszraczylo/traefik-llmgateway
# basePkg: Traefik's Yaegi middleware loader (pkg/plugins/middlewareyaegi.go,
# newYaegiMiddlewareBuilder) binds the interpreted package under
# strings.ReplaceAll(path.Base(import), "-", "_") — "traefik_llmgateway" —
# unless this field overrides it. The package itself declares
# `package traefikllmgateway` (no underscore), so without this override a
# real Traefik instance fails plugin load with
# `failed to eval New: ...: undefined: traefik_llmgateway`, discovered
# running the plugin in real Traefik v3.5 for the first time (Task 15's
# integration suite). Required for both Traefik itself and the Plugin
# Catalog analyzer (piceus), which uses this identical mechanism.
basePkg: traefikllmgateway
summary: Multi-provider LLM gateway with groups, per-user keys, token/cost limits, MCP/A2A proxy.
testData:
providers:
openai:
type: openai
apiKey: test-key
models:
- gpt-test
groups:
default:
providers: []
users:
inline:
- name: tester
group: default
apiKey: test-user-key
# Prometheus text-exposition endpoint — see README.md#metrics. No
# allowedCIDRs here deliberately: this is the catalog-facing smoke-test
# config, and README.md#metrics has the full CIDR-sizing guidance
# (narrowest block only, never a whole RFC1918 range) that a
# copy-pasted example here would risk skipping past.
metrics:
enabled: true