Skip to content

Commit fde91fd

Browse files
authored
chore(debugging): fix exploration debugger import (#4180)
## Description With the recent refactor that enabled RCM for the debugger, the content of the old probe poller module has been moved in the probe remoteconfig one. This change fixes an import that was still referecing the removed module and prevented the exploration debuggers from running. A test has also been added to catch potential issues with the exploration debuggers in the future. ## Checklist - [x] Title must conform to [conventional commit](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional). - [x] Add additional sections for `feat` and `fix` pull requests. - [x] Ensure tests are passing for affected code. - [x] [Library documentation](https://github.com/DataDog/dd-trace-py/tree/1.x/docs) and/or [Datadog's documentation site](https://github.com/DataDog/documentation/) is updated. Link to doc PR in description. ## Reviewer Checklist - [ ] Title is accurate. - [ ] Description motivates each change. - [ ] No unnecessary changes were introduced in this PR. - [ ] PR cannot be broken up into smaller PRs. - [ ] Avoid breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Tests provided or description of manual testing performed is included in the code or PR. - [x] Release note has been added for fixes and features, or else `changelog/no-changelog` label added. - [ ] All relevant GitHub issues are correctly linked. - [ ] Backports are identified and tagged with Mergifyio. - [ ] Add to milestone.
1 parent 7970d87 commit fde91fd

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

tests/debugging/exploration/debugger.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ddtrace.debugging._function.discovery import FunctionDiscovery
1414
from ddtrace.debugging._probe.model import ConditionalProbe
1515
from ddtrace.debugging._probe.model import Probe
16-
from ddtrace.debugging._probe.poller import ProbePollerEvent
16+
from ddtrace.debugging._probe.remoteconfig import ProbePollerEvent
1717
from ddtrace.debugging._snapshot.collector import SnapshotCollector
1818
from ddtrace.debugging._snapshot.collector import SnapshotContext
1919
from ddtrace.debugging._snapshot.model import Snapshot
@@ -232,17 +232,17 @@ def get_triggered_probes(cls):
232232
@classmethod
233233
def add_probe(cls, probe):
234234
# type: (Probe) -> None
235-
cls._instance._on_poller_event(ProbePollerEvent.NEW_PROBES, [probe])
235+
cls._instance._on_configuration(ProbePollerEvent.NEW_PROBES, [probe])
236236

237237
@classmethod
238238
def add_probes(cls, probes):
239239
# type: (t.List[Probe]) -> None
240-
cls._instance._on_poller_event(ProbePollerEvent.NEW_PROBES, probes)
240+
cls._instance._on_configuration(ProbePollerEvent.NEW_PROBES, probes)
241241

242242
@classmethod
243243
def delete_probe(cls, probe):
244244
# type: (Probe) -> None
245-
cls._instance._on_poller_event(ProbePollerEvent.DELETED_PROBES, [probe])
245+
cls._instance._on_configuration(ProbePollerEvent.DELETED_PROBES, [probe])
246246

247247

248248
if asbool(os.getenv("DD_DEBUGGER_EXPL_STATUS_MESSAGES", False)):
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from os.path import dirname
2+
3+
import pytest
4+
5+
from ddtrace.internal.compat import PY2
6+
7+
8+
if PY2:
9+
OUT = """Enabling debugging exploration testing
10+
========================== LineCoverage: probes stats ==========================
11+
12+
Installed probes: 0/0
13+
14+
================================ Line coverage =================================
15+
16+
Source Lines Covered
17+
==========================================================================
18+
No lines found
19+
===================== DeterministicProfiler: probes stats ======================
20+
21+
Installed probes: 0/0
22+
23+
============================== Function coverage ===============================
24+
25+
No functions called
26+
"""
27+
else:
28+
OUT = """Enabling debugging exploration testing
29+
===================== DeterministicProfiler: probes stats ======================
30+
31+
Installed probes: 0/0
32+
33+
============================== Function coverage ===============================
34+
35+
No functions called
36+
========================== LineCoverage: probes stats ==========================
37+
38+
Installed probes: 0/0
39+
40+
================================ Line coverage =================================
41+
42+
Source Lines Covered
43+
==========================================================================
44+
No lines found
45+
"""
46+
47+
48+
@pytest.mark.subprocess(env={"PYTHONPATH": dirname(__file__)}, out=OUT)
49+
def test_exploration_bootstrap():
50+
# We test that we get the expected output from the exploration debuggers
51+
# and no errors when running the sitecustomize.py script.
52+
pass

0 commit comments

Comments
 (0)