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

Fix TestClient for fastapi cause the req.client None error #355

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## Change Logs

### 1.2.0

- Feature:
- Drop support for 3.7 (#356)

- Fixes:
- Fix: user/password replacement is not allowed for relative URLs (#349)
- Fix pulsar client does not support init arguments other than service_url (#351)
- Fix outdated make dev-fix rule in CodeStyle.md (#350)
- Fix TestClient for fastapi cause the req.client None error (#355)

### 1.1.0

- Feature:
Expand Down
2 changes: 1 addition & 1 deletion skywalking/plugins/sw_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def create_span(self, method, scope, req, send, receive):
with span:
span.layer = Layer.Http
span.component = Component.FastAPI
span.peer = f'{req.client.host}:{req.client.port}'
span.peer = f'{req.client.host}:{req.client.port}' if req.client else 'unknown'
span.tag(TagHttpMethod(method))
span.tag(TagHttpURL(str(req.url).split('?')[0]))
if config.plugin_fastapi_collect_http_params and req.query_params:
Expand Down
Loading