Developers

Documentation

Get metrics flowing in about five minutes. Pick the protocol you already emit — the ingest endpoint speaks all of them.

Quick start

Everything is ingested on https://ingest.metric-ingest.com and read back on https://api.metric-ingest.com. Create a write key in the dashboard, export it, and send your first batch:

export MI_WRITE_KEY="mi_live_xxxxxxxxxxxxxxxx"

curl -sS https://ingest.metric-ingest.com/v1/metrics \
  -H "authorization: Bearer $MI_WRITE_KEY" \
  -H "content-type: application/json" \
  -d '{"resourceMetrics":[{"scopeMetrics":[{"metrics":[
      {"name":"demo.requests","sum":{"dataPoints":[
        {"asInt":"1","timeUnixNano":"1760000000000000000"}]}}]}]}]}'

A successful call returns 202 Accepted:

{"accepted":1,"rejected":0,"request_id":"req_8fK2a9","pop":"cdg1","buffered":false}

Authentication

Every write carries a bearer token in the authorization header. Keys are scoped — a key issued for env=staging can only write to staging pipelines. Rotate or revoke keys from the dashboard or the control API; revocation takes effect at every POP within a few seconds.

PrefixMeaning
mi_live_…Production write key
mi_test_…Sandbox key; data is accepted and discarded
mi_read_…Read-only key for the Query API

OTLP / OpenTelemetry

The native path. Point any OpenTelemetry Collector at the edge with the otlphttp exporter:

exporters:
  otlphttp/metric-ingest:
    endpoint: https://ingest.metric-ingest.com
    headers:
      authorization: "Bearer ${MI_WRITE_KEY}"

service:
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [otlphttp/metric-ingest]

Both JSON and protobuf encodings are accepted on POST /v1/metrics. SDKs that export OTLP directly (without a Collector) work the same way — set the OTLP metrics endpoint to the ingest host.

Prometheus remote-write

Add a remote_write block to prometheus.yml. Both remote-write 1.0 (Snappy/protobuf) and 2.0 are supported on POST /api/v1/write:

remote_write:
  - url: https://ingest.metric-ingest.com/api/v1/write
    authorization:
      type: Bearer
      credentials: ${MI_WRITE_KEY}
    queue_config:
      max_samples_per_send: 2000

StatsD

For StatsD and DogStatsD line protocol, POST newline-delimited lines to /v1/statsd. Handy from a shell or a short-lived job that cannot run an agent:

printf 'checkout.latency:142|ms|#region:eu\norders.count:1|c\n' | \
  curl -sS https://ingest.metric-ingest.com/v1/statsd \
    -H "authorization: Bearer $MI_WRITE_KEY" \
    --data-binary @-

Browser RUM

One ingest source among many: a 1.1 KB script that reports Core Web Vitals and custom events from the browser. It sets no cookies and stores no identifier — see the privacy page.

<script async src="https://ingest.metric-ingest.com/mi.js"
        data-key="mi_live_xxxxxxxxxxxxxxxx"
        data-app="storefront"></script>

Custom events use the global it exposes:

MetricIngest.event("add_to_cart", { value: 24.90, currency: "EUR" });

CLI agent

mi is a small static binary for hosts and CI runners that scrapes local Prometheus endpoints and forwards to the edge:

curl -fsSL https://metric-ingest.com/install.sh | sh
mi run --key "$MI_WRITE_KEY" --scrape http://localhost:9090/metrics --interval 15s

Builds for Linux and macOS (amd64 and arm64), a container image and a Kubernetes DaemonSet are on the download page.

Query API

Read aggregated series back over GET /v1/query with a read key. The expression syntax is a small PromQL subset.

GET https://api.metric-ingest.com/v1/query?q=<expr>&range=<24h|7d|30d>

curl -sS "https://api.metric-ingest.com/v1/query?q=http_request_duration_seconds&p=95&range=7d" \
  -H "authorization: Bearer $MI_READ_KEY"
{
  "query": "http_request_duration_seconds",
  "percentile": 95,
  "range": "7d",
  "unit": "seconds",
  "value": 0.412,
  "granularity": "day",
  "points": [0.39, 0.44, 0.41, 0.40, 0.43, 0.42, 0.41],
  "sample_size": 48213
}

Fleet health is on GET /healthz; your routing config is on GET /v1/pipelines and GET /v1/destinations.

Errors & limits

StatusMeaning
202 AcceptedBatch persisted to the edge buffer
400 Bad RequestMalformed payload; see error field and the dead-letter log
401 UnauthorizedMissing or revoked key
413 Payload Too LargeBatch over 4 MB — split it
429 Too Many RequestsOver your rate limit; honour RateLimit-Reset

Every response carries X-Mi-Request-Id (quote it in support tickets), X-Mi-Region, and RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset headers.