Skip to main content

How Tags Work

1

Add tags during execution

Use the ABV SDK to attach one or more string tags to a trace. Tags can be added when creating a trace or updated later during execution.
2

Tags appear in the dashboard

All tags attached to a trace are visible in the ABV UI. You’ll see them as clickable labels on each trace, making it easy to identify categories at a glance.
3

Filter traces by tags

Click any tag in the UI to filter your trace list. The filter shows only traces that include that specific tag, reducing noise and focusing your analysis.
4

Combine tags for precise filtering

Use multiple tag filters simultaneously to narrow down exactly what you need. For example, filter by both production and error to see only production errors.
5

Use tags in analytics and exports

Tags are included in all exports and available for grouping in custom dashboards. Use them to segment performance metrics, cost analysis, or error rates by any dimension you choose.

Why Use Tags?

A/B testing a new prompt? Tag each variant to measure quality, latency, and cost separately.
Filter by tag to compare metrics side-by-side and make data-driven rollout decisions.Combine with metadata for richer analysis: use tags for simple categories (prompt:v1) and metadata for detailed attributes.
Tag traces with your application version to isolate errors by deployment.
Filter by 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.
Separate dev, staging, and production traffic for clearer debugging.
Filter by production for real user traffic or staging for pre-release validation.For formal separation with access controls, see Environments.
Tag traces by LLM technique (RAG, few-shot, chain-of-thought) to analyze performance and cost.
Compare metrics to discover that RAG costs 3x more than few-shot or that chain-of-thought has higher latency but better accuracy.Optimize technique selection based on cost and performance data.
Categorize errors for effective triage: rate limits, validation failures, or unexpected errors.
Filter by error type to identify quota issues, bad input, or unexpected failures.Set up alerts on specific error tags to get notified only for critical issues.
Tag traces with user cohorts to measure adoption and performance across customer segments.
Filter by 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

The simplest approach for functions already decorated with @observe():
When to use: For functions already using the @observe() decorator. Minimal code changes required.
Installation:
See Python SDK docs for complete reference.
Install packages:
Add credentials to .env:
.env
Create instrumentation.ts:
instrumentation.ts
See JS/TS SDK docs for complete reference.

Best Practices

Use lowercase, hyphenated strings for reliability and readability:Good examples:
  • rag, production, few-shot
  • error, beta, v2.1.0
  • document-processing, cache-hit
Avoid:
  • Spaces: "rate limit error" β†’ use rate-limit-error
  • Mixed case: ProductionEnv β†’ use production
  • Special characters: user@premium β†’ use user-premium
Why it matters: Consistent formatting makes tags easier to filter, prevents duplicate categories, and ensures reliable UI behavior.
Define and document tag patterns for your team before scaling:Option 1: Namespaced tags
Option 2: Simple tags
Create a tag dictionary: Document your conventions in your team wiki or codebase:
Why it matters: Prevents tag proliferation (prod vs production vs prd), ensures team-wide consistency, and makes onboarding easier.
Tags are designed for categorization, not sensitive data. They appear in UI filters, exports, and analytics dashboards.❌ Don’t use:
βœ… Instead use:
Why it matters: Tags are visible to all project members and appear in exported data. PII in tags creates compliance risks and potential data leaks. Use metadata with appropriate access controls for sensitive identifiers.
Use both features together for maximum flexibility:Tags: Simple categories for filtering
Use when you need to:
  • Filter traces quickly in the UI
  • Create alerts on specific categories
  • Group metrics by common dimensions
Metadata: Detailed attributes for analysis
Use when you need to:
  • Store structured data for custom queries
  • Track numeric metrics (tokens, latency, cost)
  • Include detailed context for debugging
Example combining both:
Why it matters: Tags give you fast filtering. Metadata gives you deep analysis. Together they provide both speed and depth.
Add tags based on execution paths, not just static configuration:
Why it matters: Dynamic tagging captures what actually happened during execution, making it easier to identify patterns, debug issues, and optimize performance.
Keep tag lists focused and meaningful:Recommended: 3-7 tags per traceGood - focused and actionable:
Too many - loses signal in noise:
Strategy: Ask β€œWill I actually filter by this?” If not, put it in metadata instead.Why it matters: Too many tags make the UI cluttered and filtering less effective. Focus on tags you’ll actually use for filtering, grouping, or alerting.

Tags vs Metadata vs Environments

Choosing the right feature for your use case: When to use multiple features together:
  • 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"})

Metadata

Add structured key-value data to traces for detailed filtering and analytics

Environments

Separate development, staging, and production with dedicated projects and access controls

Sessions

Group related traces by user journey or workflow for end-to-end visibility

Trace IDs

Track requests across distributed services with custom trace IDs