Skip to main content
CozeloopExporter reports span data to the Cozeloop platform over OTLP (HTTP). Once connected, you can observe traces with Cozeloop’s trace feature or evaluate agents with its evaluation feature. Data is isolated by workspace (space).

When to use

  • You want to observe your agent’s traces on Cozeloop;
  • You want to analyze conversation quality and tool-usage effectiveness with Cozeloop’s evaluation capabilities;
  • You already have a Cozeloop workspace and access token.

Prerequisites

Complete installation and model configuration, then set the environment variables below before starting Python. Replace placeholders with accessible resources and valid credentials
Cozeloop receives trace data. Specify an existing workspace ID where possible; omitting it attempts to create a default workspace using your token and requires permission to do so. Configuring an exporter does not create or run evaluation tasks

Usage

Save as app.py and run python app.py. The example uses existing resources and flushes pending traces after one model call
app.py
You can also pass connection parameters explicitly via CozeloopExporterConfig:

Parameters

Constructor parameters

CozeloopExporter carries its connection parameters in the config field of type CozeloopExporterConfig; when omitted, each field is read automatically from the corresponding environment variable.

Cozeloop connection config

config is a CozeloopExporterConfig; each field defaults from CozeloopConfig, with the following environment variables:
space_id is taken from the environment variable OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME; when unset, the exporter creates a default workspace automatically using token as the credential. After logging in to Cozeloop, the segment after space in the URL is the workspace ID.
You can also let Agent attach the Cozeloop exporter automatically from an environment variable, without constructing it explicitly:
With ENABLE_COZELOOP=true, Agent creates an OpentelemetryTracer and attaches CozeloopExporter automatically, even when the agent provides no tracers.

Verification and troubleshooting

Search for the run’s Trace ID in the target backend. A successful model response does not prove trace delivery. If data is missing, check the endpoint and region, credential permissions, target resource, and whether tracer.force_export() ran before the process exited
Last modified on September 19, 2026