Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.x-staging' into munir/remove-d…
Browse files Browse the repository at this point in the history
…eprecated-code-integrations
  • Loading branch information
mabdinur committed Jan 29, 2025
2 parents 5f7c535 + 58b4dfa commit f6f2e67
Show file tree
Hide file tree
Showing 237 changed files with 693 additions and 2,075 deletions.
84 changes: 0 additions & 84 deletions .riot/requirements/16c3b9f.txt

This file was deleted.

82 changes: 0 additions & 82 deletions .riot/requirements/585e779.txt

This file was deleted.

84 changes: 0 additions & 84 deletions .riot/requirements/d39d3de.txt

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/ddtrace_run/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(self):
env["DD_TRACE_API_VERSION"] = "v0.4"
code += """
import httpretty
from ddtrace import tracer
from ddtrace.trace import tracer
from ddtrace.internal.telemetry import telemetry_writer
httpretty.enable(allow_net_connect=False)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/otel_span/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from opentelemetry.trace import set_tracer_provider

from ddtrace import config
from ddtrace import tracer
from ddtrace.opentelemetry import TracerProvider # Requires ``ddtrace>=1.11``
from ddtrace.trace import tracer


set_tracer_provider(TracerProvider())
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/span/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import bm.utils as utils

from ddtrace import config
from ddtrace import tracer
from ddtrace.trace import tracer


class Span(Scenario):
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/threading/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_trace(self, tracer: Tracer) -> None:
random.random()

def run(self) -> Generator[Callable[[int], None], None, None]:
from ddtrace import tracer
from ddtrace.trace import tracer

# configure global tracer to drop traces rather
tracer.configure(writer=NoopWriter())
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/tracer/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Tracer(bm.Scenario):
def run(self):
# configure global tracer to drop traces rather than encoded and sent to
# an agent
from ddtrace import tracer
from ddtrace.trace import tracer

utils.drop_traces(tracer)
utils.drop_telemetry_events()
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/_trace/_span_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SpanLinks can be set using :meth:`ddtrace.Span.link_span(...)` Ex::
from ddtrace import tracer
from ddtrace.trace import tracer
s1 = tracer.trace("s1")
s2 = tracer.trace("s2")
Expand Down
20 changes: 10 additions & 10 deletions ddtrace/_trace/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
# type: (...) -> None
if tracer is not None and tracer is not ddtrace.tracer:
deprecate(
"Initializing ddtrace.Pin with `tracer` argument is deprecated",
"Initializing ddtrace.trace.Pin with `tracer` argument is deprecated",
message="All Pin instances should use the global tracer instance",
removal_version="3.0.0",
)
Expand Down Expand Up @@ -79,15 +79,15 @@ def __repr__(self):
def _find(*objs):
# type: (Any) -> Optional[Pin]
"""
Return the first :class:`ddtrace.pin.Pin` found on any of the provided objects or `None` if none were found
Return the first :class:`ddtrace.trace.Pin` found on any of the provided objects or `None` if none were found
>>> pin = Pin._find(wrapper, instance, conn)
:param objs: The objects to search for a :class:`ddtrace.pin.Pin` on
:param objs: The objects to search for a :class:`ddtrace.trace.Pin` on
:type objs: List of objects
:rtype: :class:`ddtrace.pin.Pin`, None
:returns: The first found :class:`ddtrace.pin.Pin` or `None` is none was found
:rtype: :class:`ddtrace.trace.Pin`, None
:returns: The first found :class:`ddtrace.trace.Pin` or `None` is none was found
"""
for obj in objs:
pin = Pin.get_from(obj)
Expand All @@ -105,10 +105,10 @@ def get_from(obj):
>>> pin = Pin.get_from(conn)
:param obj: The object to look for a :class:`ddtrace.pin.Pin` on
:param obj: The object to look for a :class:`ddtrace.trace.Pin` on
:type obj: object
:rtype: :class:`ddtrace.pin.Pin`, None
:returns: :class:`ddtrace.pin.Pin` associated with the object, or None if none was found
:rtype: :class:`ddtrace.trace.Pin`, None
:returns: :class:`ddtrace.trace.Pin` associated with the object, or None if none was found
"""
if hasattr(obj, "__getddpin__"):
return obj.__getddpin__()
Expand Down Expand Up @@ -141,7 +141,7 @@ def override(
"""
if tracer is not None:
deprecate(
"Calling ddtrace.Pin.override(...) with the `tracer` argument is deprecated",
"Calling ddtrace.trace.Pin.override(...) with the `tracer` argument is deprecated",
message="All Pin instances should use the global tracer instance",
removal_version="3.0.0",
)
Expand Down Expand Up @@ -208,7 +208,7 @@ def clone(

if tracer is not None:
deprecate(
"Initializing ddtrace.Pin with `tracer` argument is deprecated",
"Initializing ddtrace.trace.Pin with `tracer` argument is deprecated",
message="All Pin instances should use the global tracer instance",
removal_version="3.0.0",
)
Expand Down
4 changes: 3 additions & 1 deletion ddtrace/_trace/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def __init__(
if isinstance(rule, SamplingRule):
self.rules.append(rule)
elif config._raise:
raise TypeError("Rule {!r} must be a sub-class of type ddtrace.sampler.SamplingRules".format(rule))
raise TypeError(
"Rule {!r} must be a sub-class of type ddtrace._trace.sampler.SamplingRules".format(rule)
)

# DEV: sampling rule must come last
if effective_sample_rate is not None:
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/_trace/trace_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


if TYPE_CHECKING:
from ddtrace import Span
from ddtrace._trace.span import Span


log = get_logger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/_trace/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Tracer(object):
If you're running an application that will serve a single trace per thread,
you can use the global tracer instance::
from ddtrace import tracer
from ddtrace.trace import tracer
trace = tracer.trace('app.request', 'web-server').finish()
"""

Expand Down
Loading

0 comments on commit f6f2e67

Please sign in to comment.