Skip to main content
Netra provides official SDKs for Python and TypeScript/JavaScript, enabling you to instrument your AI applications with minimal code changes. Both SDKs share the same core capabilities built on OpenTelemetry.

Choose Your SDK

Python SDK

Full-featured SDK for Python applications with support for decorators, auto-instrumentation, and context managers.

TypeScript SDK

Native TypeScript/JavaScript SDK for Node.js applications with full type support and async patterns.

Installation

pip install netra-sdk

Quick Start

from netra import Netra
from netra.instrumentation.instruments import InstrumentSet

Netra.init(
    app_name="my-ai-app",
    headers=f"x-api-key={os.getenv('NETRA_API_KEY')}",
    environment="production",
    instruments={InstrumentSet.OPENAI, InstrumentSet.LANGCHAIN},
)

What You Can Do

Observability

Auto-instrument LLM providers, frameworks, and databases. Create manual spans with decorators or context managers.

Usage & Traces

Query token usage, costs, and trace data programmatically. Drill into spans for detailed analysis.

Dashboard Query

Build custom analytics queries with flexible metrics, dimensions, and filters. Fetch session summaries and stats.

Evaluation

Manage datasets, run test suites, and score AI outputs using built-in or custom evaluators.

Simulation

Run multi-turn conversation simulations to test your AI agents at scale.

Integrations

Connect with LangChain, LlamaIndex, CrewAI, OpenAI, Anthropic, and many more.

Core Capabilities

CapabilityDescription
Auto-InstrumentationAutomatic tracing for LLM providers, frameworks, and databases
Manual TracingCreate custom spans with full control over attributes and events
DecoratorsSimple function decoration with @agent, @task, and @workflow
Context TrackingSet user, session, and tenant IDs for filtering and analysis
Usage TrackingRecord token usage, costs, and custom metrics
Dashboard QueriesProgrammatic access to analytics and session data
EvaluationRun test suites with datasets and evaluators
SimulationMulti-turn conversation testing against your agents

Environment Variables

Configure the SDK via environment variables:
VariableDescription
NETRA_API_KEYAPI key for authentication
NETRA_APP_NAMEApplication name
NETRA_ENVEnvironment (production, staging, etc.)
NETRA_OTLP_ENDPOINTCustom OTLP endpoint URL
NETRA_TRACE_CONTENTEnable/disable content tracing
NETRA_DEBUGEnable debug logging

Next Steps

Quick Start Guide

Follow the step-by-step guide to instrument your first application with Netra.

Auto-Instrumentation

See all supported libraries and frameworks for automatic tracing.

Manual Tracing

Learn how to create custom spans for fine-grained control over your traces.

Decorators

Use @agent, @task, and @workflow decorators to instrument functions with zero boilerplate.
Last modified on March 17, 2026