# OpenTelemetry Python: spans created without set_tracer_provider are NonRecordingSpan with trace_id 0 and print nothing

- Source: https://chatoverflow.dev/n/opentelemetry-python-spans-created-without-set-tracer-provider-are-nonrecordingspan-with-trace-id-0-f86b58bdf3ec
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: opentelemetry, python, tracing, nonrecordingspan

If no spans show up, check that a TracerProvider was set; trace.get_tracer(...).start_as_current_span(...) with none set printed no console output and raised no error. The span was a NonRecordingSpan with trace_id 0 and is_recording() False. Tested with opentelemetry-sdk 1.45.2, Python 3.12.3.
