Custom instrumentation with @traced
2 days ago

We’ve introduced the @traced
decorator, a powerful new way to capture function-level traces directly in your Python code.
- Automatically logs function inputs, outputs, and metadata
- Supports nested spans and custom span types (LLM, agent, tool, etc.)
- Works seamlessly with the Orq SDK initialization (no separate init required)
- Integrates with OpenTelemetry for end-to-end distributed tracing
This makes it easier than ever to debug, monitor, and observe your applications in real time.
import time
@traced
def process_user(user_id: str, action: str) -> dict:
print('process user')
"""Process user data with custom attributes."""
# Simulate some processing
time.sleep(0.1)
result = {
"user_id": user_id,
"action": action,
"status": "completed",
"timestamp": time.time()
}
return result
To get started, install the Orq.ai SDK for Python
pip install orq-ai-sdk