Download src/verseflow/telemetry/tracing.py from julius119/VerseFlow-Studio: direct link, hf CLI and curl.
- Browser
- Download file 529 Bytes
-
https://huggingface.co/julius119/VerseFlow-Studio/resolve/main/src/verseflow/telemetry/tracing.py
- Command line
-
hf download hf://julius119/VerseFlow-Studio/src/verseflow/telemetry/tracing.py
-
curl -L -o tracing.py https://huggingface.co/julius119/VerseFlow-Studio/resolve/main/src/verseflow/telemetry/tracing.py
529 Bytes
| """ | |
| OpenTelemetry 全链路追踪与性能监控 | |
| Author: XiaoZhe (Commercial Contact: janejulius119@gmail.com / WeChat: julius119) | |
| """ | |
| import logging | |
| from contextlib import contextmanager | |
| logger = logging.getLogger("VerseFlow.Telemetry") | |
| class TelemetryTracer: | |
| """全链路追踪器""" | |
| def start_span(self, span_name: str, attributes: dict = None): | |
| logger.info(f"[TRACE START] {span_name}") | |
| try: | |
| yield | |
| finally: | |
| logger.info(f"[TRACE END] {span_name}") |