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)
| 103 | |
| 104 | |
| 105 | def 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 | |
| 131 | def get_trace_metrics(trace_id: str, jwt_token: str) -> Dict[str, Any]: |
searching dependent graphs…