Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Kludex wants to merge 11 commits into main
base: main
Choose a base branch
Loading
from kludex/feat/no-need-for-app

Conversation

@Kludex
Copy link
Member

@Kludex Kludex commented Jul 7, 2025
edited
Loading

@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
edited
Loading

Deploying logfire-docs with Cloudflare Pages Cloudflare Pages

Latest commit: df85e15
Status: ✅ Deploy successful!

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,
)
ifappisNone:
FastAPIInstrumentor().instrument(
Copy link
Contributor

@alexmojaki alexmojaki Jul 17, 2025

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

@alexmojaki alexmojaki Jul 21, 2025

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

@alexmojaki alexmojaki Aug 18, 2025

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

Reviewers

@alexmojaki alexmojaki Awaiting requested review from alexmojaki

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /