Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make sentry RPC instrumentation more specific to the endpoint #6654

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions snuba/web/rpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from typing import Generic, List, Tuple, Type, TypeVar, cast, final

import sentry_sdk
from google.protobuf.message import DecodeError
from google.protobuf.message import Message as ProtobufMessage
from sentry_protos.snuba.v1.error_pb2 import Error as ErrorProto
Expand Down Expand Up @@ -67,6 +68,11 @@ def parse_from_string(self, bytestring: bytes) -> Tin:

@final
def execute(self, in_msg: Tin) -> Tout:
scope = sentry_sdk.get_current_scope()
scope.set_transaction_name(self.config_key())
span = scope.span
if span is not None:
span.description = self.config_key()
self.__before_execute(in_msg)
error = None
try:
Expand Down
Loading