This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tracer.wrap( | |
service=DatadogService.CHANNELS_SERVICES.value, | |
name=DatadogOperation.SERVICE_METHOD.value, | |
resource="ConversationsService.get_conversation", | |
) | |
async def get_conversation( | |
self, | |
*, | |
user_group_id: int, | |
conversation_id: int, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tracer.wrap( | |
service=DatadogService.CHANNELS_DOCUMENTDB.value, | |
name=DatadogOperation.MONGO_QUERY.value, | |
span_type=DatadogSpanType.DATABASE.value, | |
resource="InboxesRepository.fetch_one", | |
) | |
async def fetch_one(self, *, inbox_id: int) -> Optional[InboxModel]: | |
span = tracer.current_span() | |
add_tag_to_span(span, "inbox_id", inbox_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tracer.wrap( | |
service=DatadogService.CHANNELS_CHAT_API.value, | |
name=DatadogOperation.API_CALL.value, | |
resource="AccountAgentsRepository.fetch_all", | |
) | |
async def fetch_all( | |
self, *, chat_account_id: int, api_access_token: str | |
) -> List[AccountAgentModel]: | |
url = f"{self.__chat_api_host}/api/v1/accounts/{chat_account_id}/agents" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Awaitable, Callable, Dict, Optional, Union | |
from ddtrace import tracer | |
from fastapi import Request, Response | |
from starlette.routing import Match, Scope | |
from constants.datadog import DatadogOperation, DatadogSpanType | |
class RouteTraceMiddleware: |