When your AI application spans multiple services (an API gateway calling an agent service, an orchestrator invoking a Lambda function), you need traces from all services to appear in a single session. Distributed tracing links events across process boundaries so you can debug end-to-end.Documentation Index
Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
Use this file to discover all available pages before exploring further.
Choose Your Approach
HoneyHive supports two approaches. Pick the one that fits your needs.- Session ID (Simple)
- Context Propagation (Full)
Pass the session ID between services so all events land in the same session. Events are grouped together but appear as siblings, not as parent-child.Best for: Simple architectures, serverless (Lambda), cases where you only need events in the same session.
Helper Reference
enrich_span_context()
A context manager that creates a span enriched with HoneyHive-specific fields. Use it on the client side to wrap outgoing calls so the span carries inputs, outputs, and metadata.
| Parameter | Type | Description |
|---|---|---|
event_name | str | (required) Name for the span. |
inputs | dict | Input data recorded on the span. |
outputs | dict | Output data recorded on the span. |
metadata | dict | Arbitrary metadata attached to the span. |
metrics | dict | Numeric metrics (latency, token counts, etc.). |
config | dict | Configuration snapshot for this span. |
user_properties | dict | End-user properties for the request. |
error | str | Error message if the operation failed. |
feedback | dict | Feedback signals (e.g., ratings). |
inject_context_into_carrier()
Injects W3C traceparent, session ID, and project into an outgoing headers dict so the remote service can continue the trace.
| Parameter | Type | Description |
|---|---|---|
headers | dict | HTTP headers dict to inject context into. |
tracer | HoneyHiveTracer | The active tracer instance. |
with_distributed_trace_context()
A context manager used on the server side to extract incoming trace context and attach all child spans to the caller’s trace.
| Parameter | Type | Description |
|---|---|---|
headers | dict | Incoming HTTP request headers. |
tracer | HoneyHiveTracer | The active tracer instance on the server. |
Serverless Environments (AWS Lambda)
For Lambda functions, calltracer.flush() before the handler returns to ensure all spans are exported before the runtime freezes. Use the session ID approach to link Lambda invocations to the calling service.
Lambda install instructions
Lambda install instructions
Use the x86_64 runtime architecture and install the matching binary:
Learn More
Tracing Introduction
Sessions, events, and context propagation concepts
Distributed Tracing Tutorial
End-to-end walkthrough with Google ADK

