OTLP ingest
OTLP/HTTP traces on the Spanport gateway. JSON and protobuf accepted; fan-out is JSON to destinations after decode.
Endpoints
| Env | URL |
|---|---|
| Local | http://127.0.0.1:4318/v1/traces |
| Hosted (planned) | https://otlp.spanport.dev/v1/traces |
Set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to the full traces path, or OTEL_EXPORTER_OTLP_ENDPOINT to the gateway root (SDK appends /v1/traces).
Content types
application/json— OTLP JSONapplication/x-protobuf/application/protobuf— OTLP binary
Swarm attributes
Prefer resource or span attributes (also accepted via baggage):
| Key | Use |
|---|---|
swarm.id | Owning / calling swarm |
agent.id / agent.role | Agent within the swarm |
swarm.peer_id | Peer swarm on cross-fleet calls |
handoff.id | Correlate handoffs across trust boundaries |
Propagate W3C traceparent, tracestate, and baggage on swarm↔swarm RPC — Spanport preserves them on fan-out but cannot invent a shared trace if the runtime drops headers.
OpenTelemetry Node (example)
import { NodeSDK } from "@opentelemetry/sdk-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
const exporter = new OTLPTraceExporter({
url: process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
headers: {
Authorization: `Bearer ${process.env.SPANPORT_API_KEY}`,
},
});
const sdk = new NodeSDK({ traceExporter: exporter });
await sdk.start();