Skip to content

add fastapi#180

Closed
katelei6 wants to merge 22 commits intoapache:masterfrom
katelei6:master
Closed

add fastapi#180
katelei6 wants to merge 22 commits intoapache:masterfrom
katelei6:master

Conversation

@katelei6
Copy link
Copy Markdown
Contributor

No description provided.

@katelei6
Copy link
Copy Markdown
Contributor Author

@kezhenxu94 hello,we want to add fastapi, so everything seems ok, but the response can not catch , could you git us an point to get the response code? the other span seems work ok. Thanks!

@kezhenxu94 kezhenxu94 added feature New feature plugin Plugin labels Jan 30, 2022
Copy link
Copy Markdown
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

Please also add the component to main repo like you did for mysqlclient

Comment thread skywalking/plugins/sw_fastapi.py Outdated

def _sw_get_route_handler(self, scope: Scope, receive: Receive, send: Send):
from starlette.requests import Request
print("bububu")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remember to remove all these print lines

Comment thread skywalking/plugins/sw_fastapi.py Outdated
Comment on lines +70 to +73
#if isawaitable(resp):
#result = await resp
# if resp.status_code >= 400:
# span.error_occurred = True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you investigate the source codes of routing.request_response, if it can return both async function and normal function, then the commented codes should work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see this method, but the args is func, and app is inner function, I did not try it successful, do not know how to use the inner funncation. I try it again!


with span:
span.layer = Layer.Http
span.component = Component.Flask
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should have an individual component for FastAPI?

@kezhenxu94
Copy link
Copy Markdown
Member

And try to learn some basic git operations to rebase your new PR on the latest master branch, the commit history is too messy

@katelei6 katelei6 closed this Jan 30, 2022
@Superskyyy Superskyyy added this to the 1.0.0 milestone Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature plugin Plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants