# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json service: auth: true base-path: /api/public endpoints: exportTraces: docs: | **OpenTelemetry Traces Ingestion Endpoint** This endpoint implements the OTLP/HTTP specification for trace ingestion, providing native OpenTelemetry integration for Langfuse Observability. **Supported Formats:** - Binary Protobuf: `Content-Type: application/x-protobuf` - JSON Protobuf: `Content-Type: application/json` - Supports gzip compression via `Content-Encoding: gzip` header **Specification Compliance:** - Conforms to [OTLP/HTTP Trace Export](https://opentelemetry.io/docs/specs/otlp/#otlphttp) - Implements `ExportTraceServiceRequest` message format **Documentation:** - Integration guide: https://langfuse.com/integrations/native/opentelemetry - Data model: https://langfuse.com/docs/observability/data-model method: POST path: /otel/v1/traces request: name: OtelTraceRequest body: properties: resourceSpans: type: list docs: Array of resource spans containing trace data as defined in the OTLP specification content-type: application/json response: OtelTraceResponse examples: - name: BasicTraceExport docs: Example JSON payload for exporting a simple trace with one span request: resourceSpans: - resource: attributes: - key: service.name value: stringValue: "my-service" - key: service.version value: stringValue: "1.0.0" scopeSpans: - scope: name: "langfuse-sdk" version: "2.60.3" spans: - traceId: "0123456789abcdef0123456789abcdef" spanId: "0123456789abcdef" name: "my-operation" kind: 1 startTimeUnixNano: "1747872000000000000" endTimeUnixNano: "1747872001000000000" attributes: - key: "langfuse.observation.type" value: stringValue: "generation" status: {} response: body: {} types: OtelResourceSpan: docs: Represents a collection of spans from a single resource as per OTLP specification properties: resource: type: optional docs: Resource information scopeSpans: type: optional> docs: Array of scope spans OtelResource: docs: Resource attributes identifying the source of telemetry properties: attributes: type: optional> docs: Resource attributes like service.name, service.version, etc. OtelScopeSpan: docs: Collection of spans from a single instrumentation scope properties: scope: type: optional docs: Instrumentation scope information spans: type: optional> docs: Array of spans OtelScope: docs: Instrumentation scope information properties: name: type: optional docs: Instrumentation scope name version: type: optional docs: Instrumentation scope version attributes: type: optional> docs: Additional scope attributes OtelSpan: docs: Individual span representing a unit of work or operation properties: traceId: type: optional docs: Trace ID (16 bytes, hex-encoded string in JSON or Buffer in binary) spanId: type: optional docs: Span ID (8 bytes, hex-encoded string in JSON or Buffer in binary) parentSpanId: type: optional docs: Parent span ID if this is a child span name: type: optional docs: Span name describing the operation kind: type: optional docs: Span kind (1=INTERNAL, 2=SERVER, 3=CLIENT, 4=PRODUCER, 5=CONSUMER) startTimeUnixNano: type: optional docs: Start time in nanoseconds since Unix epoch endTimeUnixNano: type: optional docs: End time in nanoseconds since Unix epoch attributes: type: optional> docs: Span attributes including Langfuse-specific attributes (langfuse.observation.*) status: type: optional docs: Span status object OtelAttribute: docs: Key-value attribute pair for resources, scopes, or spans properties: key: type: optional docs: Attribute key (e.g., "service.name", "langfuse.observation.type") value: type: optional docs: Attribute value OtelAttributeValue: docs: Attribute value wrapper supporting different value types properties: stringValue: type: optional docs: String value intValue: type: optional docs: Integer value doubleValue: type: optional docs: Double value boolValue: type: optional docs: Boolean value OtelTraceResponse: docs: Response from trace export request. Empty object indicates success. properties: {}