Skip to main content

Overview

RDK allows you to attach custom metadata to your traces for better filtering, grouping, and analysis. This includes tags, arbitrary metadata, user IDs, and session IDs.

Tags

Tags are simple string labels for categorizing traces:
Tags are useful for:
  • Environment labels (production, staging, development)
  • Feature flags (new-model, experiment-a)
  • Priority levels (high-priority, batch)

Metadata

Metadata is a dictionary for storing structured data:
Common metadata fields:
  • Business context (order_type, plan, region)
  • Request info (request_id, source)
  • Feature toggles (model_version, experiment)

User ID

Track which user generated a trace:

Session ID

Group traces by session:
Session IDs help you:
  • Track conversation history
  • Debug multi-turn interactions
  • Analyze user journeys

Complete Example

Dynamic Metadata

For dynamic values, use the decorator with a callable:

Filtering Traces

Metadata enables powerful filtering in your dashboard:

Best Practices

Keep metadata values simple (strings, numbers, booleans). Avoid nested objects for better queryability.
  1. Consistent naming - Use a naming convention across your app
  2. Avoid PII - Don’t put sensitive data in metadata
  3. Limit cardinality - High-cardinality values (like UUIDs) can impact query performance
  4. Document your schema - Keep a reference of your metadata fields