Skip to content

Commit 65491e2

Browse files
committed
fix test
1 parent 1b3f6b0 commit 65491e2

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/utils/YamlHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private static Map<String, Object> baseProperties(InstrumentationModule module)
140140
Map<String, Object> telemetryEntry = new LinkedHashMap<>();
141141
telemetryEntry.put("when", group);
142142
List<EmittedMetrics.Metric> metrics =
143-
module.getMetrics().getOrDefault(group, Collections.emptyList());
143+
new ArrayList<>(module.getMetrics().getOrDefault(group, Collections.emptyList()));
144144
List<Map<String, Object>> metricsList = new ArrayList<>();
145145

146146
// sort metrics by name for some determinism in the order

instrumentation-docs/src/test/java/io/opentelemetry/instrumentation/docs/utils/YamlHelperTest.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -332,22 +332,24 @@ void testMetricsParsing() throws Exception {
332332
target_versions:
333333
library:
334334
- org.apache.mylib:mylib-core:2.3.0
335-
metrics:
336-
- name: db.client.operation.duration
337-
description: Duration of database client operations.
338-
type: HISTOGRAM
339-
unit: s
340-
attributes:
341-
- name: db.namespace
342-
type: STRING
343-
- name: db.operation.name
344-
type: STRING
345-
- name: db.system.name
346-
type: STRING
347-
- name: server.address
348-
type: STRING
349-
- name: server.port
350-
type: LONG
335+
telemetry:
336+
- when: default
337+
metrics:
338+
- name: db.client.operation.duration
339+
description: Duration of database client operations.
340+
type: HISTOGRAM
341+
unit: s
342+
attributes:
343+
- name: db.namespace
344+
type: STRING
345+
- name: db.operation.name
346+
type: STRING
347+
- name: db.system.name
348+
type: STRING
349+
- name: server.address
350+
type: STRING
351+
- name: server.port
352+
type: LONG
351353
""";
352354

353355
assertThat(expectedYaml).isEqualTo(stringWriter.toString());

0 commit comments

Comments
 (0)