Skip to content

Commit 2c056d9

Browse files
committed
update docstrings
1 parent a749e77 commit 2c056d9

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ def set_status_code(span, status_code):
415415

416416

417417
def get_default_span_details(scope: dict) -> Tuple[str, dict]:
418-
"""Default implementation for get_default_span_details
418+
"""
419+
Default span name is the HTTP method and URL path, or just the method.
419420
https://github.com/open-telemetry/opentelemetry-specification/pull/3165
420421
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name
421422

instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py

-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ def update_expected_server(expected):
284284
SpanAttributes.HTTP_URL: "http://0.0.0.0/",
285285
}
286286
)
287-
# TODO:self possibly update span name to just method
288287
return expected
289288

290289
self.scope["server"] = None

instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@ def _get_attributes_from_request(request):
455455

456456

457457
def _get_default_span_name(request):
458+
"""
459+
Default span name is the HTTP method and URL path, or just the method.
460+
https://github.com/open-telemetry/opentelemetry-specification/pull/3165
461+
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name
462+
463+
Args:
464+
request: Tornado request object.
465+
Returns:
466+
Default span name.
467+
"""
468+
458469
path = request.path
459470
method = request.method
460471
if method and path:

instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def add_response_attributes(
441441

442442
def get_default_span_name(environ):
443443
"""
444-
Default implementation for name_callback.
444+
Default span name is the HTTP method and URL path, or just the method.
445445
https://github.com/open-telemetry/opentelemetry-specification/pull/3165
446446
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name
447447

instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py

-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ def test_wsgi_metrics(self):
284284
)
285285
self.assertTrue(number_data_point_seen and histogram_data_point_seen)
286286

287-
# Question: How often request method can be lost?
288287
def test_default_span_name_missing_path_info(self):
289288
"""Test that default span_names with missing path info."""
290289
self.environ.pop("PATH_INFO")

0 commit comments

Comments
 (0)