Skip to content

Commit 906b99a

Browse files
authored
Revert "chore(profiling): add process_tags (#15226)" (#15363)
Right now process tags are set as a tag. However as profiler is using libdatadog, it should be added as a root field and not a tag if we want to not break anything. This PR reverts the changes I made on profiling.
1 parent 4678eef commit 906b99a

File tree

3 files changed

+0
-65
lines changed

3 files changed

+0
-65
lines changed

ddtrace/profiling/profiler.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from ddtrace import config
1313
from ddtrace.internal import atexit
1414
from ddtrace.internal import forksafe
15-
from ddtrace.internal import process_tags
1615
from ddtrace.internal import service
1716
from ddtrace.internal import uwsgi
1817
from ddtrace.internal.datadog.profiling import ddup
@@ -169,9 +168,6 @@ def _build_default_exporters(self):
169168
profiler_config = config_str(profiling_config)
170169
self.tags.update({"profiler_config": profiler_config})
171170

172-
if p_tags := process_tags.process_tags:
173-
self.tags.update({"process_tags": p_tags})
174-
175171
endpoint_call_counter_span_processor = self.tracer._endpoint_call_counter_span_processor
176172
if self.endpoint_collection_enabled:
177173
endpoint_call_counter_span_processor.enable()

tests/profiling/test_profiler.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,3 @@ def test_profiler_serverless(monkeypatch):
144144
p = profiler.Profiler()
145145
assert isinstance(p._scheduler, scheduler.ServerlessScheduler)
146146
assert p.tags["functionname"] == "foobar"
147-
148-
149-
def test_process_tags_deactivated():
150-
p = profiler.Profiler()
151-
assert "process_tags" not in p.tags
152-
153-
154-
@pytest.mark.subprocess(
155-
env=dict(
156-
DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED="true",
157-
)
158-
)
159-
def test_process_tags_activated():
160-
from ddtrace.profiling import profiler
161-
162-
p = profiler.Profiler()
163-
assert "process_tags" in p.tags

tests/profiling_v2/exporter/test_ddup.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -62,47 +62,3 @@ def test_tags_propagated():
6262
# Profiler could add tags, so check that tags is a superset of config.tags
6363
for k, v in config.tags.items():
6464
assert tags[k] == v
65-
66-
67-
@pytest.mark.subprocess()
68-
def test_process_tags_deactivated():
69-
import sys
70-
from unittest import mock
71-
72-
sys.modules["ddtrace.internal.datadog.profiling.ddup"] = mock.Mock()
73-
74-
from ddtrace.profiling.profiler import Profiler # noqa: I001
75-
from ddtrace.internal.datadog.profiling import ddup
76-
77-
# When Profiler is instantiated and libdd is enabled, it should call ddup.config
78-
Profiler()
79-
80-
ddup.config.assert_called()
81-
82-
tags = ddup.config.call_args.kwargs["tags"]
83-
84-
assert "process_tags" not in tags
85-
86-
87-
@pytest.mark.subprocess(
88-
env=dict(
89-
DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED="true",
90-
)
91-
)
92-
def test_process_tags_activated():
93-
import sys
94-
from unittest import mock
95-
96-
sys.modules["ddtrace.internal.datadog.profiling.ddup"] = mock.Mock()
97-
98-
from ddtrace.profiling.profiler import Profiler # noqa: I001
99-
from ddtrace.internal.datadog.profiling import ddup
100-
101-
# When Profiler is instantiated and libdd is enabled, it should call ddup.config
102-
Profiler()
103-
104-
ddup.config.assert_called()
105-
106-
tags = ddup.config.call_args.kwargs["tags"]
107-
108-
assert "process_tags" in tags

0 commit comments

Comments
 (0)