---
title: "Ingest OTLP metrics (monitor-URL form)"
method: POST
path: "/{monitor_id}/v1/metrics"
tags: ["Traces"]
---

# Ingest OTLP metrics (monitor-URL form)

`POST /{monitor_id}/v1/metrics`

## Request

- Base URL: `https://ping.lastping.dev`
- URL: `https://ping.lastping.dev/{monitor_id}/v1/metrics`
- Auth: one of:
  - none
  - HTTP bearer

`POST /v1/metrics` for an exporter that cannot set headers: the
URL's `monitor_id` names the monitor and its project, and is itself
the capability, like a ping URL. A `lastping.monitor_id` attribute
may only repeat it (400 otherwise). A Bearer key may also be sent;
it must then belong to this monitor's project (403) and, if bound,
to this monitor (400). Every other rule is the Bearer form's.

## Request body

- object: The OTLP JSON mapping of `ExportMetricsServiceRequest`.

## Response `202`

Accepted and enqueued.

- object
  - `accepted` integer, required: Data points or log records enqueued from this request.
  - `dropped` integer, required: Data points or log records of this request that LastPing does not keep (an unknown metric family or event, a cumulative point, a point with no usable value) and discarded. When a request kept nothing, the monitor's ingest diagnostics say why.

## Other responses

- `400`: Malformed OTLP payload, more than 500 data points, a `lastping.monitor_id` that disagrees with the URL, or a Bearer key bound to a different monitor.
- `401`: A Bearer key was present but is unknown, revoked or expired.
- `403`: A Bearer key was present but its scope is `read`, or it belongs to another project.
- `404`: `monitor_id` does not name a check on this deployment.
- `413`: Decompressed body exceeds 1 MiB.
- `415`: Content-Type is neither `application/x-protobuf` nor `application/json`.
- `429`: The metrics rate cap for this project (3,600 requests/hour, its own bucket) is exceeded, with `Retry-After: 60`. Or the project's daily span budget, which data points count against, is used up: `code: "SPAN_BUDGET_EXCEEDED"`, `Retry-After` to 00:00 UTC. Or LastPing is already reading as many OTLP exports as it takes at once: `code: "OTLP_BUSY"`, `Retry-After: 5`.
- `503`: Ingestion is unavailable on this deployment, the queue could not accept the message, or the budget could not be read. Retry.

---

[API](https://skmtc.dev/lastping/apis/lastping-management-api.md) · [All operations](https://skmtc.dev/lastping/apis/lastping-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lastping/apis/lastping-management-api/revisions/bbc6eda91c46?raw)
