Skip to main content
Untrace Elixir SDK Light

Overview

The Untrace Elixir SDK provides zero-latency LLM observability with automatic instrumentation for all major LLM providers. Built on OpenTelemetry standards, it captures comprehensive trace data and routes it to your chosen observability platforms.

Quick Start

Start tracing LLM calls in minutes

Framework Support

Phoenix, LiveView, and OTP applications

OTP Integration

Built for Elixir’s actor model and supervision trees

Examples

Real-world examples and best practices

Installation

Add untrace_sdk to your list of dependencies in mix.exs:
Then run:

Quick Start

Basic Setup

Synchronous Usage

GenServer Usage

Configuration

Client Configuration

Environment Variables

The SDK supports configuration via environment variables:

Application Configuration

Framework Integration

Phoenix Framework

Phoenix LiveView

GenServer Integration

Task Integration

Advanced Usage

Custom Trace Attributes

Batch Tracing

Error Handling

Context Managers

Telemetry Integration

The SDK emits telemetry events for monitoring:

Custom Telemetry Handlers

Examples

OpenAI Integration

Batch Processing

Stream Processing

OTP Integration

Supervision Tree

Dynamic Supervision

Best Practices

1. Use Named Processes

2. Handle Errors Gracefully

3. Use Context Managers

4. Initialize in Application

Troubleshooting

Common Issues

API Reference

Untrace.Client

The main client module for interacting with the Untrace API.

Functions

  • start_link/1: Start a new client process
  • trace/2: Send a trace event
  • trace_batch/2: Send multiple traces in batch
  • update_trace/3: Update an existing trace
  • get_trace/2: Retrieve a trace by ID
  • stop/1: Stop the client process

Configuration

Error Types

  • {:error, :validation_error, message}: Raised when request validation fails
  • {:error, :api_error, message}: Raised when API requests fail
  • {:error, :network_error, reason}: Raised when network requests fail

Support

Next Steps

Dashboard Guide

Learn to use the Untrace dashboard

Configuration

Configure your observability setup

Examples

Browse Elixir example implementations

API Reference

Complete API documentation