Skip to content

Commit b76f207

Browse files
authored
ref(seer-rpc): instrument tracing for rpc calls and get_replay_summary_logs (#100336)
1 parent 76235fa commit b76f207

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/sentry/replays/usecases/summarize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ def _parse_url(s: str, trunc_length: int) -> str:
458458
return s
459459

460460

461+
@sentry_sdk.trace
461462
def rpc_get_replay_summary_logs(
462463
project_id: int, replay_id: str, num_segments: int
463464
) -> dict[str, Any]:

src/sentry/seer/endpoints/seer_rpc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,23 @@ class SeerRpcServiceEndpoint(Endpoint):
175175
permission_classes = ()
176176
enforce_rate_limit = False
177177

178+
@sentry_sdk.trace
178179
def _is_authorized(self, request: Request) -> bool:
179180
if request.auth and isinstance(
180181
request.successful_authenticator, SeerRpcSignatureAuthentication
181182
):
182183
return True
183184
return False
184185

186+
@sentry_sdk.trace
185187
def _dispatch_to_local_method(self, method_name: str, arguments: dict[str, Any]) -> Any:
186188
if method_name not in seer_method_registry:
187189
raise RpcResolutionException(f"Unknown method {method_name}")
188190
# As seer is a single service, we just directly expose the methods instead of services.
189191
method = seer_method_registry[method_name]
190192
return method(**arguments)
191193

194+
@sentry_sdk.trace
192195
def post(self, request: Request, method_name: str) -> Response:
193196
if not self._is_authorized(request):
194197
raise PermissionDenied

0 commit comments

Comments
 (0)