Agent Development
Instrumentation
How to emit custom logs, metrics, and traces.
OpenTelemetry Integration
The runtime automatically captures incoming/outgoing requests. However, you often want to trace internal logic.
Python Example
Use the standard OpenTelemetry SDK. The sidecar acts as the collector agent.
python
from opentelemetry import trace
tracer = trace.get_tracer(__name__)
def process_data(data):
with tracer.start_as_current_span("heavy_processing"):
# Your slow logic here
passLogging
Just print to stdout/stderr. Consonant captures these logs and correlates them with the active trace ID.
python
import logging
# This log will appear in the dashboard linked to the specific request
logging.info("Processing user request...")