Migrating Metrics From Prometheus to Distlang API (2026)
Why This Glossary Exists
If you’ve run Prometheus in production, you know the drill: write scrape configs, deploy exporters, tune retention, wire up Grafana, and hope your targets stay alive long enough to get scraped. That model works well for Kubernetes pods and persistent VMs. It falls apart the moment you deploy to serverless.
A thread on the Prometheus developers mailing list captured the frustration plainly: the fundamental mismatch between Prometheus’s pull architecture and the serverless runtime, which doesn’t even allow you to see individual container instances, is a persistent source of pain. Practitioners on Dev.to have stated bluntly that Prometheus “does not work for ECS Fargate, and definitely does not work for AWS Lambda.”
The Distlang Metrics API replaces the pull/scrape model with push-based ingestion over HTTP. You record counters and histograms in your application code, buffer them, and flush them before the handler exits. No agents, no sidecars, no scrape targets. This glossary bridges the vocabulary gap for developers migrating metrics from Prometheus to Distlang API so you can move quickly without second-guessing terminology.
Ready to jump straight into code? The Distlang Metrics API docs cover endpoint specs, authentication, and payload format.
Metric Type Mapping Table
Every top-ranking migration guide includes a type mapping table, and for good reason: it’s the first thing you look for. Here’s how Prometheus’s four core metric types map to the Distlang Metrics API.
| Prometheus Type | Distlang Equivalent | Notes |
|---|---|---|
| Counter | Counter | Both are monotonically increasing. Distlang counters are pushed via API rather than scraped from a /metrics endpoint. |
| Histogram | Histogram | Distlang histograms are configured in code via the JS client. No PromQL bucket queries needed. |
| Gauge | Not currently supported | Distlang focuses on counters and histograms for serverless workloads where gauges (current memory, queue depth) are less common. |
| Summary | Not currently supported | Prometheus itself recommends histograms over summaries in most cases. |
The gap on gauges and summaries is worth noting upfront. If your Prometheus setup relies heavily on gauges (measuring current queue length, for example), those specific metrics will need a different solution or a workaround using counters with labels. For the majority of serverless use cases, counters and histograms cover request counts, error rates, and latency distributions, which is exactly what short-lived handlers need.
For a hands-on walkthrough of both types, see how to instrument counters and histograms in JavaScript.
Glossary: Prometheus to Distlang, Term by Term
after()
A lifecycle function in Vercel’s Next.js that lets you schedule work after the response has been sent to the client. When migrating metrics from Prometheus to Distlang API on Vercel, after() is where you call the flush method to push buffered metrics before the runtime terminates.
Migration note: Replaces the need for a persistent /metrics endpoint. Instead of keeping a process alive for scraping, you push data out in the post-response window. See after() patterns for Vercel for implementation details.
API-First Metrics
An architecture where metrics are sent to a backend over standard HTTP requests rather than exposed on an endpoint and pulled by a collector. The Distlang Metrics API accepts JSON payloads of counter and histogram recordings via POST requests authenticated with a bearer token.
Migration note: This is the core architectural shift. You stop configuring scrape targets and start making HTTP calls. Every concept downstream (flush, buffering, API tokens) follows from this change.
API Token (Bearer Token)
A single long-lived authentication token per Distlang account, passed as a bearer token in the Authorization header of every metrics push. Prometheus, by contrast, typically uses config-file-based authentication or mTLS between scraper and targets.
Migration note: One token replaces all the per-target auth configuration in your Prometheus setup. See the API tokens documentation for setup.
Buffering and Batching
The Distlang JS client buffers metric recordings in memory during a handler’s execution and sends them in a single HTTP call when flushed. This prevents data loss in short-lived handlers where multiple individual HTTP calls would be too slow or might get cut off by runtime termination.
Migration note: Prometheus client libraries also buffer internally, but they expose the buffer on a /metrics endpoint for scraping. The difference is directional: Distlang’s buffer empties outward via push, not inward via pull. For tuning strategies, read about buffering and flushing in serverless code.
Cardinality
The number of unique label-value combinations per metric. A metric http_requests_total with labels method and status where method has 4 values and status has 5 values produces 20 time series. This concept is identical in both Prometheus and Distlang.
The rule is the same everywhere: never put unbounded values like user IDs, request IDs, full URLs, or timestamps into labels. Normalize free-form values into a small fixed set. Distlang takes an opinionated stance on this, encouraging low-cardinality label strategies from the start.
Migration note: Cardinality doesn’t go away when you switch systems. But Distlang’s billing model (rows per month) makes the cost of high cardinality immediately visible rather than hidden in disk I/O and query slowness. For practical guidance, read about label naming and low-cardinality strategies.
Counter
A cumulative metric that represents a single monotonically increasing value. Its value can only increase or be reset to zero on restart. Used for requests served, tasks completed, errors encountered.
In Prometheus, you call counter.inc() and the value sits in memory until scraped. In Distlang, you call a similar method on the JS client, and the recording is buffered until flush.
Migration note: The semantics are identical. The delivery mechanism changes from pull to push.
ctx.waitUntil()
A Cloudflare Workers API method that tells the runtime to keep the Worker alive after the response has been sent. This is where you call the Distlang client’s flush method. Without it, the Worker may terminate before metrics are pushed.
Migration note: This is the Workers equivalent of Vercel’s after(). Both solve the same problem: keeping the runtime alive just long enough to push metrics out. For patterns and pitfalls, see ctx.waitUntil() semantics for Workers.
Dashboard (Hosted)
Distlang auto-generates a dashboard per metric set at dash.distlang.com. Chart titles and descriptions are suggested automatically from incoming metrics using AI. This replaces the manual process of setting up Grafana, connecting it to Prometheus as a data source, and building panels by hand.
Migration note: One of the biggest time savings in migrating metrics from Prometheus to Distlang API. You go from writing Grafana JSON or clicking through a UI to having a usable dashboard appear when data starts flowing. See a full walkthrough from app to dashboard.
Exporter
A Prometheus-specific component (like node_exporter, blackbox_exporter, or custom application exporters) that exposes metrics on an HTTP endpoint in the Prometheus exposition format. Exporters are the bridge between your application and the Prometheus scraper.
Migration note: Exporters do not exist in the Distlang model. Your application code pushes metrics directly to the API. No sidecar processes, no additional ports to expose, no exporter configuration to maintain.
Flush
The act of sending all buffered metric recordings to the Distlang backend in a single HTTP POST. In serverless environments, the flush must happen before the runtime terminates, which is why it’s called inside ctx.waitUntil() on Workers or after() on Vercel.
Migration note: This concept has no direct Prometheus equivalent because Prometheus pulls data on its schedule. With push-based metrics, flush timing is your responsibility, and it’s the single most important operational detail to get right in serverless. If you miss the flush window, the data is lost.
Gauge
A metric whose value can go up and down. Typically used for measured values like current memory usage, number of active connections, or queue length. Prometheus gauges are one of the four core metric types.
Migration note: Distlang does not currently support gauges. For serverless workloads, gauges are less natural anyway since there’s no persistent process whose “current state” you’d measure. If you have critical gauge metrics, you’ll need to either keep a Prometheus instance for those or rethink the measurement as a counter (for example, counting queue-push and queue-pop events separately).
Histogram
A metric that records observations by counting them in configurable buckets. It also provides a sum of all observed values and a total count. Used for latency distributions, response sizes, or any value where you care about the shape of the distribution, not just the average.
In Prometheus, you define buckets in your client code and query them with PromQL’s histogram_quantile(). In Distlang, you define buckets in the JS client configuration, and the hosted dashboard handles visualization.
Migration note: Same concept, different delivery. You stop writing PromQL to extract percentiles and start reading them from the hosted dashboard.
Ingestion (Push vs. Pull)
Prometheus uses a pull-based model where the server regularly scrapes metrics from configured targets by hitting their /metrics endpoints. This contrasts with push-based ingestion where the monitored application sends its metrics to the monitoring backend.
Three situations where push dominates: (1) serverless functions and short-lived batch jobs that may not be alive long enough to be scraped, (2) IoT and edge devices behind NATs or firewalls, and (3) cross-cloud and cross-account scenarios where opening inbound ports for scraping is impractical.
Migration note: This is the foundational difference. Everything else in this glossary flows from it.
Labels
Key-value pairs attached to metrics for dimensional filtering. In Prometheus: http_requests_total{method="GET", status="200"}. In Distlang, the same concept applies but the API encourages a controlled set of labels to avoid cardinality explosions.
Migration note: Labels work the same way conceptually. The practical difference is that Distlang’s rows-per-month billing makes each unique label combination a visible cost, which naturally discourages the unbounded label patterns that cause problems in Prometheus too.
Metric Set
A Distlang concept with no direct Prometheus equivalent. A metric set is a named collection of related metrics that maps to a single dashboard. Think of it as a logical grouping: all the counters and histograms for your checkout service might live in one metric set.
Migration note: When planning your migration, map your existing Prometheus metric namespaces or job labels to Distlang metric sets. One metric set per service or domain is a reasonable starting point.
PromQL
Prometheus’s built-in query language for selecting, aggregating, and transforming time-series data. Expressions like rate(http_requests_total[5m]) or histogram_quantile(0.99, sum(rate(http_request_duration_bucket[5m])) by (le)) are central to Prometheus dashboards and alerting rules.
Migration note: Not needed with Distlang. The hosted dashboard with AI chart suggestions handles visualization. If you’ve spent significant time building complex PromQL queries, this represents both a simplification and a trade-off: you gain ease of use but lose the expressive query power that PromQL provides.
Pushgateway
Prometheus’s official answer for push-based metrics, and it’s officially recommended only in certain limited cases. The Pushgateway accepts pushed metrics and exposes them for Prometheus to scrape. The problems are well-documented: it becomes a single point of failure, it never forgets series pushed to it unless manually deleted, and you lose automatic instance health monitoring via the up metric.
If a batch job fails and doesn’t push new data, Prometheus will keep scraping the stale old values from the Pushgateway, leading to misleading alerts and dashboards.
Migration note: The Pushgateway is the strongest evidence that Prometheus’s architecture wasn’t designed for push workloads. Distlang’s push API replaces this pattern natively, without the staleness, single-point-of-failure, or manual cleanup issues.
Retention
How long metric data is stored and queryable. Prometheus stores data on local disk with configurable retention (default 15 days). Scaling retention means scaling storage, often requiring remote-write to Thanos, Cortex, or Mimir.
Distlang offers tiered retention: 7 days on the Free and Launch plans, 14 days on Hobby, and 30 days on Growth. The storage layer is fully managed. You can compare plan features to find the right tier.
Migration note: You stop sizing disks and tuning compaction. Retention becomes a plan selection, not an ops task.
Rows/Month
Distlang’s billing unit. Each unique combination of metric name, label values, and timestamp counts as a row. The Free plan includes 500k rows/month, scaling up to 20M on the Growth plan at $79/month.
Migration note: Replaces Prometheus’s self-managed storage cost model. The mental shift is from “how much disk do I need” to “how many distinct data points am I generating.”
Scrape Interval
The frequency at which Prometheus polls each target’s /metrics endpoint. The default is typically every 15 seconds. Shorter intervals mean more data but more load on targets and storage.
Migration note: Irrelevant in a push model. With Distlang, data arrives when your code flushes it, typically once per handler invocation. There’s no polling loop to configure.
Serverless Metrics
Metrics from ephemeral, short-lived function invocations. Serverless functions spin up on demand and shut down immediately after execution. This ephemeral lifecycle makes pull-based monitoring fundamentally difficult because the target may not exist when the scraper comes looking.
Cloudflare Workers expose built-in analytics (request counts, error rates, CPU time), but custom application-level counters and histograms require an external solution. That’s the gap Distlang fills.
Migration note: If serverless metrics are why you’re migrating metrics from Prometheus to Distlang API, you’re in the right place. The entire system was designed for this use case.
Summary
A Prometheus metric type that computes configurable quantiles over a sliding time window on the client side. Prometheus’s own documentation recommends using histograms instead of summaries in most cases because summaries cannot be aggregated across instances.
Migration note: Not supported in Distlang. Use histograms instead. This aligns with Prometheus’s own recommendation.
Time-Series Database (TSDB)
The storage layer that holds timestamped metric data. Prometheus includes a built-in TSDB that you manage: compaction, WAL tuning, disk provisioning, and backup are all your responsibility. In Distlang, the TSDB is fully managed. You never interact with it directly.
Migration note: One less thing to operate. You stop worrying about head blocks, compaction failures, and WAL corruption.
Concepts That Go Away
One of the most valuable parts of migrating metrics from Prometheus to Distlang API is what you stop doing. Here are Prometheus concepts you can set aside entirely:
- Scrape configs and targets. No more YAML files listing every service endpoint. Your code pushes directly.
- Exporters and sidecars. No node_exporter, no custom exporter binaries, no additional containers.
- Pushgateway. The entire workaround for push-based metrics disappears when your system is natively push-based.
- PromQL. No query language to learn or maintain. The hosted dashboard handles visualization.
- Grafana dashboard setup. No data source configuration, no panel JSON, no dashboard provisioning.
- TSDB retention tuning. Storage is managed. Pick a plan, and retention is handled.
- AlertManager. For basic dashboard and monitoring use cases, AI-suggested charts surface what matters. (Advanced alerting pipelines may still require separate tooling.)
Practitioners in observability communities have described the frustration well: “You’re spending more time managing Prometheus than using it. If you’re constantly tweaking sharding, federation, or retention policies, you’re maintaining infrastructure instead of monitoring your apps.” If that resonates, this list represents real hours returned to your week.
If you want to see what the simplified setup looks like, check out building a lightweight monitoring setup from scratch.
Migration Notes: What Practitioners Recommend
These recommendations come from teams who’ve documented migrations between metrics systems. They apply directly when migrating metrics from Prometheus to Distlang API.
Take inventory first. Before writing any migration code, catalog what you’re migrating from. Most teams underestimate the surface area of their existing instrumentation. List every metric name, its type, its labels, and where it’s used in dashboards and alerts.
Migrate one metric at a time. Start with the least critical metric. A non-essential counter is a perfect first candidate. Verify the data appears correctly on the Distlang hosted dashboard before moving on.
Run both systems in parallel. The parallel phase costs more temporarily but prevents blind spots. Keep Prometheus scraping while you push the same data to Distlang. Compare values. Only cut over when you trust the new numbers.
Handle the gauge gap early. Since Distlang supports counters and histograms but not gauges, identify which of your gauge metrics are critical. Decide whether to keep a minimal Prometheus instance for those, convert them to counter patterns, or accept the gap.
Validate flush behavior. In serverless environments, a missed flush means lost data. Test thoroughly that ctx.waitUntil() on Workers and after() on Vercel actually complete before the runtime terminates. If you’re hitting issues, the guide on common pitfalls when instrumenting serverless handlers covers the most frequent mistakes.
Start with the quickstart.
Get your first metric flowing in minutes: follow the Distlang Metrics quickstart to go from zero to a working dashboard.
Frequently Asked Questions
Can I migrate from Prometheus to Distlang API incrementally?
Yes. The recommended approach is to migrate one metric at a time, starting with low-criticality counters. Run Prometheus and Distlang in parallel during the transition. Cut over individual metrics only after you’ve verified the data on the Distlang hosted dashboard.
What happens to my Prometheus gauges if Distlang doesn’t support them?
You have three options: keep a minimal Prometheus instance specifically for gauge metrics, re-model the measurement as paired counters (increment on up events, increment a separate counter on down events), or accept the gap if those gauges aren’t critical to your serverless workloads.
Do I need to install any agents or sidecars for Distlang?
No. Distlang Metrics is API-first. Your application code records metrics using the JS client (or raw HTTP calls for non-JS stacks) and pushes them directly to the Distlang API. There are no agents, no exporters, and no sidecar processes to deploy.
How does Distlang handle the problem of stale metrics that plagues Prometheus’s Pushgateway?
The Pushgateway holds metrics indefinitely until manually deleted, which causes stale data problems. Distlang’s push API doesn’t have an intermediate cache. Each flush sends a batch of fresh recordings directly to the backend. If a handler doesn’t flush (because it crashed, for example), no stale data appears in your dashboard.
What if I need PromQL-style ad hoc queries?
Distlang’s hosted dashboard provides AI-suggested charts and visualizations but does not expose a general-purpose query language like PromQL. For most serverless monitoring use cases (request counts, error rates, latency percentiles), the dashboard covers what you need. If you require complex cross-metric correlation queries, you may need supplemental tooling.
How does billing work compared to self-hosted Prometheus?
Prometheus is free but costs engineering time for storage, retention, HA, and scaling. Distlang bills by rows per month (each unique metric-plus-labels-plus-timestamp combination is a row). The Free plan includes 500k rows/month with 7-day retention, scaling up to 20M rows/month on the Growth plan.
Is this migration only relevant for Cloudflare Workers and Vercel?
Those are the two platforms with dedicated quickstarts and lifecycle integration (ctx.waitUntil() and after()). But the raw Metrics API accepts standard HTTP POST requests with bearer token auth, so any runtime that can make HTTP calls can push metrics to Distlang. The serverless/edge framing is where the value is strongest, though, because that’s where Prometheus breaks down most visibly.