Skip to content

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Jul 7, 2025

@alexmojaki As I told you, this only works if instrumentation happens before import.

@Kludex Kludex marked this pull request as draft July 7, 2025 06:49
Copy link

cloudflare-workers-and-pages bot commented Jul 7, 2025

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@Kludex Kludex marked this pull request as ready for review July 17, 2025 09:08
@Kludex Kludex requested a review from alexmojaki July 17, 2025 09:09
**opentelemetry_kwargs,
)
if app is None:
FastAPIInstrumentor().instrument(
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants