Skip to content

OpenTelemetry

Two ways in from OpenTelemetry, point any OTLP/HTTP exporter at Sypnia from any language or add @sypnia/telemetry/otel to a Node app that already uses it, with examples for Python, Go, PHP, Rust, Java and the Collector, what each span becomes, what OpenTelemetry costs, and what is ignored.

Applies to EngineCloud
View as Markdown
On this page
  1. Two doors
  2. The settings, for every language
  3. By language
  4. Check that it works
  5. Joining the browser’s trace and session
  6. What a span becomes
  7. What Sypnia does not use
  8. What OpenTelemetry costs
  9. What you do not get this way
  10. Next

This page is for whoever runs a backend with OpenTelemetry: Python, Go, PHP, Rust, Java, or a Node app that already has it. Sypnia accepts traces in the OpenTelemetry protocol over HTTP (OTLP/HTTP), on the open-source engine and on Sypnia Cloud alike. It is the same endpoint Sypnia’s own server SDKs send to, so a span from OpenTelemetry and a span from @sypnia/telemetry/node are stored and shown the same way. Sypnia has no SDK of its own for other languages: OpenTelemetry is the way, and it is fully supported.

Two doors

DoorForWhat you do
Point any OpenTelemetry exporter at SypniaAny language, any OpenTelemetry SDK or CollectorSet the standard variables below. No Sypnia package.
The bridge, @sypnia/telemetry/otelNode and Next.js apps that already use OpenTelemetry, or want its instrumentationsAdd Sypnia’s span processor and propagator to your OpenTelemetry setup: OpenTelemetry bridge. It also joins the browser’s session, identifies people and redacts on your server.

A Node or Next.js app without OpenTelemetry does not need either: @sypnia/telemetry/node and @sypnia/telemetry/next trace without it, with a lighter design (see what was measured), and send the same OTLP.

At the end you will have: your backend’s requests in Sypnia’s traces and performance numbers, its exceptions as problems, and its spans joined to the browser’s trace when the request came from a page that runs the browser SDK.

The settings, for every language

You change no code that already works. Set the standard OpenTelemetry environment variables:

Sypnia Cloud

.env
OTEL_EXPORTER_OTLP_ENDPOINT=https://telemetry.ingest.sypnia.com/v1/otlp
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_SERVICE_NAME=shop-api
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=production,service.version=4f2a91c
VariableWhat to putWhy
OTEL_EXPORTER_OTLP_ENDPOINTYour ingest address followed by /v1/otlp.The exporter adds /v1/traces by itself, so spans go to …/v1/otlp/v1/traces.
OTEL_EXPORTER_OTLP_HEADERSAuthorization=Bearer%20 and your ingest key.The key says which project the spans belong to. It is public and can only send. The variable uses the W3C Baggage format, where a space is written %20: every SDK decodes it, and Python refuses a bare space.
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobuf. http/json works too where your SDK offers it (OpenTelemetry makes it optional; the Python and Go SDKs do not have it).Sypnia does not accept gRPC.
OTEL_METRICS_EXPORTER, OTEL_LOGS_EXPORTERnoneSypnia takes traces only. Without this, the exporter keeps trying to send metrics and logs and logs a 404 each time.
OTEL_SERVICE_NAMEA name for this service.It is the name you see on its spans.
OTEL_RESOURCE_ATTRIBUTESdeployment.environment.name and service.version.The environment (default production) and the release. Use the same values as your frontend.

Use the same project as your frontend: a trace connects parts of one project.

By language

Each example assumes the variables above are set. Package and command names are the OpenTelemetry project’s own; check its documentation for your version.

Python

Terminal
pip install opentelemetry-distro opentelemetry-exporter-otlp-proto-http
opentelemetry-bootstrap -a install
opentelemetry-instrument python app.py

Check that it works

  1. Start your service and call one of its routes.
  2. Within 10 minutes the route is listed in Performance with one request, and its trace is in Traces.

To test the address and the key without your app:

Terminal
curl -i -X POST "https://telemetry.ingest.sypnia.com/v1/otlp/v1/traces" \
  -H "Authorization: Bearer spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e" \
  -H "Content-Type: application/json" \
  -d '{"resourceSpans":[]}'
You should see
HTTP/2 200 and the body {}. A 401 means the key is wrong; a 404 means the path is wrong.

