<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Tapyr blog</title>
  <subtitle>Posts about Tapyr, the open source gateway that turns the APIs of cloud-managed network gear into Prometheus and OTLP metrics within their rate limits.</subtitle>
  <link rel="self" href="https://tapyr.eu/blog/feed.xml"/>
  <link href="https://tapyr.eu/blog/"/>
  <id>https://tapyr.eu/blog/</id>
  <updated>2026-11-25T15:00:00+01:00</updated>
  <author><name>Kentrow</name><uri>https://kentrow.fr</uri></author>
  <entry>
    <title>Introducing Tapyr: treat your API quota as a budget</title>
    <link href="https://tapyr.eu/blog/introducing-tapyr/"/>
    <id>https://tapyr.eu/blog/introducing-tapyr/</id>
    <published>2026-11-25T15:00:00+01:00</published>
    <updated>2026-11-25T15:00:00+01:00</updated>
    <summary>An open source gateway that turns vendor APIs into Prometheus and OTLP metrics, and plans every call against the rate limits of the API.</summary>
    <content type="html">&lt;p&gt;If you run cloud-managed network gear, the metrics you want are not on the devices anymore. They sit behind the REST API of a vendor cloud: Meraki Dashboard, Aruba Central, Teltonika RMS, UniFi Site Manager, Juniper Mist. And every one of these APIs rations its calls.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Meraki allows 10 requests per second per organization.&lt;/li&gt;
&lt;li&gt;Aruba Central gives an account 5,000 calls a day, reset at midnight UTC.&lt;/li&gt;
&lt;li&gt;Teltonika RMS gives a token 100,000 calls a month. One month.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The usual way to get those metrics into Prometheus is a small exporter per vendor that polls every endpoint at a fixed interval and hopes for the best. It works until it doesn&amp;#39;t: you add a site, a job fans out over 400 devices, someone else uses the same API key for a script, and the quota runs dry on the 19th of the month. Your dashboards go flat, the 429s pile up, and on some platforms your integration is locked out until the window resets.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/kentrow/tapyr&quot;&gt;Tapyr&lt;/a&gt; is the tool I wanted for that problem. It is an open source, self-hosted &lt;strong&gt;API-to-metrics gateway&lt;/strong&gt;: it polls the APIs, turns the JSON into clean metrics, and exposes or pushes them to Prometheus, VictoriaMetrics, Mimir or any OTLP backend. The difference is in how it calls the APIs.&lt;/p&gt;
&lt;h2 id=&quot;the-quota-is-a-budget&quot;&gt;The quota is a budget&lt;/h2&gt;
&lt;p&gt;In Tapyr, API quota is a scarce resource that is planned and spent deliberately.&lt;/p&gt;
&lt;p&gt;Each provider declares its limits once, in its definition: rates, concurrency, daily or monthly quotas, scoped by account, organization, credential or source IP. Every outbound request goes through a budget engine before it leaves: regular requests, but also retries, pagination pages, token refreshes and discovery calls. Nothing bypasses it. When the API returns rate limit headers, the engine syncs with them, so usage by other tools on the same key is counted too.&lt;/p&gt;
&lt;p&gt;On top of the engine sits a planner. Jobs have a desired interval and a priority. When the desired intervals do not fit the quota, the planner slows the low-priority jobs down first, and never touches the critical ones. And you can see that plan &lt;strong&gt;before the first call&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;post-code&quot; tabindex=&quot;0&quot; data-lang=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;pr&quot;&gt;$&lt;/span&gt; tapyr plan --config config.yaml
&lt;span class=&quot;c&quot;&gt;QUOTA                  WINDOW       AVAILABLE  PROJECTED  FOR RETRIES  STATUS&lt;/span&gt;
teltonika-rms/monthly  720h         90000      89976      10000        &lt;span class=&quot;ok&quot;&gt;fits (100.0%)&lt;/span&gt;
  account fleet
  job data-usage       desired 30s  effective 1m1s  42492 runs x 1 page = 44616  (slowed down x2.03, priority low, to fit the monthly quota of account fleet)
  job devices          desired 1m   effective 1m    43200 runs x 1 page = 45360

