(request_id: str)
| 272 | |
| 273 | |
| 274 | def find_trace(request_id: str) -> dict[str, Any] | None: |
| 275 | target = str(request_id or "").strip() |
| 276 | if not target: |
| 277 | return None |
| 278 | record = _trace_store().find(target) |
| 279 | if record is not None: |
| 280 | return record |
| 281 | stats = RouteStats() |
| 282 | for legacy_record in stats.export_records(): |
| 283 | if legacy_record.get("request_id") == target: |
| 284 | return legacy_record |
| 285 | return None |
| 286 | |
| 287 | |
| 288 | def _write_json(bundle: zipfile.ZipFile, name: str, payload: dict[str, Any] | list[dict[str, Any]]) -> None: |
no test coverage detected