Untrace SDKs

Untrace provides native SDKs for all major programming languages, each designed to integrate seamlessly with your existing codebase and framework of choice.

Supported Languages

Quick Comparison

LanguagePackage ManagerKey FeaturesBest For
JavaScript/TypeScriptnpm install @untrace/sdkDecorators, Auto-instrumentationWeb apps, APIs, Full-stack
Pythonpip install untrace-sdkAsync/await, Context managersML/AI apps, APIs, Data processing
Gogo get github.com/untrace-dev/untrace-sdk-goContext propagation, PerformanceMicroservices, APIs, CLI tools
Rustcargo add untrace-sdkZero-cost abstractions, Memory safetyHigh-performance systems, WebAssembly
C#/.NETdotnet add package Untrace.SdkDI integration, ActivitiesEnterprise apps, Windows services
Elixir{:untrace_sdk, "~> 0.1.2"}OTP integration, TelemetryReal-time apps, Distributed systems

Common Features

All SDKs provide:
  • Zero-latency instrumentation - Minimal performance overhead
  • OpenTelemetry compliance - Industry-standard observability
  • Automatic provider detection - Works with all major LLM providers
  • Token usage tracking - Automatic cost calculation
  • Error handling - Comprehensive error capture and reporting
  • Custom attributes - Add your own metadata and context
  • Sampling support - Control data volume and costs
  • Batch processing - Efficient data transmission

Getting Started

1. Choose Your Language

Select the SDK that matches your tech stack:
  • Web Development: JavaScript/TypeScript, Python, C#/.NET
  • Microservices: Go, Rust, Elixir
  • AI/ML: Python, JavaScript/TypeScript
  • High Performance: Rust, Go
  • Enterprise: C#/.NET, Java (coming soon)

2. Install the SDK

Each language has its own installation method:
npm install @untrace/sdk

3. Initialize and Start Tracing

import { init } from '@untrace/sdk';

const untrace = init({
  apiKey: 'your-api-key',
  serviceName: 'my-app'
});

Framework Integration

Web Frameworks

FrameworkJavaScriptPythonGoRustC#Elixir
React/Next.js
Express
FastAPI
Django
Flask
Gin
Echo
Fiber
Axum
Actix
ASP.NET Core
Phoenix

AI/ML Frameworks

FrameworkJavaScriptPythonGoRustC#Elixir
LangChain
LlamaIndex
OpenAI
Anthropic
Hugging Face

Migration Between Languages

If you’re switching between languages or have a polyglot codebase, Untrace makes it easy to maintain consistent observability:

Consistent Data Model

All SDKs use the same trace data structure:
{
  "event_type": "llm_call",
  "data": {
    "model": "gpt-4",
    "prompt": "Hello world",
    "response": "Hello! How can I help?",
    "tokens_used": 25
  },
  "metadata": {
    "user_id": "user123",
    "session_id": "session456"
  }
}

Cross-Language Correlation

Traces from different languages are automatically correlated using:
  • Trace IDs - Unique identifiers for each trace
  • Parent-Child relationships - Link related operations
  • Workflow IDs - Group related traces across services
  • User/Session context - Maintain user journey across languages

Best Practices

1. Choose the Right SDK

  • JavaScript/TypeScript: Web applications, full-stack development
  • Python: AI/ML applications, data processing, APIs
  • Go: Microservices, high-performance APIs, CLI tools
  • Rust: High-performance systems, WebAssembly, embedded
  • C#/.NET: Enterprise applications, Windows services
  • Elixir: Real-time applications, distributed systems

2. Consistent Naming

Use consistent naming conventions across all your services:
// JavaScript
const trace = await untrace.trace("llm_call", {
  model: "gpt-4",
  prompt: message
});
# Python
trace = await client.trace("llm_call", {
    "model": "gpt-4",
    "prompt": message
})

3. Shared Context

Pass context between services using standard headers:
// JavaScript - Set headers
const response = await fetch('/api/process', {
  headers: {
    'X-Trace-ID': traceId,
    'X-User-ID': userId
  }
});
// Go - Read headers
traceID := r.Header.Get("X-Trace-ID")
userID := r.Header.Get("X-User-ID")

Next Steps