|
1 | | -# Copyright 2019, OpenTelemetry Authors |
| 1 | +# Copyright The OpenTelemetry Authors |
2 | 2 | # |
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | # you may not use this file except in compliance with the License. |
@@ -81,15 +81,15 @@ def collect_request_attributes(scope): |
81 | 81 | port = server[1] |
82 | 82 | server_host = server[0] + (":" + str(port) if port != 80 else "") |
83 | 83 | http_url = ( |
84 | | - scope.get("scheme") + "://" + server_host + scope.get("path", "") |
| 84 | + scope.get("scheme", "http") + "://" + server_host + scope.get("path", "") |
85 | 85 | if scope.get("scheme") and server_host and scope.get("path") |
86 | 86 | else None |
87 | 87 | ) |
88 | 88 | if scope.get("query_string") and http_url: |
89 | 89 | http_url = http_url + ("?" + scope.get("query_string").decode("utf8")) |
90 | 90 |
|
91 | 91 | result = { |
92 | | - "component": scope.get("type"), |
| 92 | + "component": scope["type"] |
93 | 93 | "http.scheme": scope.get("scheme"), |
94 | 94 | "http.host": server_host, |
95 | 95 | "host.port": port, |
@@ -186,14 +186,14 @@ async def wrapped_receive(): |
186 | 186 | with self.tracer.start_as_current_span( |
187 | 187 | span_name + " asgi." + scope["type"] + ".receive" |
188 | 188 | ) as receive_span: |
189 | | - payload = await receive() |
| 189 | + message = await receive() |
190 | 190 | if payload["type"] == "websocket.receive": |
191 | 191 | set_status_code(receive_span, 200) |
192 | 192 | receive_span.set_attribute("type", payload["type"]) |
193 | 193 | return payload |
194 | 194 |
|
195 | 195 | @wraps(send) |
196 | | - async def wrapped_send(payload): |
| 196 | + async def wrapped_send(message): |
197 | 197 | with self.tracer.start_as_current_span( |
198 | 198 | span_name + " asgi." + scope["type"] + ".send" |
199 | 199 | ) as send_span: |
|
0 commit comments