Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

genai-instana

The genai-instana package automatically instruments Python GenAI applications for Instana. It captures end-to-end traces for every LLM call — model identifiers, token usage, cost, latency and errors — without requiring instrumentation code.

Prefix your launch command and the wrapper instruments the LLM SDKs and frameworks your application already uses. It can set up telemetry for an application that has none, or attach alongside one that already uses Traceloop/OpenLLMetry or OpenTelemetry directly, leaving that application's own tracing, service identity and exporter intact.

Built and maintained by the Instana GenAI Observability team at IBM.

Early alpha, published for evaluation. Span names, attribute keys and metric names can change between releases. Pin an exact version if you build dashboards or alerts on them.

Installation

Install your application's own dependencies as usual, then add the wrapper to that same environment:

pip install genai-instana

The wrapper re-executes your command with the same interpreter, so it sees exactly the packages that environment has and never changes them.

Quick start

Prefix your existing launch command. No code changes, no decorators, no Traceloop.init().

# Standalone script
genai-instana python my_script.py

# FastAPI service
genai-instana uvicorn app:app --port 8000

# Flask service — the wrapper detects Flask and serves the app
genai-instana python app.py

One HTTP request containing one model call arrives in Instana as:

POST /invoke                 SERVER  (HTTP entry)
└── openai.chat              CLIENT  (model call, named for the provider)

Configuration

Set the service name. Without this variable, every wrapped application on the host reports telemetry under the default service name auto_genai_service.

export OTEL_SERVICE_NAME=my-genai-service

Then point the wrapper at Instana. Choose one of the following options — the wrapper reads whichever set of variables is present.

Option A — Traceloop aliases

export TRACELOOP_BASE_URL=https://<otlp-host>:443
export TRACELOOP_HEADERS="x-instana-key=<agent-key>"

Option B — Standard OpenTelemetry variables

# Local Instana agent
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

# Instana SaaS or agentless OTLP
export OTEL_EXPORTER_OTLP_ENDPOINT=https://<otlp-host>:443
export OTEL_EXPORTER_OTLP_HEADERS="x-instana-key=<agent-key>"

The wrapper exports over OTLP/HTTP: use port 4318 for a local agent and 443 for a SaaS endpoint. The x-instana-host header is set from the host name automatically; override it with OTEL_HOST_NAME. A local agent needs no agent key. A remote endpoint without one warns at startup, because the export would genuinely fail.

Coverage

Category Covered
LLM providers OpenAI and OpenAI-compatible gateways, LiteLLM, IBM watsonx, Groq, and OpenRouter
Frameworks LangChain, LangGraph, and CrewAI
Web servers FastAPI (uvicorn) and Flask

Known limitations

Streaming responses are not supported. Gunicorn, distributed tracing across services and coexistence with the Instana Python sensor are not yet validated. A few gaps remain when an application sets up its own instrumentation. Read the current list in the documentation before relying on this anywhere that matters.

Documentation

Auto-instrumentation CLI wrapper for GenAI — setup, supported technologies, what Instana receives, and known issues.

License

MIT — see the LICENSE file included with this package.

Copyright (c) 2026 IBM Corp. Copyright (c) 2026 Instana, Inc. https://www.instana.com/

Metadata

Release files for genai-instana 0.1.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genai-instana 0.1.0a3
File Size Uploaded
genai_instana-0.1.0a3.tar.gz 260.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genai-instana 0.1.0a3
File Interpreter ABI Platform
genai_instana-0.1.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 404.2 kB

Release files / genai_instana-0.1.0a3.tar.gz

Download URL genai_instana-0.1.0a3.tar.gz
Size 260.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d0b80b58497a2962ec31f16664fb859e5f42471b1b32988ffa9f6031a10c5da
BLAKE2b-256 checksum
How to use checksums
84558d1d576ad8ac63a41dd707a6a1b14ef83c8c4e74f538c28932363c6d08b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / genai_instana-0.1.0a3-py3-none-any.whl

Download URL genai_instana-0.1.0a3-py3-none-any.whl
Size 143.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9eaeaf8eed4f3c8d34f0c0e97dcff0edb2802e450fb2ae7f35833fad546bcf0a
BLAKE2b-256 checksum
How to use checksums
5c7f0ce3bf250453dd49f1c0ade05fb61c3ae43781a2f4e8616cf78f56aca662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page