Merged
Conversation
Apply Sweep Rules to your PR?
|
josh-hhai
added a commit
that referenced
this pull request
Nov 6, 2025
Addresses #1 user question: 'Where should I initialize the tracer?' New guide at docs/how-to/deployment/tracer-initialization-patterns.rst Covers 5 key scenarios with complete examples: 1. **Local Development / Single Trace** - Global module-level initialization - Simple, efficient for debugging 2. **evaluate() Experiments** - Automatic per-datapoint isolation - SDK manages tracer lifecycle - No global tracer needed 3. **Serverless (AWS Lambda / Cloud Functions)** - Per-request with lazy initialization - Reuses tracer on warm starts - New session per invocation 4. **Long-Running Server (FastAPI / Flask)** - Global tracer + per-request sessions - Middleware-based session management - Distributed tracing support 5. **Testing / Multi-Session** - Multiple tracer instances - Explicit isolation control Features: - Decision matrix for choosing the right pattern - Complete code examples for each scenario - FastAPI middleware implementation - AWS Lambda cold start optimization - Distributed tracing with OpenTelemetry baggage - Troubleshooting section for common issues Addresses confusion from multi-instance architecture where users don't know whether to use global vs per-request initialization patterns. Requested by: Dhruv (addresses recurring support question)
Contributor
|
test |
1 similar comment
Contributor
|
test |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.