Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NonRecordingSpan' object has no attribute 'kind' #998

Closed
seanpile opened this issue Mar 15, 2022 · 1 comment · Fixed by #999
Closed

AttributeError: 'NonRecordingSpan' object has no attribute 'kind' #998

seanpile opened this issue Mar 15, 2022 · 1 comment · Fixed by #999
Labels
bug Something isn't working

Comments

@seanpile
Copy link

Recent PR #952 seems to have introduced a regression in our code; when using a non-recording span, the flask instrumentation is breaking. See the stacktrace below:

  File "lib/python3.9/site-packages/werkzeug/wrappers/response.py", line 632, in __call__
    start_response(status, headers)
  File "lib/python3.9/site-packages/opentelemetry/instrumentation/flask/__init__.py", line 156, in _start_response
    if span.kind == trace.SpanKind.SERVER:
AttributeError: 'NonRecordingSpan' object has no attribute 'kind'

My expectation is that using a non-recording span should be fine to use safely, and not cause downstream errors. I'm using the following libraries:

  • opentelemetry-api==1.10.0
  • opentelemetry-exporter-otlp-proto-grpc==1.10.0
  • opentelemetry-instrumentation-flask==0.29b0
  • opentelemetry-instrumentation-requests==0.29b0
  • opentelemetry-instrumentation-sqlalchemy==0.29b0
  • opentelemetry-sdk==1.10.0
  • opentelemetry-semantic-conventions==0.29b0
@seanpile seanpile added the bug Something isn't working label Mar 15, 2022
codeboten pushed a commit to codeboten/opentelemetry-python-contrib that referenced this issue Mar 15, 2022
@codeboten codeboten mentioned this issue Mar 15, 2022
6 tasks
@srikanthccv
Copy link
Member

Note to people who run into this issue: did a hot fix release for affected packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants