You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug: ...
When ELASTIC_APM_ENABLED is set to false, start_span() should not result in an exception. This happens when the Tracer from from elasticapm.contrib.opentelemetry.trace is used.
To Reproduce
Set ELASTIC_APM_ENABLED to false
Call start_as_current_span or start_span (from Tracer of elasticapm.contrib.opentelemetry.trace)
Notice an exception is thrown
Environment (please complete the following information)
OS: Mac OS, Linux
Python version: 3.12
Framework and version [e.g. Django 2.1]: N/A
APM Server version: N/A
Agent version: 6.23.0
Additional context
Here's the exception:
with tracer.start_as_current_span(name) as span:\\n
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n
| File \\\"/usr/local/lib/python3.12/contextlib.py\\\", line 137, in __enter__\\n
| return next(self.gen)\\n
| ^^^^^^^^^^^^^^\\n
| File \\\"/app/.venv/lib/python3.12/site-packages/elasticapm/contrib/opentelemetry/trace.py\\\", line 230, in start_as_current_span\\n
| span = self.start_span(\\n
| ^^^^^^^^^^^^^^^^\\n
| File \\\"/app/.venv/lib/python3.12/site-packages/elasticapm/contrib/opentelemetry/trace.py\\\", line 150, in start_span\\n
| span = Span(\\n
| ^^^^^\\n
| File \\\"/app/.venv/lib/python3.12/site-packages/elasticapm/contrib/opentelemetry/span.py\\\", line 65, in __init__\\n
| elastic_span.otel_wrapper = self\\n
| ^^^^^^^^^^^^^^^^^^^^^^^^^\\n
| AttributeError: 'NoneType' object has no attribute 'otel_wrapper'\\n
Describe the bug: ...
When
ELASTIC_APM_ENABLED
is set tofalse
,start_span()
should not result in an exception. This happens when the Tracer fromfrom elasticapm.contrib.opentelemetry.trace
is used.To Reproduce
ELASTIC_APM_ENABLED
tofalse
start_as_current_span
orstart_span
(fromTracer
ofelasticapm.contrib.opentelemetry.trace
)Environment (please complete the following information)
6.23.0
Additional context
Here's the exception:
Agent config options
Click to expand
requirements.txt
:Click to expand
The text was updated successfully, but these errors were encountered: