Skip to content

Commit ce152c1

Browse files
AWS SSI: Reduce the profiling upload period (#5668)
1 parent 43c7681 commit ce152c1

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

tests/auto_inject/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
from utils.onboarding.weblog_interface import make_get_request, warmup_weblog, make_internal_get_request
23
from utils.onboarding.backend_interface import wait_backend_trace_id
34
from utils.onboarding.wait_for_tcp_port import wait_for_port
@@ -65,7 +66,8 @@ def _check_install(
6566
validator = self._appsec_validator
6667
if origin_detection:
6768
validator = self._container_tags_validator
68-
69+
if profile:
70+
time.sleep(6) # Wait for the profiling to start and upload the data
6971
try:
7072
wait_backend_trace_id(request_uuid, profile=profile, validator=validator)
7173
except (TimeoutError, AssertionError) as e:

utils/_context/_scenarios/__init__.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,9 @@ class _Scenarios:
795795
"stable config (application_monitoring.yaml)",
796796
agent_env={"DD_PROFILING_ENABLED": "auto"},
797797
app_env={
798-
"DD_PROFILING_UPLOAD_PERIOD": "10",
798+
"DD_PROFILING_UPLOAD_PERIOD": "5",
799799
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
800+
"DD_PROFILING_START_FORCE_FIRST": "true",
800801
},
801802
scenario_groups=[scenario_groups.all, scenario_groups.simple_onboarding_profiling],
802803
github_workflow="aws_ssi",
@@ -809,7 +810,11 @@ class _Scenarios:
809810
),
810811
vm_provision="host-auto-inject-install-script",
811812
agent_env={"DD_PROFILING_ENABLED": "auto"},
812-
app_env={"DD_PROFILING_UPLOAD_PERIOD": "10", "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500"},
813+
app_env={
814+
"DD_PROFILING_UPLOAD_PERIOD": "5",
815+
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
816+
"DD_PROFILING_START_FORCE_FIRST": "true",
817+
},
813818
scenario_groups=[scenario_groups.all],
814819
github_workflow="aws_ssi",
815820
)
@@ -819,7 +824,11 @@ class _Scenarios:
819824
"Onboarding Container Single Step Instrumentation profiling scenario using agent auto install script",
820825
vm_provision="container-auto-inject-install-script",
821826
agent_env={"DD_PROFILING_ENABLED": "auto"},
822-
app_env={"DD_PROFILING_UPLOAD_PERIOD": "10", "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500"},
827+
app_env={
828+
"DD_PROFILING_UPLOAD_PERIOD": "5",
829+
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
830+
"DD_PROFILING_START_FORCE_FIRST": "true",
831+
},
823832
scenario_groups=[scenario_groups.all],
824833
github_workflow="aws_ssi",
825834
)
@@ -926,20 +935,32 @@ class _Scenarios:
926935
k8s_lib_injection_profiling_disabled = K8sScenario(
927936
"K8S_LIB_INJECTION_PROFILING_DISABLED",
928937
doc="Kubernetes lib injection with admission controller and profiling disabled by default",
929-
weblog_env={"DD_PROFILING_UPLOAD_PERIOD": "10", "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500"},
938+
weblog_env={
939+
"DD_PROFILING_UPLOAD_PERIOD": "10",
940+
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
941+
"DD_PROFILING_START_FORCE_FIRST": "true",
942+
},
930943
scenario_groups=[scenario_groups.all, scenario_groups.lib_injection_profiling],
931944
)
932945
k8s_lib_injection_profiling_enabled = K8sScenario(
933946
"K8S_LIB_INJECTION_PROFILING_ENABLED",
934947
doc="Kubernetes lib injection with admission controller and profiling enaabled by cluster config",
935-
weblog_env={"DD_PROFILING_UPLOAD_PERIOD": "10", "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500"},
948+
weblog_env={
949+
"DD_PROFILING_UPLOAD_PERIOD": "10",
950+
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
951+
"DD_PROFILING_START_FORCE_FIRST": "true",
952+
},
936953
dd_cluster_feature={"datadog.profiling.enabled": "auto"},
937954
scenario_groups=[scenario_groups.all, scenario_groups.lib_injection_profiling],
938955
)
939956
k8s_lib_injection_profiling_override = K8sScenario(
940957
"K8S_LIB_INJECTION_PROFILING_OVERRIDE",
941958
doc="Kubernetes lib injection with admission controller and profiling enaabled overriting cluster config",
942-
weblog_env={"DD_PROFILING_UPLOAD_PERIOD": "10", "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500"},
959+
weblog_env={
960+
"DD_PROFILING_UPLOAD_PERIOD": "10",
961+
"DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": "1500",
962+
"DD_PROFILING_START_FORCE_FIRST": "true",
963+
},
943964
dd_cluster_feature={
944965
"clusterAgent.env[0].name": "DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_PROFILING_ENABLED",
945966
"clusterAgent.env[0].value": "auto",

0 commit comments

Comments
 (0)