MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_trace_details

Function get_trace_details

agentops/validation.py:105–128  ·  view source on GitHub ↗

Get trace details from AgentOps API. Args: trace_id: The trace ID to query jwt_token: JWT authentication token Returns: Trace details including spans Raises: ApiServerException: If API request fails

(trace_id: str, jwt_token: str)

Source from the content-addressed store, hash-verified

103
104
105def get_trace_details(trace_id: str, jwt_token: str) -> Dict[str, Any]:
106 """
107 Get trace details from AgentOps API.
108
109 Args:
110 trace_id: The trace ID to query
111 jwt_token: JWT authentication token
112
113 Returns:
114 Trace details including spans
115
116 Raises:
117 ApiServerException: If API request fails
118 """
119 try:
120 response = requests.get(
121 f"https://api.agentops.ai/public/v1/traces/{trace_id}",
122 headers={"Authorization": f"Bearer {jwt_token}"},
123 timeout=10,
124 )
125 response.raise_for_status()
126 return response.json()
127 except requests.exceptions.RequestException as e:
128 raise ApiServerException(f"Failed to get trace details: {e}")
129
130
131def get_trace_metrics(trace_id: str, jwt_token: str) -> Dict[str, Any]:

Calls 3

ApiServerExceptionClass · 0.90
jsonMethod · 0.80
getMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…