Semantic conventions
Every OTLP attribute the Sypnia server SDKs set and the engine reads, with its type, when it is required and an example, and how server spans and browser events become one trace.
The server SDKs (@sypnia/telemetry/node, @sypnia/telemetry/next) and the bridge (@sypnia/telemetry/otel) send traces in the OpenTelemetry protocol: OTLP/HTTP, in protobuf, to POST /v1/otlp/v1/traces. Any other OpenTelemetry exporter can send to the same endpoint. This page lists the attributes that matter to Sypnia, for both kinds of sender. It is the same for the open-source engine and for Sypnia Cloud.
The rule behind it: where OpenTelemetry has a name for something, Sypnia uses that name, as OpenTelemetry defines it. A sypnia.* attribute exists only where OpenTelemetry has none: the account, the use case, a request exported before it ended, a database reached through an HTTP API, how an error was caught. There is no project attribute: the project comes from the ingest key, as for every other sender.
It is generated from spec/otlp-conventions.yaml in the docs repository. When this page and that file disagree, the file is right. The browser’s own events are in the event schema.
The attributes
«Sent by» says who sets the attribute: SDK is @sypnia/telemetry/node and @sypnia/telemetry/next, bridge is @sypnia/telemetry/otel, any exporter means the engine reads it from any OpenTelemetry sender that sets it.
Resource attributes
Once per ResourceSpans: they describe the service that sent the spans.
The request your service received
On the span of kind SPAN_KIND_SERVER that a service opens for each request it handles. It is the root of that service’s part of the trace.
| Name | Origin | Type | Required | Sent by | Meaning | Example |
|---|---|---|---|---|---|---|
http.request.method | OpenTelemetry | string | always | SDK, bridge, any exporter | The HTTP method, upper case. | POST |
http.route | OpenTelemetry | string | always | SDK, bridge, any exporter | The route template: the path with ids replaced, /orders/:id. The SDK takes the framework’s pattern when it can read it (Express, Fastify, the Next.js file route) and otherwise applies the same rule as the browser. A server span without it is stored, shown in its trace, and left out of Performance. | /api/checkout |
url.path | OpenTelemetry | string | optional | SDK, bridge, any exporter | The path that was called, up to 500 characters. Never the query string: the SDK never sends url.query or url.full, and the engine drops both. | /api/checkout |
http.response.status_code | OpenTelemetry | int | when: The answer was sent. Missing on a partial span. | SDK, bridge, any exporter | The HTTP status the service answered. 500 or above makes the request a failure. | 400 |
session.id | OpenTelemetry | string | when: The request came from a page that runs the browser SDK. | SDK, bridge | The browser session, copied from the x-sypnia-session request header: 32 lowercase hex characters. It puts the request in that session’s timeline and gives the trace the session’s person. Any other value is dropped. Other exporters can set it the same way. | 8f3a6c1e9b2d4f07a5c3e1b8d6f4a2c0 |
user.id | OpenTelemetry | string | when: The app called identify() on the server during this request. | SDK, bridge | The person the request belongs to, the id given to identify(), up to 128 characters. Only the id: names and e-mail addresses are never sent as attributes. Without it the trace takes the person of its session. | u_1042 |
sypnia.account.id | Sypnia | string | when: identify() on the server named an account. | SDK, bridge | The account the person belongs to in your app (a team, a company, a club), up to 128 characters. OpenTelemetry has no name for it. | acc_77 |
sypnia.case | Sypnia | string | when: The request or job serves a use case. On a scheduled job or a listener, set it on the job’s root span. | SDK, bridge, any exporter | The id of the use case this work serves, as it is on the map, up to 128 characters (place-order). Sypnorm and Sypnia Run set it for the cases they run; other code sets it with setSpanAttributes() of @sypnia/telemetry or the OpenTelemetry API. The trace takes the case of its first span that carries one. See Use cases and places. | place-order |
sypnia.case.outcome | Sypnia | string | when: The span carries sypnia.case and the case ended. | SDK, bridge, any exporter | The name of the outcome or failure the case ended in, up to 80 characters (OrderPlaced, OutOfStock). A declared failure is counted as an outcome, not as an error. When the work throws before the case can end, it is error (Sypnorm and the Cases runtime set it); a span with sypnia.case and no outcome is counted as an error too. | OrderPlaced |
faas.coldstart | OpenTelemetry | boolean | optional | SDK, any exporter | true on the first request of a new process: a cold start on serverless. Sent only when true. | true |
sypnia.partial | Sypnia | boolean | when: The request was still running after slowRequestMs (20,000 ms by default). | SDK | This span was exported while the request was still running, with its end time set to the moment of export. If the request finishes, the SDK exports the same span id again without this attribute, and the full span replaces the partial one. If the platform kills the request, the partial span is what remains, and the engine reports it as a timeout. | true |
sypnia.dropped_spans | Sypnia | int | when: The request had more than 200 spans. | SDK | How many spans of this request the SDK did not send. It keeps the first 200 of each request. | 0 |
A call to another service
On a span of kind SPAN_KIND_CLIENT for an outgoing HTTP call (fetch, http.request, https.request).
A database call
On a span of kind SPAN_KIND_CLIENT for a query: a pg query, or a Supabase or PostgREST call recognized by its path (/rest/v1/…).
An error
On a span event named exception, on the span where the error happened. Span events with any other name are dropped.
Span status and errors outside a request
On any span.
What kind of span it is
The engine gives every span one of five kinds. The Traces API returns them in kind.
| In OTLP | Sypnia kind | What it is |
|---|---|---|
| SPAN_KIND_SERVER | server | A request a service handled. With http.route, one API call in Performance. |
SPAN_KIND_CLIENT with db.system.name | db | A database call. |
SPAN_KIND_CLIENT with http.request.method | http | A call to another service. |
| Any other span (INTERNAL, PRODUCER, CONSUMER, or CLIENT without either attribute) | internal | A step, shown in the trace. |
A browser request event (not OTLP) | browser | The call as the page saw it. Made by the engine, below. |
The browser’s part of the trace
The browser SDK does not speak OTLP: it sends its compact request event. The engine turns each request event that has a trace id into a span of kind browser:
Field of request | In the browser span |
|---|---|
tid | The trace id. |
span | The span id. It is the parent id the SDK put in traceparent, so the server span whose parentSpanId equals it hangs under it. |
| (none) | The parent: none. The browser span is the root of the trace. |
method and path | The name, POST /api/checkout, and the attributes http.request.method and url.path. |
host | server.address. Missing for calls to the page’s own origin. |
ts and dur | Start and duration. |
status, code, msg | http.response.status_code; the span failed on 0, 400 or 500+; code and msg as error.type and the status message. |
sid, person, account, env, ver | The trace’s session, person, account, environment and release. The service is browser. |
How one trace is put together
- One trace is one trace id. The browser SDK creates it for each recorded call, with a span id for the call, and sends both in
traceparent(00-<trace id>-<span id>-01) to your own origin and totraceTargets. - The server SDK reads
traceparent: its server span takes the trace id and uses the browser’s span id asparentSpanId. Without the header it starts a new trace. On every outgoing call it sendstraceparentwith its own span id, so the next service continues the trace. - The engine makes one span of kind
browserfrom eachrequestevent, as in the table above. It is the root. The server spans hang under it throughparentSpanId. - A span whose parent is not in the trace (the parent was dropped, lost or sampled out) hangs under the root, so the tree never breaks.
- The trace’s session is the browser event’s
sid, elsesession.idon a server span. Its person isuser.idon a server span, else the session’s person. - Spans of one trace can arrive in different requests and from different services. Ingest stores each request as it comes; the roll-up joins everything with the same trace id when it builds the trace, within the 10 minutes of the freshness promise.
- Times are kept as each sender’s clock gave them. The engine does not shift one service’s clock to fit another’s, so a server span can look a few milliseconds outside its browser span.
The shop’s checkout, in these terms: the page’s POST /api/checkout is the browser span 0f1e2d3c4b5a6978, 3,870 ms, answered 400. The server span of shop-api, a1b2c3d4e5f60718, has that span as its parent and takes 3,842 ms. Under it, SELECT carts (db, 12 ms) and POST /v1/payments (http, 3,790 ms, error.type 400, status message amount is required). One trace id, 7c2e9a4b1d8f4e6a9b3c5d7e1f2a4b6c, joins the four. The full request body is in the OTLP reference.
What the engine does not use
- Span events other than
exception, span links,tracestateand baggage: dropped. url.query,url.full,db.query.textand any attribute whose name containsauthorization,cookie,password,secretortoken: dropped at ingest.- Attributes beyond 64 on a span: dropped. Values beyond 256 characters: cut, except
exception.stacktrace(4,000),exception.messageandstatus.message(500), andsypnia.db.messageand the status message of a span that carries it (2,000). - The sampled flag in
traceparent: not used. Sypnia stores what it receives. - Any attribute not listed on this page: kept with the span and shown in the trace, never used to decide anything.
Limits and constants
Part of the contract: the SDKs and the engine implement these values.
| Constant | Value | Meaning |
|---|---|---|
spans_per_request | 200 | Spans the server SDKs keep per request. The rest are counted in sypnia.dropped_spans. |
span_attributes | 64 | Attributes kept per span. |
span_attribute_chars | 256 | Characters kept per attribute value, with the exceptions above. |
failures_per_request | 5 | exception events the server SDKs send per request, one per fingerprint. |
log_failures_per_request | 3 | Of those, at most this many from console.error. |
slow_request_ms | 20,000 | When a request still running is exported as partial (sypnia.partial). The option slowRequestMs changes it; 0 turns it off. |
export_interval_ms | 2,000 | How long finished spans wait in memory before the server SDKs export them in one request. |
export_max_spans | 512 | Spans in one export request from the server SDKs. A request’s spans are never split across two exports. |
body_bytes_after_decompression | 4,000,000 | The largest body the endpoint accepts, from any sender. |
spans_per_export | 2,000 | The most spans the endpoint accepts in one request, from any sender. |
spans_per_trace | 500 | Spans the engine keeps per trace. The rest are counted in the trace’s dropped_spans. |