Skip to Content
OpenPerf

Services

api-ingest

The OTLP intake. Port 4100.

Accepts OTLP over HTTP at /v1/logs and /v1/traces, as protobuf or JSON, optionally gzipped. The project key comes from Authorization: Bearer <key> or the key query parameter. Logs and spans are written to a journal on local disk and exported to ClickHouse in batches; errors pass through the journal into the queue of worker-errors.

A request is answered once its rows are synced to disk. Keep INGEST_JOURNAL_DIR on a volume that survives restarts, and give every instance its own: two instances must not share a journal directory.

/v1/replays takes session replay segments from the browser SDK and writes them to object storage, with an index row in ClickHouse.

Reads PostgreSQL, ClickHouse, Redis, object storage, the ingest journal, proxies and logging. All variables below are optional.

VariableDefaultDescription
PORT4100HTTP port.
INGEST_WORKERS1Intake processes sharing the port. Above 1, a supervisor runs them and one exporter process. Linux only; elsewhere one process runs.
INGEST_JOURNAL_DIR.journalDirectory of the journal. The image sets /var/lib/openperf/journal.
INGEST_JOURNAL_MAX_BYTES8589934592Bytes waiting for export above which intake answers 429. Also scales the export batch size up to 32 MiB.
INGEST_RATE_LIMIT_PER_MINUTE10000OTLP requests per project and per client address per minute before 429. Also scales per-project byte and replay quotas (32 KiB/req, replays 6× reqs). 0 turns off.

Fixed built-in limits: 10 MiB max request body (50,000 records / 500,000 attributes / 32 MiB decoded rows), 128 MiB max in-flight body bytes per process, 60 failed auth attempts/min per IP, and a 2-minute idempotency window.

Commands

The image exposes the api-ingest command:

CommandWhat it does
api-ingestRuns the service.
api-ingest migrateApplies the ClickHouse migrations and exits.
api-ingest healthcheckExits with 0 when /healthz on PORT answers, else 1.

Memory

A process holds about 70 MB when idle. Under load its memory follows BUN_JSC_smallHeapGrowthFactor, an option of the JavaScript engine, 2 by default. It sets how much garbage may pile up before a collection. A lower value takes less memory and more CPU.

Measured on one process taking 190,000 rows per second with 32 MiB batches:

BUN_JSC_smallHeapGrowthFactorPeak memoryCPU per row
1.5350 MB20% more
2450–600 MBbaseline
3750 MB3–10% less

Memory returns to about 110 MB once the load stops. Measure again after a Bun upgrade: the option belongs to the engine and its effect may change.

Responses

StatusWhen
200Accepted. A body already accepted within the 2-minute idempotency window is stored once. partialSuccess.rejectedSpans counts spans without an id or dated outside the accepted window, partialSuccess.rejectedLogRecords counts log records outside it.
400Malformed body or gzip stream.
401Invalid project key.
403The Origin is not in the project's allowed origins.
404A replay, and object storage is not configured.
413Body over 10 MiB, more than 50,000 records or 500,000 attributes, nesting deeper than 32 levels, or decoded rows over 32 MiB.
415Unsupported content type or encoding.
429A rate limit by address (including repeated auth failures), by project, a project over its byte or replay quota, or a full journal. Retry-After says when to retry.
503The journal can't be written, such as on a full disk (Retry-After: 5), or in-flight request bodies reached 128 MiB (Retry-After: 1).

A request is accepted whole or not at all, except for its rejected items: a span or log record dated more than 7 days back or 10 minutes ahead of the server clock is dropped, and so is a span without an id. An error sent twice within the idempotency window, such as both as a span event and a log, is stored once.

An attribute map keeps its first 128 attributes. A key over 256 characters is dropped, and a value is cut at 32768 characters. A log body is cut at 32768 characters too.

On this page