Skip to content

Commit acb7a99

Browse files
committed
cleanup
1 parent 01920eb commit acb7a99

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/service-library/src/servicelib/tracing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import Any, Final, TypeAlias
66

77
import pyinstrument
8+
import pyinstrument.renderers
89
from opentelemetry import context as otcontext
910
from opentelemetry import trace
1011
from opentelemetry.instrumentation.logging import LoggingInstrumentor
@@ -83,9 +84,12 @@ async def wrapper(*args: Any, **kwargs: Any) -> Any:
8384

8485
finally:
8586
profiler.stop()
87+
renderer = pyinstrument.renderers.ConsoleRenderer(
88+
unicode=True, color=False, show_all=True
89+
)
8690
span.set_attribute(
8791
_PROFILE_ATTRIBUTE_NAME,
88-
profiler.output_text(unicode=True, color=False),
92+
profiler.output(renderer=renderer),
8993
)
9094

9195
return wrapper

services/web/server/src/simcore_service_webserver/users/_users_rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
)
2727
from servicelib.logging_utils import log_context
2828
from servicelib.rest_constants import RESPONSE_MODEL_POLICY
29+
from servicelib.tracing import with_profiled_span
2930

3031
from .._meta import API_VTAG
3132
from ..exception_handling import (
@@ -110,6 +111,7 @@
110111

111112

112113
@routes.get(f"/{API_VTAG}/me", name="get_my_profile")
114+
@with_profiled_span
113115
@login_required
114116
@_handle_users_exceptions
115117
async def get_my_profile(request: web.Request) -> web.Response:

0 commit comments

Comments
 (0)