@@ -2,6 +2,7 @@ package datadog.telemetry.metric
2
2
3
3
import datadog.telemetry.TelemetryService
4
4
import datadog.telemetry.api.Metric
5
+ import datadog.trace.api.ConfigOrigin
5
6
import datadog.trace.api.telemetry.AppSecMetricCollector
6
7
import datadog.trace.test.util.DDSpecification
7
8
@@ -14,24 +15,24 @@ class AppSecEnabledMetricPeriodicActionTest extends DDSpecification {
14
15
def collector = AppSecMetricCollector . get()
15
16
16
17
when :
17
- collector. appSecEnabled(true , " ENV_VAR " )
18
- collector. appSecEnabled(false , " REMOTE_CONFIG " )
18
+ collector. appSecEnabled(true , ConfigOrigin . ENV . value )
19
+ collector. appSecEnabled(false , ConfigOrigin . REMOTE . value )
19
20
action. doIteration(telemetryService)
20
21
21
22
then :
22
23
1 * telemetryService. addMetric({ Metric metric ->
23
24
metric. namespace == ' appsec' &&
24
- metric. metric == ' appsec. enabled' &&
25
+ metric. metric == ' enabled' &&
25
26
metric. points[0 ][1 ] == 1 &&
26
- metric. tags. contains(' origin:ENV_VAR ' ) &&
27
- metric. type == Metric.TypeEnum . COUNT
27
+ metric. tags. contains(' origin:env_var ' ) &&
28
+ metric. type == Metric.TypeEnum . GAUGE
28
29
})
29
30
1 * telemetryService. addMetric({ Metric metric ->
30
31
metric. namespace == ' appsec' &&
31
- metric. metric == ' appsec. enabled' &&
32
+ metric. metric == ' enabled' &&
32
33
metric. points[0 ][1 ] == 0 &&
33
- metric. tags. contains(' origin:REMOTE_CONFIG ' ) &&
34
- metric. type == Metric.TypeEnum . COUNT
34
+ metric. tags. contains(' origin:remote_config ' ) &&
35
+ metric. type == Metric.TypeEnum . GAUGE
35
36
})
36
37
0 * _. _
37
38
}
0 commit comments