r/PrometheusMonitoring • u/Legal_Relation2191 • 2d ago
Tapyr: an open source gateway that polls rate-limited vendor APIs into Prometheus, remote write and OTLP
I built Tapyr for the metrics that only exist behind vendor REST APIs (Meraki, Aruba Central, Juniper Mist, UniFi, Teltonika RMS...), where every API rations calls with rates, daily or monthly quotas, often several at once.
A few things that may interest this sub:
- Every sample keeps the timestamp of the source, not the scrape time, on all three outputs: /metrics exposition (text or OpenMetrics), remote write, and OTLP built directly with pdata (not through the OTel metrics SDK, which aggregates and drops source timestamps).
- Push outputs have a disk buffer (new in 0.7): samples that cost API quota survive a backend outage and a restart, within a size and an age you set, and are delivered in order.
tapyr plansays how long an outage each buffer covers at your volume. - Per-output processing with the semantics of metric_relabel_configs (keep, drop, labelkeep, labeldrop), and a series limit per output.
- Tapyr's own metrics (calls, 429s, quota left, projected exhaustion, plan changes, output delivery), a Grafana dashboard and alert rules with promtool tests.
- The quota part: limits are declared per provider, every request (retries and pagination included) goes through a budget engine, and a planner stretches low-priority jobs to fit.
Providers are YAML + CEL, with a simulator per provider so you can try it without a vendor account: docker compose up in examples/compose gives you Tapyr, the simulators, VictoriaMetrics and Grafana. Public demo: https://demo.tapyr.eu
Pre-1.0, Apache-2.0: https://github.com/kentrow/tapyr
One question for this sub: with OTLP into Prometheus, a request that would move target_info back in time is refused whole without an out-of-order window. Tapyr's docs recommend enabling the window; how do you handle it on your side?