Skip to main content
Kubit reads your agent’s OpenTelemetry traces. If they are not already in your cloud data warehouse, you can send them in three ways, each works for Python and Node. This quickstart helps you pick one, then covers the steps every approach shares: creating an Agent workspace, checking how your span attributes map to fields and finding your first traces in Activity. It takes about 15 minutes.

Choose how to integrate

ApproachWhat it doesUse it whenPage
Agent PluginUse Claude Code or Cursor to find your tracing setup, creates the workspace, mints the API key and adds the Kubit SDK. It shows a diff before every change.You work in Claude Code or Cursor, or you already send traces to Langfuse or BraintrustAgent plugin
Kubit SDKkubit-otel (Python) or @kubit-ai/otel (Node) sends spans with one configure() call. It drops spans that aren’t LLM-related and can mask content before export.You want to wire it by hand with the least codePython, Node
Manual OpenTelemetryThe stock OpenTelemetry SDK and OTLP/HTTP exporter, pointed at Kubit with an x-api-key header. No Kubit package.You already run an OpenTelemetry pipeline, can’t add a dependency, or work in another languageManual OpenTelemetry
The agent plugin writes the same code you’d write with the Kubit SDK, so you can switch between the two later. With manual OpenTelemetry, every span your app records goes to Kubit, including HTTP and database spans. Filter them in your app’s OTel Exporter or with the workspace’s filter rules in Data > Collection > Filtering.

Before you start

  • A Kubit account. Sign-up needs an early-access link from Kubit or an invite from your organization. See Set up your organization.
  • An agent that calls an LLM, in Python 3.9 or later or Node.js 18 or later
  • The Owner or Admin role, to create a workspace and API keys

Steps

1

Get an API key

Kubit authenticates spans with an ingestion API key, read from the KUBIT_API_KEY environment variable. Each key belongs to one workspace.The app shows a new key only once: This is the only time we'll show you this key. Copy it now. Copy it, or click Download for a .env file, then click I’ve Saved It. The downloaded file names the key KUBIT_OTEL_API_KEY, so rename it to KUBIT_API_KEY.Availability: API Keys shows only to the Owner and Admin roles, and only in Agent and User workspaces.
Keep the key out of source control. Put it in .env or your secrets manager, and check that .env is in .gitignore.
Then set it in your shell for the next steps:
2

Install the SDK

If your app reads .env with python-dotenv, keep using it. Kubit reads KUBIT_API_KEY from the environment either way.
3

Add the bootstrap file

Create kubit_instrumentation.py next to your entrypoint:
kubit_instrumentation.py
Change service_name, service_version and deployment.environment to match your app. Kubit uses them to tell agents and releases apart.
If your app already creates an OpenTelemetry TracerProvider, call attach() after trace.set_tracer_provider() instead of configure(). A configure() call that runs before your app sets its provider registers Kubit’s provider first, and your app’s provider is never registered. See Kubit SDK for Python.
4

Import it first in your entrypoint

Make it the first import in main.py, app.py or whichever file starts your app, so the provider exists before any LLM client is created:
main.py
5

Send a test span

From the folder that holds kubit_instrumentation.py, run:
force_flush() sends the span before the process exits. Without it, the span waits up to 5000 ms in the batch. The output includes this line on stderr:
Output
endpoint=<from OTEL_EXPORTER_OTLP_*> is the label kubit-otel prints when you don’t pass endpoint. The SDK still sends to https://otel.kubit.ai/v1/traces.
6

Trace your LLM calls

The test span proves the connection. To trace real agent work, add an OpenTelemetry GenAI instrumentor for your LLM client. For the OpenAI Python SDK:
kubit_instrumentation.py
Then set this env var so spans carry the prompt and response text that Polaris labels:
1

Get an API key

Kubit authenticates spans with an ingestion API key, read from the KUBIT_API_KEY environment variable. Each key belongs to one workspace.The app shows a new key only once: This is the only time we'll show you this key. Copy it now. Copy it, or click Download for a .env file, then click I’ve Saved It. The downloaded file names the key KUBIT_OTEL_API_KEY, so rename it to KUBIT_API_KEY.Availability: API Keys shows only to the Owner and Admin roles, and only in Agent and User workspaces.
Keep the key out of source control. Put it in .env or your secrets manager, and check that .env is in .gitignore.
2

Integrate with your approach

Follow the page for the approach you chose. Each page ends with a test span. Come back here once it’s sent.

Agent Plugin

/kubit-integrate in Claude Code or Cursor

Kubit SDK for Python

kubit-otel with configure() or attach()

Kubit SDK for Node

