Migrating from Laminar
cetra reads the spans that the Laminar Python SDK produces, so you can keep your Laminar instrumentation while you move.
Point the exporter at cetra
Section titled “Point the exporter at cetra”Laminar can export OpenTelemetry over HTTP to a base URL and a port, and sends your project key as a bearer token. The fixtures were captured with these settings, with the host and the key changed.
from lmnr import Laminar
Laminar.initialize( project_api_key="<SK_CETRA_KEY>", base_url="http://localhost", http_port=8080, force_http=True,)Replace <SK_CETRA_KEY> with your sk-cetra- API key.
What carries over
Section titled “What carries over”The fixtures show the Laminar SDK 0.8.8 producing these, and cetra reading them:
@observespans becomechainspans, and LLM spans becomellmspans, with the OpenAI messages, the model, the token counts including cache and reasoning tokens, and the cost.- Session ID, user ID, tags and metadata set on
@observebecome the cetra session, user, tags and metadata. The LLM child span carries the session and user too. - Tool spans keep their input as JSON and their output as text.
- Streamed completions are captured.
What changes
Section titled “What changes”- Laminar’s evaluations, datasets and scores are not spans. Use cetra’s Scores, Datasets and Experiments.
- Spans arrive in cetra under cetra’s own names and fields. See Span attributes for the Laminar attributes cetra reads.
Limits
Section titled “Limits”- The fixtures are Python only.
- The settings above export over HTTP. Laminar’s default export is gRPC. The fixtures were captured over HTTP.
- Traces: read the trace as a tree and a timeline.
- Cost and tokens: how cost is computed from the token counts.
- Online rules: score these traces automatically.