Direct Trace Ingestion

Send LLM traces to Revefi over OTLP/HTTP from any OpenTelemetry instrumentation — no Revefi SDK required.

Overview

If you already emit OpenTelemetry traces — or you're not on Python — you can stream spans to Revefi without the Revefi LLM SDK. The SDK is only a thin wrapper around a standard OTLP/HTTP exporter; pointing your own exporter at Revefi's endpoint achieves the same result.

Revefi parses spans that follow the OpenTelemetry GenAI semantic conventions and the OpenLLMetry traceloop.* attributes. See Span Structure for the fields Revefi extracts.

Endpoint

POST your OTLP traces here:

EnvironmentURL
Productionhttps://gateway.revefi.com/api/v1/traces/ingest
AUhttps://au.gateway.revefi.com/api/v1/traces/ingest

Request requirements:

PropertyValue
MethodPOST
ProtocolOTLP over HTTP, protobuf encoding
Content-Typeapplication/x-protobuf
AuthorizationBearer <REVEFI_API_TOKEN>
BodyA serialized OTLP ExportTraceServiceRequest protobuf message
Max body size64 MB per request

The response is 200 OK with a JSON body { "insertedCount": <number of spans stored> }.

Configure an OpenTelemetry exporter

Python (OpenTelemetry SDK + OpenLLMetry)

This is exactly what the Revefi LLM SDK does under the hood. Use it when you want full control over the tracer pipeline.

from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from traceloop.sdk import Traceloop
from traceloop.sdk.instruments import Instruments

exporter = OTLPSpanExporter(
    endpoint="https://gateway.revefi.com/api/v1/traces/ingest",
    headers={"authorization": "Bearer <REVEFI_API_TOKEN>"},
)

Traceloop.init(
    app_name="my-llm-app",           # becomes service.name on every span
    disable_batch=False,
    exporter=exporter,
    instruments={Instruments.OPENAI, Instruments.ANTHROPIC, Instruments.LANGCHAIN},
)

Any OpenTelemetry SDK (environment variables)

Most OpenTelemetry SDKs (Python, Node.js, Go, Java, …) honor the standard OTLP environment variables. Point the traces exporter at the Revefi endpoint:

export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://gateway.revefi.com/api/v1/traces/ingest"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="authorization=Bearer <REVEFI_API_TOKEN>"
export OTEL_SERVICE_NAME="my-llm-app"

Then run your application with its usual OpenTelemetry/GenAI instrumentation enabled. As long as the spans carry the gen_ai.* attributes Revefi expects, they will be parsed into LLM metrics.

📌

Endpoint vs. base URL

The variable above expects the full traces path (.../api/v1/traces/ingest). This differs from the Revefi LLM SDK's ingestor_url, which takes only the base URL and appends the path for you.

What to emit

For a span to produce useful metrics, set the GenAI attributes Revefi reads — model, token usage, prompts, completions — and, for cost/usage attribution, traceloop.association.properties.* (user id and custom tags). Follow the OpenTelemetry GenAI semantic conventions for the full attribute set; Span Structure shows the fields Revefi extracts from them.

At minimum, a useful LLM span carries:

  • gen_ai.system, gen_ai.request.model, gen_ai.response.model
  • gen_ai.usage.prompt_tokens, gen_ai.usage.completion_tokens
  • span status (set ERROR on failures so error rate is accurate)
  • start/end timestamps (for latency)

Custom tags and user attribution

Revefi reads the end-user identifier and any custom tags from traceloop.association.properties.* span attributes — the same convention OpenLLMetry uses. Each becomes a filterable, groupable dimension in Revefi:

Span attributeBecomes
traceloop.association.properties.user_iduser_id — the end-user dimension
traceloop.association.properties.<key>a custom tag named <key> (e.g. environment, team)

With OpenLLMetry, set them once per execution context and they are applied to every span emitted afterward:

from traceloop.sdk import Traceloop

Traceloop.set_association_properties({
    "user_id": "user-123",
    "environment": "production",   # custom tag
    "team": "growth",              # custom tag
})

If you instrument manually, set the same attributes directly on each span:

span.set_attribute("traceloop.association.properties.user_id", "user-123")
span.set_attribute("traceloop.association.properties.environment", "production")

What’s Next

See Span Structure for the fields Revefi extracts from each span.

Did this page help you?