Skip to main content
Untrace Routing Light

Overview

Untrace’s intelligent routing engine allows you to send LLM traces to different observability platforms based on configurable rules. Route by model, cost, errors, environment, or any custom criteria.

Model-based Routing

Send traces to different platforms based on the LLM model

Cost-based Routing

Route expensive requests for detailed analysis

Error Routing

Send failed requests to debugging platforms

Sampling

Reduce costs with intelligent sampling

How Routing Works

  1. Trace Capture: Untrace captures LLM traces via SDK or proxy
  2. Rule Evaluation: Traces are evaluated against your routing rules
  3. Destination Selection: Matching rules determine where traces go
  4. Delivery: Traces are sent to selected platforms in parallel

Basic Routing Rules

Simple Model Routing

Route traces based on the LLM model:

Environment-based Routing

Different routing for different environments:

Advanced Routing

Complex Conditions

Use boolean logic for sophisticated routing:

Multi-destination Routing

Send traces to multiple platforms:

Conditional Fields

Include/exclude fields based on destination:

Sampling Strategies

Basic Sampling

Reduce costs by sampling traces:

Adaptive Sampling

Sample based on multiple factors:

Reservoir Sampling

Ensure minimum trace count:

Routing by Criteria

Cost-based Routing

Route based on token costs:

Latency-based Routing

Route slow requests for performance analysis:

Error Routing

Sophisticated error handling:

Dynamic Routing

Tag-based Routing

Route based on custom tags:

A/B Testing

Route traces for platform comparison:

Rule Priority

Rules are evaluated in order. First match wins:

Configuration Examples

Complete Configuration

Programmatic Configuration

Configure routing via SDK:

Best Practices

1. Start Simple

Begin with basic routing and add complexity as needed:

2. Use Sampling Wisely

Balance cost and visibility:
  • 100% for errors and critical paths
  • 10-50% for expensive models
  • 1-5% for high-volume, low-cost requests

3. Monitor Rule Performance

Track routing metrics:

4. Test Before Production

Use test tags to verify routing:

Troubleshooting

Rules Not Matching

Enable debug mode to see rule evaluation:

Delivery Failures

Check delivery status in the dashboard:

Performance Impact

Routing adds minimal overhead:
  • Rule evaluation: < 1ms
  • Parallel delivery to multiple platforms
  • Async processing doesn’t block your app

Next Steps

Dashboard Configuration

Configure routing in the web interface

SDK Reference

Programmatic routing configuration

API Reference

Routing API documentation

Examples

Real-world routing examples