Skip to content
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

[FastAPI] Add TC for non-async methods #514

Merged
merged 2 commits into from
Mar 13, 2024
Merged

[FastAPI] Add TC for non-async methods #514

merged 2 commits into from
Mar 13, 2024

Conversation

GSVarsha
Copy link
Contributor

@GSVarsha GSVarsha commented Mar 4, 2024

Add a non-async path operation function that makes a complex non-asynchronous request to check if all the outgoing calls made by the request are properly traced.

@GSVarsha GSVarsha self-assigned this Mar 4, 2024
@GSVarsha GSVarsha requested review from pvital and Ferenc- March 4, 2024 07:35
@GSVarsha GSVarsha added this to the H1-2024 milestone Mar 4, 2024
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

It looks good to me.

Copy link
Contributor

@Ferenc- Ferenc- left a comment

Choose a reason for hiding this comment

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

Looks good, only the usage of async_tracer instead of tracer could be perhaps improved.

tests/frameworks/test_fastapi.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Ferenc- Ferenc- left a comment

Choose a reason for hiding this comment

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

Looks good.

@GSVarsha
Copy link
Contributor Author

GSVarsha commented Mar 5, 2024

⚠️ New testcases seem to be flaky on python 3.12 - investigating on the same

@GSVarsha GSVarsha force-pushed the non-async-fastapi branch 2 times, most recently from 653e513 to 8802291 Compare March 6, 2024 13:53
@GSVarsha GSVarsha requested review from Ferenc- and pvital March 6, 2024 14:05
@GSVarsha
Copy link
Contributor Author

GSVarsha commented Mar 6, 2024

⚠️ New tests seem to be flaky on python 3.12 - investigating on the same

Span order was the issue. Used span filters to resolve the same.

Copy link
Contributor

@Ferenc- Ferenc- left a comment

Choose a reason for hiding this comment

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

Looks good. Now that we are here, could we also add some TCs, that make explicit use of from fastapi.concurrency import run_in_threadpool?
I think that might be the area where we could pontentially find limitations pertaining to the tracer's thread boundary, and where we might have to document something.

Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

It looks good to me, but your commit message is a bit messy.

Could you rebase and reword your commit message before merging it, please?

Varsha GS added 2 commits March 8, 2024 18:52
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
Signed-off-by: Varsha GS <varsha.gs@ibm.com>
@GSVarsha
Copy link
Contributor Author

GSVarsha commented Mar 8, 2024

Observation: We are unable to trace non-async functions across thread boundaries only with the explicit use of the coroutine fastapi.concurrency.run_in_threadpool

Opened a PR to document this limitation

@GSVarsha GSVarsha requested review from Ferenc- and pvital March 8, 2024 13:33
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

It looks good to me.

Copy link
Contributor

@Ferenc- Ferenc- left a comment

Choose a reason for hiding this comment

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

Approved

@Ferenc- Ferenc- merged commit 6cb776e into master Mar 13, 2024
12 of 13 checks passed
@Ferenc- Ferenc- deleted the non-async-fastapi branch March 13, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants