mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(Observability) - Add more detailed dd tracing on Proxy Auth, Bedrock Auth (#8693)
* add dd tracer * fix dd tracing * add @tracer.wrap() on def user_api_key_auth * add async_function_with_retries * remove dead code * add tracer.wrap on base aws llm * add tracer.wrap on base aws llm * fix print verbose * fix dd tracing * trace base aws llm * fix test base aws llm * fix converse transform * test base aws llm * BASE_AWS_LLM_PATH * BASE_AWS_LLM_PATH * test dd tracing
This commit is contained in:
parent
11a1692c63
commit
f940392971
9 changed files with 256 additions and 42 deletions
|
@ -20,6 +20,7 @@ import litellm
|
|||
from litellm._logging import verbose_logger, verbose_proxy_logger
|
||||
from litellm._service_logger import ServiceLogging
|
||||
from litellm.caching import DualCache
|
||||
from litellm.litellm_core_utils.dd_tracing import tracer
|
||||
from litellm.proxy._types import *
|
||||
from litellm.proxy.auth.auth_checks import (
|
||||
_cache_key_object,
|
||||
|
@ -897,7 +898,10 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
|
|||
# Check 3. If token is expired
|
||||
if valid_token.expires is not None:
|
||||
current_time = datetime.now(timezone.utc)
|
||||
expiry_time = datetime.fromisoformat(valid_token.expires)
|
||||
if isinstance(valid_token.expires, datetime):
|
||||
expiry_time = valid_token.expires
|
||||
else:
|
||||
expiry_time = datetime.fromisoformat(valid_token.expires)
|
||||
if (
|
||||
expiry_time.tzinfo is None
|
||||
or expiry_time.tzinfo.utcoffset(expiry_time) is None
|
||||
|
@ -1127,6 +1131,7 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
|
|||
)
|
||||
|
||||
|
||||
@tracer.wrap()
|
||||
async def user_api_key_auth(
|
||||
request: Request,
|
||||
api_key: str = fastapi.Security(api_key_header),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue