Log the trace URL for the AgentOps dashboard. Args: span: The span to log the URL for. title: Optional title for the trace.
(span: Union[Span, ReadableSpan], title: Optional[str] = None)
| 34 | |
| 35 | |
| 36 | def log_trace_url(span: Union[Span, ReadableSpan], title: Optional[str] = None) -> None: |
| 37 | """ |
| 38 | Log the trace URL for the AgentOps dashboard. |
| 39 | |
| 40 | Args: |
| 41 | span: The span to log the URL for. |
| 42 | title: Optional title for the trace. |
| 43 | """ |
| 44 | from agentops import get_client |
| 45 | |
| 46 | try: |
| 47 | client = get_client() |
| 48 | if not client.config.log_session_replay_url: |
| 49 | return |
| 50 | except Exception: |
| 51 | return |
| 52 | |
| 53 | session_url = get_trace_url(span) |
| 54 | logger.info(colored(f"\x1b[34mSession Replay for {title} trace: {session_url}\x1b[0m", "blue")) |
searching dependent graphs…