Skip to content

API Reference

MiniAPM provides a simple HTTP API for ingesting traces, errors, and deploy information. All ingestion endpoints are served by the collector service (default port 3000).

All ingestion endpoints require API key authentication via the Authorization header:

Terminal window
Authorization: Bearer proj_abc123...

All endpoints are relative to your MiniAPM collector URL:

http://localhost:3000
EndpointMethodDescription
/ingest/v1/tracesPOSTIngest OTLP traces
/ingest/errorsPOSTReport a single error
/ingest/errors/batchPOSTReport multiple errors
/ingest/deploysPOSTRecord a deployment
/healthGETHealth check (no auth)
CodeDescription
202Accepted (ingestion endpoints)
200Success (health check)
401Missing or invalid API key
400Invalid request body
500Server error

MiniAPM accepts traces in OpenTelemetry Protocol (OTLP) JSON format over HTTP. Configure any OpenTelemetry SDK to export to:

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:3000/ingest
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer proj_abc123...
Terminal window
curl -X POST http://localhost:3000/ingest/errors \
-H "Authorization: Bearer proj_abc123..." \
-H "Content-Type: application/json" \
-d '{
"exception_class": "RuntimeError",
"message": "Something went wrong",
"backtrace": ["app/models/user.rb:42:in `save`"],
"fingerprint": "user_save_runtime_error"
}'
Terminal window
curl -X POST http://localhost:3000/ingest/deploys \
-H "Authorization: Bearer proj_abc123..." \
-H "Content-Type: application/json" \
-d '{
"git_sha": "abc123def",
"version": "v1.2.3",
"deployer": "github-actions"
}'
Terminal window
curl http://localhost:3000/health
# Response:
# {"status":"ok","uptime_seconds":12345,"db_ok":true}