Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Migrating from Laminar

cetra reads the spans that the Laminar Python SDK produces, so you can keep your Laminar instrumentation while you move.

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.

The fixtures show the Laminar SDK 0.8.8 producing these, and cetra reading them:

  • @observe spans become chain spans, and LLM spans become llm spans, 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 @observe become 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.
  • 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.
  • The fixtures are Python only.
  • The settings above export over HTTP. Laminar’s default export is gRPC. The fixtures were captured over HTTP.