Skip to content

Commit

Permalink
Check apm is disabled in both tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iunanua committed Nov 21, 2024
1 parent 42faab9 commit 11fe3b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/appsec/test_asm_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,18 @@ def test_no_appsec_upstream__no_asm_event__is_kept_with_priority_1__from_2(self)
class Test_SCAStandalone_Telemetry:
"""Tracer correctly propagates SCA telemetry in distributing tracing."""

def assert_standalone_is_enabled(self, request):
# test standalone is enabled and dropping traces
for data, _trace, span in interfaces.library.get_spans(request):
assert span["metrics"]["_sampling_priority_v1"] == 0
assert span["metrics"]["_dd.apm.enabled"] == 0

def setup_telemetry_sca_enabled_propagated(self):
self.r = weblog.get("/")

def test_telemetry_sca_enabled_propagated(self):
self.assert_standalone_is_enabled(self.r)

for data in interfaces.library.get_telemetry_data():
content = data["request"]["content"]
if content.get("request_type") != "app-started":
Expand All @@ -701,10 +712,7 @@ def setup_app_dependencies_loaded(self):
self.r = weblog.get("/load_dependency")

def test_app_dependencies_loaded(self):
# test standalone is enabled and dropping traces
for data, _trace, span in interfaces.library.get_spans(request=self.r):
assert span["metrics"]["_sampling_priority_v1"] == 0
assert span["metrics"]["_dd.apm.enabled"] == 0
self.assert_standalone_is_enabled(self.r)

seen_loaded_dependencies = TelemetryUtils.get_loaded_dependency(context.library.library)

Expand Down

0 comments on commit 11fe3b2

Please sign in to comment.