Global Instrumentation
Useinstrument() to patch SDK classes at startup. This automatically tracks all client instances.
MeterOptions
Async Instrumentation
For async applications, useinstrument_async():
InstrumentationResult
Checking Status
Removing Instrumentation
Provider-Specific Instrumentation
Instrument providers individually:Runtime Updates
Update options at runtime:Control Agent Access
Access the control agent for advanced operations:Framework Integration
FastAPI
Django
Flask
Best Practices
Do's and Don'ts
Do's and Don'ts
Do:
- Call
instrument()once at application startup - Use
instrument_async()for async applications with control server - Clean up with
uninstrument()on shutdown - Use
get_context_idfor per-user tracking
- Call
instrument()multiple times - Create SDK clients before calling
instrument() - Mix sync and async instrumentation functions