Documentation Index
Fetch the complete documentation index at: https://docs.latitude.so/llms.txt
Use this file to discover all available pages before exploring further.
Connect with Any OpenTelemetry Exporter
Latitude’s ingestion endpoint speaks standard OTLP over HTTP. If your language has an OpenTelemetry SDK (Go, Java, Ruby, Rust, .NET, Elixir, PHP, etc.), you can send traces to Latitude without a Latitude-specific library.Using TypeScript or Python? The dedicated SDKs handle all of this for you with a single function call. See the TypeScript SDK or Python SDK instead.
Prerequisites
- A Latitude API key — generate one from your project settings in the Latitude dashboard.
- Your project slug — visible in the project settings or URL.
Endpoint and Headers
| Value | |
|---|---|
| URL | https://ingest.latitude.so/v1/traces |
| Method | POST |
Authorization | Bearer <your-api-key> |
X-Latitude-Project | <your-project-slug> |
Content-Type | application/json or application/x-protobuf |
ExportTraceServiceRequest body and returns 202 on success.
Verify with curl
A minimal request to confirm connectivity (replace the placeholders):202 response with {} means the endpoint accepted your payload.
Language Examples
Every OpenTelemetry SDK lets you configure an OTLP HTTP exporter with a custom endpoint and headers. Below are the key configuration snippets — the rest of your OTel setup (tracer provider, instrumentations, etc.) stays the same as usual.Go
Java
Ruby
.NET
Environment Variables (Any Language)
Most OpenTelemetry SDKs respect standard environment variables, so you can often skip code changes entirely:Latitude Span Attributes
All spans reaching the endpoint are ingested. To get the most out of the Latitude UI (filtering by user, session, tags), set these optional span attributes:| Attribute | Type | Description |
|---|---|---|
latitude.capture.name | string | A name for the capture context (e.g. "handle-user-request") |
latitude.tags | string (JSON array) | Tags for filtering, e.g. '["production","v2"]' |
latitude.metadata | string (JSON object) | Arbitrary key-value pairs, e.g. '{"requestId":"abc"}' |
session.id | string | Group related traces into a session |
user.id | string | Associate traces with a specific user |
GenAI Span Attributes (LLM Metadata)
Latitude follows the OpenTelemetry Semantic Conventions for Generative AI (v1.37+). When your spans includegen_ai.* attributes, the Latitude UI displays full LLM call details: the provider, model, input/output messages, token usage, cost, and latency.
Refer to the GenAI span semconv spec for the full attribute list. The message content attributes use the standard OpenTelemetry GenAI parts-based message format, shown below.
Message Format
Latitude expects the standard parts-based GenAI message format. Each message has arole and an array of parts:
gen_ai.input.messages (JSON string):
gen_ai.output.messages (JSON string):
gen_ai.system_instructions (JSON string):
Existing Observability Stack
Latitude works alongside your existing observability tools. In TypeScript,new Latitude() detects common OpenTelemetry-compatible providers (Sentry, Datadog, New Relic, Honeycomb, and custom OTel SDKs) and attaches Latitude when possible. In Python, Latitude(...) attaches to the registered OpenTelemetry provider when one already exists or creates one when none exists. Custom setups in either SDK can also add LatitudeSpanProcessor as an additional span processor so traces go to both Latitude and your current backend.
await latitude.ready is optional in these examples. Use it during startup only when you need to guarantee Latitude’s instrumentations are registered before the first LLM call.
With Datadog (TypeScript)
With Sentry (TypeScript)
With New Relic (TypeScript)
Enable New Relic’s OpenTelemetry bridge first, then constructnew Latitude(). New Relic registers an OpenTelemetry provider that Latitude can reuse.
With Honeycomb (TypeScript)
Start Honeycomb’sHoneycombSDK first, then construct new Latitude(). Honeycomb registers an OpenTelemetry provider that Latitude can reuse.
Other Platforms
For any observability platform that supports OpenTelemetry (Jaeger, Grafana Tempo, etc.), the pattern is the same: initialize the existing SDK first and then constructLatitude, or configure an additional OTLP exporter pointed at https://ingest.latitude.so/v1/traces with the required Authorization and X-Latitude-Project headers alongside your existing exporter.
Troubleshooting
401 Unauthorized
TheAuthorization header must use the Bearer prefix (with a space). Double-check your API key is valid and not expired.
400 Bad Request — missing project header
TheX-Latitude-Project header is required on every request. Ensure it is present and spelled correctly, and that the value matches a project slug in the organization associated with your API key.
202 but no traces visible
- Empty body: An empty request body is accepted with
202but produces no traces. Ensure your exporter is actually attaching span data. - Smart filter (SDK only): If you are using a Latitude SDK’s
LatitudeSpanProcessor, only LLM-relevant spans are exported by default. This does not apply when sending OTLP directly — all spans are ingested. - Flush before exit: Make sure your tracer provider flushes pending spans before the process exits.
Traces appear but show no model, tokens, or messages
This is the most common issue when integrating via the generic OTLP exporter. Your exporter is configured correctly (you get202 and traces appear), but the Latitude UI shows empty LLM metadata.
Cause: Your spans are missing the gen_ai.* semantic convention attributes. Configuring the exporter only ensures spans reach Latitude — it does not add LLM metadata. You must explicitly set attributes like gen_ai.provider.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.input.messages, etc. on your spans.
Fix: See GenAI Span Attributes (LLM Metadata) above for the full list of attributes and message format. At a minimum, set:
gen_ai.provider.name— provider name (e.g."openai","anthropic"). Latitude also accepts the deprecatedgen_ai.systemas a fallback for older emitters.gen_ai.request.model— model namegen_ai.operation.name— set to"chat"gen_ai.usage.input_tokensandgen_ai.usage.output_tokens— token countsgen_ai.input.messagesandgen_ai.output.messages— the actual conversation content
If you use a Latitude SDK or an OpenTelemetry auto-instrumentation library (e.g.
opentelemetry-instrumentation-openai), these attributes are set automatically. This section only applies when you manually create spans for LLM calls without auto-instrumentation.Encoding
The endpoint accepts bothapplication/json (JSON-encoded OTLP) and application/x-protobuf (protobuf-encoded OTLP). Most OTel SDK exporters default to protobuf; both work.