Joining the browser’s trace and session

The trace joins by itself. The browser SDK sends the W3C traceparent header with each call to your API, and OpenTelemetry SDKs read it by default. Your server’s spans then carry the browser’s trace id. If the API is on another origin than the page, list it in the browser SDK’s traceTargets and allow the header in CORS: see Browser.

The session needs one attribute. The browser SDK also sends the session’s id in the header x-sypnia-session. Copy it to the span attribute session.id on the server span, and the request appears in that session’s timeline (in Node, the bridge does it for you):

app.py
from flask import Flask, request
from opentelemetry import trace

app = Flask(__name__)

@app.before_request
def link_sypnia_session():
    session_id = request.headers.get("x-sypnia-session")
    if session_id:
        trace.get_current_span().set_attribute("session.id", session_id)

Without it the trace is still joined to the browser’s call, and through that call to the session; the attribute matters for requests whose browser event was lost.

What a span becomes

In OpenTelemetryIn Sypnia
Trace idThe trace’s id.
Resource service.nameThe span’s service.
Resource deployment.environment.name, or the older deployment.environmentThe environment. production when missing.
Resource service.versionThe release.
A span of kind SERVER with http.routeOne request in Performance, and the root of that service’s part of the trace.
A span of kind CLIENT with db.system.nameA database call.
A span of kind CLIENT with http.request.methodA call to another service.
Any other spanAn internal step, shown in the trace.
Span status ERROR, or an exception span eventA failure. An exception with a stack becomes a server-side problem.
Span attribute session.id (32 hex characters)Links the trace to a session.
Span attributes user.id and sypnia.account.idThe person and the account of the request. Without them the trace takes the person of its session.

A server span without http.route is kept and shown in its trace, but it is left out of Performance. Most HTTP server instrumentations set it; if a route is missing from Performance, check that yours does.

Every attribute Sypnia reads, with its type and an example, is in the semantic conventions.

What Sypnia does not use

Sent by OpenTelemetryWhat happens
Metrics and logs (/v1/metrics, /v1/logs)Not accepted: 404. Sypnia does not collect logs or custom metrics.
gRPC transportNot accepted. Use http/protobuf or http/json.
Span events other than exceptionDropped.
Span linksDropped.
tracestate and baggageNot read and not stored.
Attributes whose name contains authorization, cookie, password, secret or tokenDropped at ingest.
More than 64 attributes on a span, or a value longer than 256 charactersThe extra attributes are dropped; long values are cut.
More than 500 spans in one traceThe first 500 are kept; the rest are counted.
The sampling decision in traceparentNot used: Sypnia stores what you send. Sample in your SDK or Collector if you send too much.
The names and e-mails of peopleNot read from any attribute: only the ids in user.id and sypnia.account.id. Names come from the browser’s identify(). See Identifying people.
url.query, url.full, db.query.textDropped at ingest.

Limits of one request are in the API reference: a body of 4,000,000 bytes after decompression and 2,000 spans. The standard batch exporters stay well under both.

What OpenTelemetry costs

An OpenTelemetry SDK runs inside your process, and its cost depends on the language, the SDK and the instrumentations. We measured one case on 2026-11-15: the official Node SDK with its HTTP instrumentation and JSON exporter added ≈ 0.55–0.75 ms of CPU per request, cut throughput by about 40 % when the CPU was the limit, added 600–800 ms before the server could listen and sent 2,560 KB per 1,000 requests; a light tracer of our own, on the same test, added ≈ 0.15 ms and about nothing at startup. One machine, one synthetic workload: the method and the table are on Node, What it costs. We have not measured other languages. To keep the cost down: export in protobuf (http/protobuf), turn off instrumentations you do not read, and sample in your SDK or Collector if you send more than you need.

What you do not get this way

OpenTelemetry sends traces. Sessions, replays, clicks and page performance come from the browser SDK, which works with any backend. On Sypnia Cloud, a trace counts as one event, however many spans it has.

Next

  1. Two doors
  2. The settings, for every language
  3. By language
  4. Check that it works
  5. Joining the browser’s trace and session
  6. What a span becomes
  7. What Sypnia does not use
  8. What OpenTelemetry costs
  9. What you do not get this way
  10. Next

    Search pages, sections and terms