Skip to main content
This guide provides instructions for integrating Comet Opik with the TrueFoundry AI Gateway to export OpenTelemetry traces.

What is Comet Opik?

Comet Opik is an open-source LLM observability and evaluation platform. It ingests OpenTelemetry trace spans over OTLP HTTP and renders them as LLM traces with per-call inputs, outputs, token usage, latency, and cost. It also supports evaluation, scoring, and dataset management on top of the ingested traces.

Key Features of Comet Opik

  • OTLP trace ingestion: Accepts OpenTelemetry spans over HTTP transport at a native OTLP endpoint, so any OTLP-compliant producer can send traces without an SDK.
  • LLM trace and span views: Displays each LLM call with inputs, outputs, token breakdowns, latency, and cost, with nested spans for multi-step pipelines.
  • Evaluation and scoring: Runs automated and human evaluations against traced calls and datasets built from production traffic.

Prerequisites

Before integrating Comet Opik with TrueFoundry, ensure you have:
  1. TrueFoundry Account: Create a TrueFoundry account and follow the instructions in our Gateway Quick Start Guide
  2. Comet Opik Account: A Comet account for Opik Cloud, or a self-hosted / enterprise Opik deployment. You will need your API key, your workspace name, and a target project name.

Understanding the Comet Opik Endpoint

Opik exposes a native OTLP base endpoint at the path /api/v1/private/otel. The host in front of that path depends on your deployment mode:
DeploymentBase endpoint
Opik Cloudhttps://www.comet.com/opik/api/v1/private/otel
Self-hostedhttp://<YOUR-OPIK-INSTANCE>/api/v1/private/otel
Enterprisehttps://<COMET-SERVER>/api/v1/private/otel
TrueFoundry sends traces to the signal-specific endpoint, which is the base endpoint with /v1/traces appended. TrueFoundry does not auto-append this path, so the full path must be entered in the Endpoint field.
Opik ingests traces only. It does not accept OTLP metrics, so you configure the Traces exporter and leave the Metrics exporter disabled. Opik also supports HTTP transport only — do not select the gRPC configuration.

Integration Steps

1

Get Your Opik API Key and Workspace

  1. Log into your Comet Opik account.
  2. Open your account settings and copy your API key.
  3. Note your workspace name (shown in the workspace switcher) and the project name you want traces to land in. The project is created automatically on first ingest if it does not exist.
Comet Opik account menu showing the API Key option and the workspace name
The Authorization header value is the raw API key — do not prefix it with Bearer. This differs from most other OTEL destinations.
2

Configure OTEL Export in TrueFoundry

  1. Go to AI GatewayControlsSettings in the TrueFoundry dashboard.
  2. Scroll down to the OTEL Config section and click the edit (✏️) button.
TrueFoundry AI Gateway Settings page showing the OTEL Data Export Configuration section
  1. Enable the Otel Traces Exporter Configuration toggle and fill in:
FieldValue
ToggleEnabled
ProtocolHTTP Configuration
Endpointhttps://www.comet.com/opik/api/v1/private/otel/v1/traces
EncodingProto
Header KeyAuthorization
Header Value<your-opik-api-key>
Header KeyComet-Workspace
Header Value<your-workspace-name>
Header KeyprojectName
Header Value<your-project-name>
TrueFoundry OTEL Traces Exporter Configuration showing the endpoint, Proto encoding, and the three Comet Opik headers
  1. Leave the Otel Metrics Exporter Configuration toggle disabled — Opik does not accept OTLP metrics.
  2. Click Save to apply the configuration.
For a self-hosted or enterprise Opik deployment, replace the host in the endpoint with your instance host (for example http://<YOUR-OPIK-INSTANCE>/api/v1/private/otel/v1/traces) and keep the same three headers.
3

Verify the Integration

  1. Make a request through the TrueFoundry AI Gateway.
  2. Log into your Comet Opik dashboard and open the Traces view for the project named in the projectName header.
  3. Confirm traces from tfy-llm-gateway are appearing, with inputs, outputs, token usage, and latency populated.
Comet Opik Logs view showing TrueFoundry AI Gateway spans arriving in the project

Configuration Reference

ConfigurationValue
Traces Endpointhttps://www.comet.com/opik/api/v1/private/otel/v1/traces
Metrics EndpointNot supported — Opik ingests traces only
ProtocolHTTP
EncodingProto
Auth Header KeyAuthorization
Auth Header ValueYour Opik API key (raw, no Bearer prefix)
Header KeyComet-Workspace
Header ValueYour Opik workspace name
Header KeyprojectName
Header ValueTarget Opik project name