Spaces:
Runtime error
Runtime error
Download lib/trace.py from coollad49/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 659 Bytes
-
https://huggingface.co/spaces/coollad49/First_agent_template/resolve/main/lib/trace.py
- Command line
-
hf download hf://spaces/coollad49/First_agent_template/lib/trace.py
-
curl -L -o trace.py https://huggingface.co/spaces/coollad49/First_agent_template/resolve/main/lib/trace.py
659 Bytes
| from opentelemetry import trace | |
| from opentelemetry.sdk.trace import TracerProvider | |
| from opentelemetry.sdk.trace.export import BatchSpanProcessor | |
| from openinference.instrumentation.smolagents import SmolagentsInstrumentor | |
| from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter | |
| from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor | |
| def start_tracing(endpoint="http://localhost:6006/v1/traces" ): | |
| trace_provider = TracerProvider() | |
| trace_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint))) | |
| return SmolagentsInstrumentor().instrument(tracer_provider=trace_provider) | |