-
Notifications
You must be signed in to change notification settings - Fork 168
Make app field optional in Flask, Starlette and FastAPI instrumentations #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying logfire-docs with
|
Latest commit: |
df85e15
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a4b82e74.logfire-docs.pages.dev |
Branch Preview URL: | https://kludex-feat-no-need-for-app.logfire-docs.pages.dev |
**opentelemetry_kwargs, | ||
) | ||
if app is None: | ||
FastAPIInstrumentor().instrument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it seems too hard to also apply the other fastapi instrumentation, at least comment about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the app instance, how would I go about it to make the custom logic work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if request.app not in registry
then check for a 'global' FastAPIInstrumentation
next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean modifying the patch function below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
@alexmojaki As I told you, this only works if instrumentation happens before import.