File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
telemetry/src/test/groovy/datadog/telemetry/metric Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package datadog.telemetry.metric
2+
3+ import datadog.telemetry.TelemetryService
4+ import datadog.telemetry.api.Metric
5+ import spock.lang.Specification
6+
7+ class ConfigInversionMetricPeriodicActionTest extends Specification {
8+
9+ void ' test otel env var hiding metric' () {
10+ setup :
11+ final telemetryService = Mock (TelemetryService )
12+ final action = new ConfigInversionMetricPeriodicAction ()
13+
14+ when :
15+ action. collector(). setUndocumentedEnvVarMetric(" DD_ENV_VAR" )
16+ action. collector(). prepareMetrics()
17+ action. doIteration(telemetryService)
18+
19+ then :
20+ 1 * telemetryService. addMetric({ Metric metric ->
21+ metric. namespace == ' tracers' &&
22+ metric. metric == ' untracked.config.detected' &&
23+ metric. points[0 ][1 ] == 1 &&
24+ metric. tags == [' config_name:DD_ENV_VAR' ] &&
25+ metric. type == Metric.TypeEnum . COUNT
26+ })
27+ 0 * _. _
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments