How Tags Work
Add tags during execution
Tags appear in the dashboard
Filter traces by tags
Combine tags for precise filtering
production and error to see only production errors.Why Use Tags?
Feature Flagging & Experiments
Feature Flagging & Experiments
prompt:v1) and metadata for detailed attributes.Version Tracking Across Deployments
Version Tracking Across Deployments
version:2.3.0 to see only new deployment errors and compare error rates across versions.Set version tags automatically via environment variables for complete deployment visibility.Environment Separation
Environment Separation
production for real user traffic or staging for pre-release validation.For formal separation with access controls, see Environments.Technique Identification (RAG, Few-Shot, etc.)
Technique Identification (RAG, Few-Shot, etc.)
Error Categorization
Error Categorization
User Cohorts & A/B Testing
User Cohorts & A/B Testing
tier:premium for paying customers or compare latency across regions. Segment cost analysis by customer tier.Avoid PII in tags—use cohort identifiers (tier:premium) not personal info (user:john@example.com).Implementation Guide
Python SDK
Python SDK
- With @observe() Decorator
- With Manual Spans
- Update Current Trace
@observe():@observe() decorator. Minimal code changes required.JavaScript/TypeScript SDK
JavaScript/TypeScript SDK
- Setup
- Context Manager
- observe() Wrapper
- Manual Spans
.env:instrumentation.ts:Best Practices
Keep Tags Simple and Consistent
Keep Tags Simple and Consistent
Establish Naming Conventions Early
Establish Naming Conventions Early
prod vs production vs prd), ensures team-wide consistency, and makes onboarding easier.Never Put PII in Tags
Never Put PII in Tags
Combine Tags with Metadata Strategically
Combine Tags with Metadata Strategically
Tag Dynamically Based on Runtime Conditions
Tag Dynamically Based on Runtime Conditions
Limit the Number of Tags Per Trace
Limit the Number of Tags Per Trace
Tags vs Metadata vs Environments
Choosing the right feature for your use case:| Feature | Best For | Example Use Cases |
|---|---|---|
| Tags | Simple categorization, filtering, experiments | rag, production, beta, v2.1.0, few-shot |
| Metadata | Structured data, detailed attributes, analytics | {"tenant_id": "acme", "user_tier": "premium", "prompt_tokens": 1523} |
| Environments | Formal separation with access controls | Development, Staging, Production projects |
- Tag with environment (
production) AND use dedicated ABV Environments for formal separation - Tag with experiment variant (
prompt:v2) AND include detailed metadata ({"variant_id": "abc123", "assignment_ts": "2024-01-15T10:30:00Z"}) - Tag with feature (
rag) AND include metadata about the RAG implementation ({"chunks": 5, "embedding_model": "text-embedding-ada-002"})