Skip to content

Commit

Permalink
Revert context trace flags handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jul 27, 2020
1 parent 0e03bfa commit 196c351
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,7 @@ def start_span( # pylint: disable=too-many-locals
)

if sampling_decision.sampled:
# FIXME investigate this to make sure that this is the right
# approach. There seems to be an issue here currently because if
# context.trace_flags is 0, then options will be always set to 1.
# options = context.trace_flags | trace_api.TraceFlags.SAMPLED
options = context.trace_flags
options = context.trace_flags | trace_api.TraceFlags.SAMPLED
context.trace_flags = trace_api.TraceFlags(options)
if attributes is None:
span_attributes = sampling_decision.attributes
Expand Down Expand Up @@ -868,7 +864,7 @@ def __init__(
shutdown_on_exit: bool = True,
active_span_processor: Union[
SynchronousMultiSpanProcessor, ConcurrentMultiSpanProcessor
] = None,
]=None,
):
self._active_span_processor = (
active_span_processor or SynchronousMultiSpanProcessor()
Expand Down

0 comments on commit 196c351

Please sign in to comment.