@kubit-ai/otel with configure() or KubitSpanProcessor

Manual OpenTelemetry

The stock OTLP/HTTP exporter, in Python or Node
3

Check the extraction mapping

The extraction mapping turns span attributes into the fields you filter and group by, such as LLM: Model and Client: User Id. Each workspace starts from a template. To check it against your own spans, open Data > Extraction.
Extraction Mappings section with the summary bar showing TEMPLATE default-otel, STATE Pristine and EVENT TS start_time next to Change template. The grid lists NAME, PARENT_OBSERVATION_ID, START_TIME, USER_ID, SESSION_ID and ERROR_CODE with their Category, Type, Source paths and Sample values. The Raw payload panel on the right shows a recent span, 1 of 20, with its attributes expanded, including gen_ai.conversation.id, gen_ai.tool.name, kubit.sdk.name, session.id and user.id.
  1. The summary bar shows the Template the mapping started from, its State (Pristine, or Customized after an edit) and the Event TS path. Use default-agent. It reads the OpenTelemetry GenAI keys and the keys of Langfuse, LangSmith, the Vercel AI SDK, OpenInference, Traceloop, Braintrust and Mastra. A workspace created by /kubit-integrate starts on default-otel, which reads only the OpenTelemetry GenAI keys. To switch, click Change template, pick default-agent and click Apply template. Applying a template discards your path edits.
  2. Click Run preview. The Raw payload panel loads up to 20 of your most recent spans, and the Sample column shows what each mapped column reads from the selected span.
  3. If a column you need is empty, click Edit on its row and add the attribute under Source paths. Kubit tries the paths in order and uses the first one with a value. To pick a path instead of typing it, use Pick a path from a recent payload below the list.
    Edit source dialog for USER_ID with four numbered Source paths: attributes['enduser.id'], attributes['user.id'], resource.attributes['enduser.id'] and resource.attributes['user.id'], an empty field to add another path, and Pick a path from a recent payload, 1 of 100.
  4. To use an attribute that has no column, such as customer.plan, click Add custom field, set Name, Source paths and Type, and click Add field.
default-agent reads these keys for the fields most reports use, among others:Constraint: A column marked Replay only changes for new spans when you edit it. Existing rows keep their old value until you run a replay from Data > Pipeline.
4

Validate in Activity

First check that spans reach Kubit. Open Data > Pipeline. Under Streaming, Latest event received at shows when the newest span arrived, and Total events · 24H counts the last day. Before the first span arrives, the setup steps show Waiting for first event to arrive.
Pipeline page with the setup steps Config your project and Raw events received checked and First enrichment run pending, above the Streaming section of raw events, tagged Near real-time. Its cards read Latest event received at Nov 18, 2026, 1:05:07 AM UTC+1, Total events · 24H 1,016,981 and Events this hour 906,157, above a bar chart of the last 24 hours.
Then look at the traces:
  1. Open Agent > Activity.
  2. Keep Subject on Trace, keep Time Range on Last 1 Day and click Execute. Activity doesn’t load or refresh on its own. After a run, the header shows when it synced, and Refresh loads newer traces.
    The Activity traces grid after Execute, with a Timeline of trace counts in 5-minute bars and errors in red, above a grid with the columns Timestamp, Name, Spans, Latency, Tokens, Cost, Time To First Token, Environment, Model and Labels. The footer reads 3,000 Traces, 1-50 shown.
  3. Click your test trace. The header shows its Latency, Total cost, Tokens, User and Session. An empty User or Session means the extraction mapping found no ID for it. Click a span in the Timeline to see its Input, Output and Custom Fields on the Preview tab, or switch to JSON or Raw to see the span with every attribute.
    An open trace named Chat with an OK status. The header shows Latency 4.00s, Total cost $0.0011, Tokens 1,930 to 32, a User ID and a Session ID. The Timeline lists the spans Chat, Classify Intent, a gemini-3-flash-preview LLM call, an invoke_agent span and four execute_tool spans. The Details panel's Preview tab shows the Input message, the Output agent and message, and Custom Fields such as Client: Browser and Client: City.

Verify

You’re done when all three are true:
  • Data > Pipeline shows a Latest event received at time from after your test span.
  • Agent > Activity lists your test trace after you click Execute.
  • The trace header shows a User and a Session, if you set those IDs, and the fields you need have values. If one is empty, go back to Check the extraction mapping.

If it fails

Next Steps

  • Concepts: users, sessions, traces, spans and what Polaris labels.
  • Is my data flowing?: step-by-step checks when spans don’t arrive.
  • Agent plugin: query traces and reports from Claude Code or Cursor.