Skip to content

Commit

Permalink
Fix TestClient for fastapi cause the req.client None error (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieSeastar authored Nov 6, 2024
1 parent ff1f6a2 commit 55dc5ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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

0 comments on commit 55dc5ff

Please sign in to comment.