Types of Enrichments
HoneyHive organizes custom attributes into typed namespaces. Each has a dedicated guide.User Properties
Attach user IDs, account tiers, and other user context for per-user filtering and analysis.
User Feedback
Capture thumbs-up/down ratings, comments, and implicit signals directly on traces.
Custom Metrics
Log evaluation scores, guardrail results, and other numeric measurements computed in your app.
Config
Log prompt versions, model parameters, and other configuration context on traces.
Online Experiments
Tag traces with experiment IDs and variant names to analyze A/B tests in HoneyHive.
metadata by default.
For the full list of namespaces and data types, see the Schema Reference.
How to Enrich
There are three functions, each scoped to a different level of your trace.- enrich_session()
- enrich_span()
- using_attributes
Set attributes once and apply them to all traces in the session. Ideal for tenant context, app version, or user tier.
Global vs Instance Methods
Invocation Patterns
Bothenrich_span() and enrich_session() accept data in several forms.
Simple dictionary
Simple dictionary
Keyword arguments
Keyword arguments
Explicit namespaces
Explicit namespaces
Organize data by type using named parameters:
Mixed (namespaces + keywords)
Mixed (namespaces + keywords)
Extra keyword arguments are added to
metadata automatically:Common Use Cases
User context
User context
Attach user identity and message metadata to every traced call.
Feature tracking
Feature tracking
Tag traces by feature to compare performance across different parts of your app.
Request metadata (Flask)
Request metadata (Flask)
Capture HTTP request context for correlating traces with API traffic.
Business metrics
Business metrics
Log scores and experiment variants alongside your traces.
Performance monitoring
Performance monitoring
Record custom timing and throughput alongside auto-captured latency.
Error context
Error context
Enrich spans with success/failure status and error details for debugging.
Putting It All Together
This example combines session-level and span-level enrichment in a single application.Full example: session + span enrichment
Full example: session + span enrichment
Viewing Enriched Data
Inspect a session
Click any session to expand it. Your enriched data appears in the Metadata and Attributes panels.
Filter and analyze
Use enriched fields to filter events, build custom charts, or set up alerts.
Best Practices
| Do | Don’t |
|---|---|
| Use consistent key names across your app | Include sensitive data (passwords, API keys, PII) |
| Add user/session IDs for debugging | Attach large values (>1KB per field) |
| Include feature and endpoint identifiers | Use random or generated key names |
Use descriptive names (user_id not uid) | Duplicate data already captured by auto-instrumentation |

