Skip to main content
This quickstart sends spans from a Python app to Kubit Atlas. At the end you’ll have a test span in your workspace and your agent’s LLM calls traced. It takes about 10 minutes. For Node, Langfuse or Braintrust, use Set up with your coding agent instead. It detects your setup and picks the right path.

Before you start

  • Python 3.9 or later
  • A Kubit workspace and its ingestion API key (see below)
  • An agent that calls an LLM, or any Python script to test with

Prompt for your coding agent

Paste this into Claude Code, Cursor or Codex in your repo:

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.
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. Atlas uses them to tell agents and releases apart.
If your app already creates an OpenTelemetry TracerProvider, don’t call configure(). Call attach() after the provider is set instead. See Send traces from 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:
The two-second sleep gives the exporter time to send the span before the process exits.
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:

Verify

Check that the hello-kubit span arrived. With the Kubit MCP server connected in Claude Code or Cursor, ask:
“Show me traces from the last 15 minutes”
The result lists a trace whose root span is named hello-kubit, from service support-agent. In the Kubit app:

If it fails

More checks are in Is my data flowing?.

Next steps