Skip to content

Commit

Permalink
Remove _with_limits() from tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
owais committed May 24, 2021
1 parent 9a22c15 commit dddf654
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,6 @@ def __init__(
self.instrumentation_info = instrumentation_info
self._limits = None

def _with_limits(self, limits: _Limits) -> "Tracer":
self._limits = limits
return self

@contextmanager
def start_as_current_span(
self,
Expand Down Expand Up @@ -1085,15 +1081,17 @@ def get_tracer(
if not instrumenting_module_name: # Reject empty strings too.
instrumenting_module_name = ""
logger.error("get_tracer called with missing module name.")
return Tracer(
tracer = Tracer(
self.sampler,
self.resource,
self._active_span_processor,
self.id_generator,
InstrumentationInfo(
instrumenting_module_name, instrumenting_library_version
),
)._with_limits(self._limits)
)
tracer._limits = self._limits
return tracer

def add_span_processor(self, span_processor: SpanProcessor) -> None:
"""Registers a new :class:`SpanProcessor` for this `TracerProvider`.
Expand Down

0 comments on commit dddf654

Please sign in to comment.