Skip to content

Commit ceb0d18

Browse files
dmanchondecko
authored andcommitted
PR comments
1 parent 57f59b0 commit ceb0d18

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

instrumentation/opentelemetry-instrumentation-aiohttp-server/setup.cfg

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ package_dir=
4040
=src
4141
packages=find_namespace:
4242
install_requires =
43-
opentelemetry-api ~= 1.3
44-
opentelemetry-semantic-conventions == 0.28b1
45-
opentelemetry-instrumentation == 0.28b1
46-
opentelemetry-util-http == 0.28b1
43+
opentelemetry-api ~= 1.12
44+
opentelemetry-semantic-conventions == 0.38b0.dev
45+
opentelemetry-instrumentation == 0.38b0.dev
46+
opentelemetry-util-http == 0.38b0.dev
4747

4848
[options.packages.find]
4949
where = src
5050

5151
[options.extras_require]
5252
test =
53-
opentelemetry-test-utils == 0.28b1
53+
opentelemetry-test-utils == 0.38b0.dev
5454

5555

5656
[options.entry_points]

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -138,28 +138,22 @@ async def middleware(request, handler):
138138
if (
139139
context.get_value("suppress_instrumentation")
140140
or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY)
141-
or _excluded_urls.url_disabled(request.url)
141+
or _excluded_urls.url_disabled(request.url.path)
142142
):
143143
return await handler(request)
144144

145-
token = context.attach(extract(request, getter=getter))
146145
span_name, additional_attributes = get_default_span_details(request)
147146

148147
with tracer.start_as_current_span(
149148
span_name,
150149
kind=trace.SpanKind.SERVER,
151150
) as span:
152-
if span.is_recording():
153-
attributes = collect_request_attributes(request)
154-
attributes.update(additional_attributes)
155-
for key, value in attributes.items():
156-
span.set_attribute(key, value)
157-
try:
158-
resp = await handler(request)
159-
set_status_code(span, resp.status)
160-
finally:
161-
context.detach(token)
162-
return resp
151+
attributes = collect_request_attributes(request)
152+
attributes.update(additional_attributes)
153+
span.setattributes(attributes)
154+
resp = await handler(request)
155+
set_status_code(span, resp.status)
156+
return resp
163157

164158

165159
class _InstrumentedApplication(web.Application):

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.28b1"
15+
__version__ = "0.38b0.dev"

0 commit comments

Comments
 (0)