@@ -1194,7 +1194,6 @@ class POTelSpan:
1194
1194
def __init__ (
1195
1195
self ,
1196
1196
* ,
1197
- active = True , # type: bool
1198
1197
op = None , # type: Optional[str]
1199
1198
description = None , # type: Optional[str]
1200
1199
status = None , # type: Optional[str]
@@ -1221,7 +1220,6 @@ def __init__(
1221
1220
self ._otel_span = tracer .start_span (
1222
1221
description or op or "" , start_time = start_timestamp
1223
1222
) # XXX
1224
- self ._active = active
1225
1223
1226
1224
self .origin = origin or DEFAULT_SPAN_ORIGIN
1227
1225
self .op = op
@@ -1250,19 +1248,17 @@ def __enter__(self):
1250
1248
# XXX use_span? https://github.com/open-telemetry/opentelemetry-python/blob/3836da8543ce9751051e38a110c0468724042e62/opentelemetry-api/src/opentelemetry/trace/__init__.py#L547
1251
1249
#
1252
1250
# create a Context object with parent set as current span
1253
- if self ._active :
1254
- ctx = otel_trace .set_span_in_context (self ._otel_span )
1255
- # set as the implicit current context
1256
- self ._ctx_token = context .attach (ctx )
1251
+ ctx = otel_trace .set_span_in_context (self ._otel_span )
1252
+ # set as the implicit current context
1253
+ self ._ctx_token = context .attach (ctx )
1257
1254
1258
1255
return self
1259
1256
1260
1257
def __exit__ (self , ty , value , tb ):
1261
1258
# type: (Optional[Any], Optional[Any], Optional[Any]) -> None
1262
1259
self ._otel_span .end ()
1263
1260
# XXX set status to error if unset and an exception occurred?
1264
- if self ._active :
1265
- context .detach (self ._ctx_token )
1261
+ context .detach (self ._ctx_token )
1266
1262
1267
1263
@property
1268
1264
def description (self ):
0 commit comments