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

OpenTracing propagator does not use a TraceFlags object #471

Closed
ocelotl opened this issue Apr 26, 2021 · 0 comments · Fixed by #472
Closed

OpenTracing propagator does not use a TraceFlags object #471

ocelotl opened this issue Apr 26, 2021 · 0 comments · Fixed by #472
Assignees
Labels
bug Something isn't working

Comments

@ocelotl
Copy link
Contributor

ocelotl commented Apr 26, 2021

I set up a client and server that propagated spans using the OpenTracing propagator. The server side reported this error:

[2021-04-26 16:41:13,377] ERROR in app: Exception on /ping [GET]
Traceback (most recent call last):
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/ocelotl/virtual_environments/LS-22507/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "server.py", line 53, in ping
    with tracer.start_as_current_span(
  File "/home/ocelotl/.pyenv/versions/3.8.3/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py", line 863, in start_as_current_span
    span = self.start_span(
  File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py", line 917, in start_span
    sampling_result = self.sampler.should_sample(
  File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/sampling.py", line 326, in should_sample
    if parent_span_context.trace_flags.sampled:
AttributeError: 'int' object has no attribute 'sampled'

This happens because when instantiating a context during propagation with the OpenTracing propagator, a TracFlags object is not used for the trace flags.

@ocelotl ocelotl added the bug Something isn't working label Apr 26, 2021
@ocelotl ocelotl self-assigned this Apr 26, 2021
ocelotl added a commit to ocelotl/opentelemetry-python-contrib that referenced this issue Apr 26, 2021
@ocelotl ocelotl mentioned this issue Apr 26, 2021
11 tasks
ocelotl added a commit to ocelotl/opentelemetry-python-contrib that referenced this issue Apr 27, 2021
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.

1 participant