Distributed Tracing
Auralog automatically generates a trace ID for each SDK session, allowing you to correlate logs across multiple services and see the full request flow.
How It Works
Section titled “How It Works”When you call init(), the SDK generates a unique trace ID. Every log sent during that session includes this trace ID. If your app calls multiple backend services, you can propagate the trace ID so all services log under the same trace.
Automatic Tracing
Section titled “Automatic Tracing”By default, every log includes a trace ID with no extra configuration:
import auralog as al
al.init(api_key="aura_...")
al.auralog.info("request received") # trace ID auto-attachedal.auralog.info("processing complete") # same trace IDPropagating Across Services
Section titled “Propagating Across Services”To correlate logs across services, pass the trace ID in HTTP headers:
Sending service
Section titled “Sending service”import auralog as al
response = requests.post( "https://api.example.com/process", headers={"X-Trace-Id": al.get_trace_id()},)Receiving service (Flask)
Section titled “Receiving service (Flask)”import auralog as alfrom flask import request
al.init(api_key="aura_...")
@app.before_requestdef propagate_trace(): incoming = request.headers.get("X-Trace-Id") if incoming: al.set_trace_id(incoming)
al.auralog.info("processing request") # uses the propagated trace IDReceiving service (FastAPI)
Section titled “Receiving service (FastAPI)”import auralog as alfrom fastapi import Request
al.init(api_key="aura_...")
@app.middleware("http")async def propagate_trace(request: Request, call_next): incoming = request.headers.get("X-Trace-Id") if incoming: al.set_trace_id(incoming) return await call_next(request)Per-Log Trace ID Override
Section titled “Per-Log Trace ID Override”You can override the trace ID for individual logs by including traceId in metadata:
al.auralog.info("external request", metadata={ "traceId": "custom-trace-abc123", "endpoint": "/api/users",})Setting a Custom Trace ID at Init
Section titled “Setting a Custom Trace ID at Init”al.init( api_key="aura_...", trace_id="my-custom-trace-id",)Viewing Traces in the Dashboard
Section titled “Viewing Traces in the Dashboard”In the Log Viewer, logs with a trace ID show a trace icon. Click it to filter the view to all logs sharing that trace ID, displayed in chronological order. You can also search by trace ID:
trace:abc123