Instrument
OpenTelemetry
Send traces, logs and errors from any language to OpenPerf over OTLP.
OpenPerf accepts OTLP over HTTP, so an app in any language can send data with a standard OpenTelemetry SDK or the Collector. For the browser, Node.js and Bun, use the OpenPerf SDK from the Quickstart instead.
Configure the exporter
Open the project under Settings → Projects and find the Connection section. Copy Endpoint for OTEL_EXPORTER_OTLP_ENDPOINT, and take the opf_… project key from the DSN (https://opf_…@ingest.example.com).
Set the standard OpenTelemetry variables before the app starts:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.example.com"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20opf_…"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="otlp"
export OTEL_METRICS_EXPORTER="none"
export OTEL_RESOURCE_ATTRIBUTES="service.version=1.4.0,deployment.environment.name=production"- The exporter appends
/v1/tracesand/v1/logstoOTEL_EXPORTER_OTLP_ENDPOINT. %20is the URL-encoded space afterBearer.- OpenPerf has no metrics endpoint, so the metrics exporter is off.
service.versionbecomes the release anddeployment.environment.namethe environment.
Then start the app with OpenTelemetry turned on:
pip install opentelemetry-distro opentelemetry-exporter-otlp-proto-http
opentelemetry-bootstrap -a install
export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
opentelemetry-instrument python app.pyThe extra variable sends the records of the logging module.
Send a request to the app and open Traces.
Pick the Node.js type for a backend service
A project has one of three types: JavaScript / Web, Node.js or Bun. The Backend performance screens list only Node.js and Bun projects in their Project filter.
Endpoints
| Signal | Request |
|---|---|
| Traces | POST https://ingest.example.com/v1/traces |
| Logs | POST https://ingest.example.com/v1/logs |
- Body. OTLP as
application/x-protobuforapplication/json, with optionalContent-Encoding: gzip. gRPC is not accepted. - Key. Send
Authorization: Bearer opf_…. If your exporter can't set headers, put the key in the signal URLs instead, for exampleOTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://ingest.example.com/v1/traces?key=opf_…". - Browsers. If the project has Allowed origins, a request with an
Originheader must come from one of them.
What OpenPerf does with the data
Spans
OpenPerf stores every span and reads its semantic-convention attributes:
- A root span, or a span of kind
SERVERorCONSUMER, becomes a transaction in Backend performance. Its name is the HTTP method plushttp.route, such asGET /orders/:id, or the span name without a route. - Client spans with
db.system.namefeed Queries, except cache systems such as Redis. Client spans with an HTTP method feed Outbound. - A span with the
ERRORstatus counts as failed. - Literals in
db.query.textare replaced with?, and values of sensitive URL query parameters withFILTERED.
Logs
A log record keeps its body, severity, attributes and scope name. The severity comes from severityNumber, or from severityText when the number is missing. The trace and span IDs on the record link it to its trace.
Exceptions
OpenPerf turns two things into an error:
- A span event named
exception. This is whatrecordExceptionin Java,record_exceptionin Python andRecordErrorin Go add to a span. The error gets theerrorlevel and links to the span and its trace. - A log record with an
exception.type,exception.messageorexception.stacktraceattribute. Its severity sets the level:fatal,error, orwarnfor anything lower. The record still shows up in Logs.
Errors are grouped by type and the top frames of the stack trace. Set openperf.error.fingerprint to group them yourself. The same exception reported more than once in one trace is stored once.
Stack traces are split into frames for JavaScript, Python, Ruby, Go, Java and PHP, picked by telemetry.sdk.language. In Go, pass trace.WithStackTrace(true) to RecordError to send one.
Key attributes
OpenPerf stores every attribute you send and uses standard OpenTelemetry semantic conventions (plus openperf.* overrides) to populate the dashboard:
| Scope | Attributes | Drives |
|---|---|---|
| Resource | service.version, deployment.environment.name, telemetry.sdk.language, openperf.source, vcs.ref.head.revision | Release, environment, platform (server/browser), parser and ref |
| Spans | openperf.op, http.route, http.request.method, http.response.status_code, openperf.transaction, url.path, url.full, openperf.measurement.<name> | Operation, transaction name, status rates and Web Vitals (lcp, fcp, inp, ttfb, cls) |
| DB & HTTP | db.system.name, db.query.summary, db.query.text, db.operation.name, db.collection.name, server.address, url.template | Queries and Outbound views (SQL literals are scrubbed to ?) |
| Errors | exception.type, exception.message, exception.stacktrace, openperf.error.fingerprint, openperf.error.handled, openperf.error.id, openperf.breadcrumbs | Grouping, deduplication, handled state and breadcrumbs (last 100) |
| User | user.id, user.name, user.email, user_agent.original, client.address, browser.*, os.*, device.*, runtime.* | Affected user counts and error occurrence tags |
The Spans, DB & HTTP and Errors rows are read from the span, the log record or the exception event that carries them. Set on the resource, they are stored but drive nothing. user.id is the exception: a resource may set it for all its records.
Limits
These are the default limits:
| Limit | Value |
|---|---|
| Request body | 10 MB after decompression |
| Records | 50,000 log records, or spans and span events, per request, and 500,000 attributes |
| Requests | 10,000 per minute for a project, and the same for one IP address |
| Timestamps | Not older than 7 days and not more than 10 minutes ahead |
| IDs | A span needs a valid trace ID and span ID |
| Attributes | 128 per span, log record or resource; keys over 256 chars are dropped, values cut at 32 KB |
| Log body | Cut at 32 KB |
Spans and log records that break the timestamp or ID rules are dropped and counted in the partialSuccess field of the 200 response. A 429 or 503 response carries a Retry-After header in seconds. Retrying is safe: an identical body sent again within 15 minutes is not stored twice.