The plan fits by slowing down 1 of 2 jobs to stay within the quotas (see effective above).&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ten percent of the quota is kept for retries. The critical job keeps its one-minute interval; the low-priority one runs every minute instead of every 30 seconds, and the month ends with calls to spare instead of a lockout. If even the slowest allowed intervals cannot fit, &lt;code&gt;tapyr plan&lt;/code&gt; says which quota breaks, by how much, and which job to change.&lt;/p&gt;
&lt;p&gt;The same planner runs inside &lt;code&gt;tapyr run&lt;/code&gt;, against the quota actually left: it replans at a regular interval, as soon as the consumption drifts beyond its projection, when it learns the real size of a quota from the provider, and when discovery finds more devices to poll.&lt;/p&gt;
&lt;h2 id=&quot;no-code-to-support-an-api&quot;&gt;No code to support an API&lt;/h2&gt;
&lt;p&gt;A provider is a package of YAML and &lt;a href=&quot;https://cel.dev&quot;&gt;CEL&lt;/a&gt;: where the endpoints are, how to authenticate, how to page through results, how to discover organizations and devices to fan out over, how each JSON field becomes a metric with its labels and unit, and every limit the vendor enforces, each with the source it comes from. Supporting a new API is a package, not a Go program, and &lt;code&gt;tapyr provider lint&lt;/code&gt; checks it.&lt;/p&gt;
&lt;p&gt;Every package also ships a &lt;strong&gt;simulator&lt;/strong&gt;, driven by the same definition: it serves synthetic inventories with the real limits, and fault scenarios (&lt;code&gt;quota-tight&lt;/code&gt;, &lt;code&gt;bad-day&lt;/code&gt;). You can develop a package, test a configuration or run a demo without a vendor account. The CI of the project runs every package against its simulator, and the public demo runs on them.&lt;/p&gt;
&lt;p&gt;Tapyr ships seven provider packages today: Aruba Central (classic), Cisco Meraki Dashboard, Cisco ThousandEyes, Juniper Mist, Teltonika RMS, Teltonika RutOS and UniFi Site Manager. Five of them have been validated against real platforms; the others against their simulators, and reports from real accounts are welcome. The &lt;a href=&quot;https://tapyr.eu/providers/&quot;&gt;provider catalog&lt;/a&gt; shows what each one collects, its limits and how it was validated. Network gear is the first use case, not the limit: the engine knows nothing about networks.&lt;/p&gt;
&lt;h2 id=&quot;keep-what-the-quota-paid-for&quot;&gt;Keep what the quota paid for&lt;/h2&gt;
&lt;p&gt;A sample that cost a call against a monthly quota should not be lost because the metrics backend was down for an hour. Tapyr 0.7 adds a disk buffer to the push outputs (remote write and OTLP): samples wait on disk, within a size and an age you set, survive a restart, and are delivered in order once the backend is back. &lt;code&gt;tapyr plan&lt;/code&gt; tells you how long an outage each buffer covers at your volume.&lt;/p&gt;
&lt;h2 id=&quot;it-watches-itself&quot;&gt;It watches itself&lt;/h2&gt;
&lt;p&gt;A tool that spends a quota for you has to show how it spends it. Tapyr exposes its own metrics: calls, latencies, retries, 429s, quota left and its projected exhaustion, plan changes, job freshness, output delivery. It comes with a Grafana dashboard and alert rules. A read-only web UI shows the providers, the quotas, the graph of accounts and jobs, the plan, the outputs, and a live debug view that puts the raw response of a job next to the samples it produced.&lt;/p&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Look first:&lt;/strong&gt; the public demo at &lt;a href=&quot;https://demo.tapyr.eu&quot;&gt;demo.tapyr.eu&lt;/a&gt; runs Tapyr against the simulators.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run it locally&lt;/strong&gt;, with Docker and no vendor account: Tapyr, the simulators, VictoriaMetrics and Grafana.&lt;/p&gt;
&lt;pre class=&quot;post-code&quot; tabindex=&quot;0&quot; data-lang=&quot;sh&quot;&gt;&lt;code&gt;git clone https://github.com/kentrow/tapyr.git
cd tapyr/examples/compose
docker compose up -d&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Your own configuration:&lt;/strong&gt; the &lt;a href=&quot;https://docs.tapyr.eu/latest/getting-started/&quot;&gt;getting started guide&lt;/a&gt; walks through a first configuration with the binary alone, its plan, its run, and a quota that shrinks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tapyr installs as a static binary, a container image, a Helm chart, deb and rpm packages, or a Homebrew cask. Releases are signed with cosign and carry SLSA provenance.&lt;/p&gt;
&lt;h2 id=&quot;where-it-stands&quot;&gt;Where it stands&lt;/h2&gt;
&lt;p&gt;Tapyr is pre-1.0 and Apache-2.0 licensed. The configuration format is &lt;code&gt;tapyr/v1alpha1&lt;/code&gt;; the &lt;a href=&quot;https://github.com/kentrow/tapyr/blob/main/docs/roadmap.md&quot;&gt;roadmap&lt;/a&gt; goes through more APIs (OAuth authorization code, a package scaffolder), the remaining engine features (request cost, windows of any length) and a review of the configuration format before 1.0.&lt;/p&gt;
&lt;p&gt;What would help most right now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Which API should be next?&lt;/strong&gt; Tell me in &lt;a href=&quot;https://github.com/kentrow/tapyr/discussions&quot;&gt;GitHub Discussions&lt;/a&gt;; the &lt;a href=&quot;https://docs.tapyr.eu/latest/provider-ideas/&quot;&gt;provider ideas&lt;/a&gt; list candidates already. APIs beyond networks are welcome.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run it against your platform&lt;/strong&gt; and tell me what the plan, the metrics or the docs got wrong.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stars and shares&lt;/strong&gt; help other people find it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code, the docs and the issues are on &lt;a href=&quot;https://github.com/kentrow/tapyr&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;</content>
  </entry>
</feed>
