Documentation Index
Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt
Use this file to discover all available pages before exploring further.
Request Tracing
In a production system, you need to trace a request from entry to response — especially when debugging errors or diagnosing latency.PrismTracingMiddleware assigns unique IDs to every request and propagates correlation IDs across service boundaries.
Quick Setup
Enable Tracing
X-Request-ID. If the client sends one, it’s preserved; otherwise, a new UUID is generated.
How It Works
- Incoming request checked for
X-Request-IDheader - If missing and
generateIfMissingis true, a UUID is generated X-Correlation-IDandX-Parent-IDheaders are captured if present- All IDs stored in
request.userInfofor downstream handlers - Response includes
X-Request-IDandX-Correlation-IDheaders
Configuration
Custom Headers
Accessing Trace Context
Use in Handlers
PrismTraceContext provides:
requestID— unique ID for this requestcorrelationID— groups related requests across servicesparentID— the upstream request that triggered this onestartTime— when the trace was createdelapsed— time since the trace started
Structured Logging
PrismTracingLogger formats log messages with trace context:
Traced Logging
Cross-Service Tracing
When calling other services, forward the trace headers:Propagate to Downstream
Custom Logger
Logger without Context
The request ID is stored in
request.userInfo["traceContext.requestID"]. If you’re accessing it from raw userInfo, remember that the key includes the traceContext. prefix.