1
1
package datadog .smoketest .loginjection ;
2
2
3
- import static datadog .trace .api .config .TraceInstrumentationConfig .LOGS_INJECTION_ENABLED ;
4
-
5
- import datadog .trace .api .ConfigCollector ;
6
- import datadog .trace .api .ConfigSetting ;
3
+ import datadog .trace .api .Config ;
7
4
import datadog .trace .api .CorrelationIdentifier ;
8
5
import datadog .trace .api .Trace ;
9
6
import java .util .concurrent .TimeUnit ;
@@ -23,13 +20,13 @@ public void run() throws InterruptedException {
23
20
24
21
secondTracedMethod ();
25
22
26
- if (!waitForCondition (() -> Boolean . FALSE . equals ( getLogInjectionEnabled () ))) {
23
+ if (!waitForCondition (() -> ! getLogInjectionEnabled ())) {
27
24
throw new RuntimeException ("Logs injection config was never updated" );
28
25
}
29
26
30
27
thirdTracedMethod ();
31
28
32
- if (!waitForCondition (() -> Boolean . TRUE . equals ( getLogInjectionEnabled () ))) {
29
+ if (!waitForCondition (() -> getLogInjectionEnabled ())) {
33
30
throw new RuntimeException ("Logs injection config was never updated a second time" );
34
31
}
35
32
@@ -43,14 +40,8 @@ public void run() throws InterruptedException {
43
40
Thread .sleep (400 );
44
41
}
45
42
46
- private static Object getLogInjectionEnabled () {
47
- ConfigSetting configSetting =
48
- ConfigCollector .getAppliedConfigSetting (
49
- LOGS_INJECTION_ENABLED , ConfigCollector .get ().collect ());
50
- if (configSetting == null ) {
51
- return null ;
52
- }
53
- return configSetting .value ;
43
+ private static Boolean getLogInjectionEnabled () {
44
+ return Config .get ().isLogsInjectionEnabled ();
54
45
}
55
46
56
47
@ Trace
0 commit comments