OpenTelemetry Export
Este conteúdo não está disponível em sua língua ainda.
Overview
Floopy uses a dual export architecture: every request trace is always stored in ClickHouse for the built-in dashboard, and can optionally be exported in real time to any OpenTelemetry (OTLP) compatible backend. This lets you correlate AI gateway traces with your existing application traces in tools like Datadog, Grafana Tempo, Jaeger, New Relic, or Honeycomb.
How it works:
- The gateway instruments each request as a set of spans (auth, cache, firewall, provider call, etc.)
- Spans are batched and flushed to ClickHouse on a regular interval
- After each ClickHouse flush, if your organization has OTLP export enabled, spans are converted to the OpenTelemetry format and exported in parallel via gRPC or HTTP/protobuf
- OTLP export is fire-and-forget — failures never affect request processing or ClickHouse storage
Span Schema Reference
Resource Attributes
Resource attributes are set on all spans from your organization:
| Attribute | Type | Description | Example |
|---|---|---|---|
service.name | string | Always floopy-gateway | floopy-gateway |
service.version | string | Gateway version from Cargo.toml | 0.1.0 |
floopy.org_id | string | Your organization UUID | 550e8400-e29b-41d4-a716-446655440000 |
floopy.key_id | string | API key UUID used for the request (if available) | d4e5f6a7-b8c9-0123-4567-89abcdef0123 |
Span Attributes
Each span carries attributes describing the request:
| Attribute | Type | Description | Example |
|---|---|---|---|
floopy.request_id | string | Unique request UUID (also used to derive trace_id) | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
floopy.provider | string | AI provider name | openai, anthropic, gemini |
floopy.model | string | Model used for the request | gpt-4o, claude-sonnet-4-20250514 |
floopy.cache_hit | string | Whether the request was served from cache | true, false |
floopy.firewall_result | string | Firewall evaluation result | pass, block |
http.method | string | HTTP method of the original request | POST |
http.status_code | string | HTTP response status code | 200, 429 |
http.url | string | Request URL path | /v1/chat/completions |
Additional custom attributes set by your application are passed through as-is.
Span Field Mapping
Floopy’s internal span format is converted to OTLP as follows:
| Floopy Field | OTLP Field | Notes |
|---|---|---|
request_id | trace_id | Full 16-byte UUID mapped to OTLP trace ID |
span_id | span_id | Last 8 bytes of UUID for maximum entropy |
parent_span_id | parent_span_id | Links child spans to parent operations |
operation_name | name | e.g., auth, cache_lookup, provider_call |
start_time | start_time_unix_nano | Parsed from %Y-%m-%d %H:%M:%S%.3f format |
duration_ms | end_time_unix_nano | Computed as start_time + duration |
status | status | ok → OTLP OK, error → OTLP Error with description |
error_message | status.description | Included when status is error |
attributes | attributes | Key-value pairs mapped to OTLP attributes |
Span Hierarchy Example
A typical request produces a trace with the following span hierarchy:
gateway_request (root span)├── auth # API key validation├── rate_limit # Rate limit check├── cache_lookup # Exact + semantic cache check├── firewall # LLM firewall evaluation│ ├── verdict_cache # Qdrant lookup (skipped on cache miss)│ └── llm_call # Safety-tuned LLM via BackendRouter│ # span fields: backend, model_ref, attempt_count├── provider_call # Upstream AI provider request│ └── retry_attempt # Individual retry attempts (if any)└── post_process # Logging, metering, cache storageSetup Guide
Step 1: Enable OTLP Export in Settings
- Navigate to Settings → Integrations in the Floopy dashboard
- Enter your OTLP collector endpoint URL
- Select the protocol: gRPC or HTTP/protobuf
- Add any required authentication headers (e.g., API keys, bearer tokens)
- Click Test Connection to verify connectivity
- Toggle Enable Export to activate
Step 2: Verify Spans Are Arriving
After enabling, send a few test requests through the gateway and check your observability backend for traces with service.name = floopy-gateway.
Integration Guides
Datadog
| Field | Value |
|---|---|
| Endpoint | https://trace.agent.datadoghq.com (US1) or https://trace.agent.datadoghq.eu (EU) |
| Protocol | HTTP/protobuf |
| Headers | DD-API-KEY: your Datadog API key |
- Use your Datadog site’s intake endpoint
- Traces appear in APM → Traces filtered by
service:floopy-gateway - Create monitors on
floopy.providerorfloopy.modelattributes for per-model alerting
Grafana Cloud / Tempo
| Field | Value |
|---|---|
| Endpoint | https://tempo-us-central1.grafana.net:443 (check your Grafana Cloud stack URL) |
| Protocol | gRPC |
| Headers | Authorization: Basic <base64(instanceId:apiToken)> |
- Find your Tempo endpoint and instance ID in Grafana Cloud → Tempo → Details
- Generate an API token with
traces:writescope - Base64-encode
instanceId:tokenfor the Authorization header - Query traces in Grafana Explore using the Tempo data source
Jaeger
| Field | Value |
|---|---|
| Endpoint | http://localhost:4317 (default Jaeger OTLP gRPC port) |
| Protocol | gRPC |
| Headers | (none required for local Jaeger) |
- Jaeger 1.35+ supports OTLP natively on port 4317 (gRPC) and 4318 (HTTP)
- For older versions, deploy the OpenTelemetry Collector as a bridge
- View traces in the Jaeger UI at
http://localhost:16686
New Relic
| Field | Value |
|---|---|
| Endpoint | https://otlp.nr-data.net:4317 (US) or https://otlp.eu01.nr-data.net:4317 (EU) |
| Protocol | gRPC |
| Headers | api-key: your New Relic Ingest License key |
- Use a License key (not a User key) — find it under API Keys in your New Relic account
- Traces appear in Distributed Tracing filtered by
service.name = floopy-gateway - See New Relic OTLP docs for region-specific endpoints
Honeycomb
| Field | Value |
|---|---|
| Endpoint | https://api.honeycomb.io:443 |
| Protocol | gRPC |
| Headers | x-honeycomb-team: your Honeycomb API key |
- Honeycomb automatically creates a dataset from
service.name(floopy-gateway) - To route to a specific dataset, add the header
x-honeycomb-dataset: your-dataset-name - Use Honeycomb’s query builder to slice traces by
floopy.provider,floopy.model, or any custom attribute
Self-Hosted OpenTelemetry Collector
If you run your own OpenTelemetry Collector, point Floopy directly at it:
| Field | Value |
|---|---|
| Endpoint | http://your-collector:4317 (gRPC) or http://your-collector:4318 (HTTP) |
| Protocol | gRPC or HTTP/protobuf |
| Headers | (depends on your collector auth config) |
Example collector config to receive Floopy spans and export to multiple backends:
receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317
processors: batch: timeout: 5s
exporters: otlp/jaeger: endpoint: jaeger:4317 tls: insecure: true otlp/datadog: endpoint: https://trace.agent.datadoghq.com headers: DD-API-KEY: ${DD_API_KEY}
service: pipelines: traces: receivers: [otlp] processors: [batch] exporters: [otlp/jaeger, otlp/datadog]Troubleshooting
Connection Refused
- Symptom: Test Connection fails with “connection refused”
- Cause: Endpoint is unreachable from the Floopy gateway
- Fix: Verify the endpoint URL and port. Ensure firewalls allow outbound connections from the gateway. For gRPC, the default port is 4317; for HTTP, it’s 4318.
Authentication Failures
- Symptom: Test Connection fails with 401 or 403
- Cause: Missing or incorrect authentication headers
- Fix: Double-check your API key or token. Headers are stored encrypted — re-enter the value if you suspect it was saved incorrectly. Verify the header name matches your backend’s requirements exactly (e.g.,
api-keyvsApi-Key).
TLS / Certificate Errors
- Symptom: Test Connection fails with TLS handshake error
- Cause: Self-signed certificate or missing CA on the gateway host
- Fix: Use
http://for local/internal collectors without TLS. For production, ensure your collector’s certificate is signed by a trusted CA.
Spans Not Appearing After Config Change
- Symptom: Updated endpoint or headers, but spans still go to old destination
- Cause: OTLP configuration is cached in Redis with a 5-minute TTL
- Fix: Wait up to 5 minutes for the cache to expire, or restart the gateway to clear the cache immediately.
Export Timeout
- Symptom: Gateway logs show “OTLP export timed out” warnings
- Cause: Collector is slow to respond or overloaded
- Fix: OTLP export has a 5-second timeout. Check your collector’s health and resource allocation. Consider deploying the collector closer to the gateway to reduce network latency.
Missing Attributes
- Symptom: Spans arrive but are missing expected attributes
- Cause: Attributes are only set when the corresponding data is available in the request
- Fix:
floopy.provider,floopy.model, andfloopy.cache_hitare set by the gateway pipeline. If a request fails before reaching the provider stage, provider-specific attributes won’t be present. This is expected behavior.