Skip to content

Commit 19d9d55

Browse files
committed
Fix compile error after merge
1 parent b4cdcef commit 19d9d55

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

x-pack/plugin/otel-data/src/test/java/org/elasticsearch/xpack/oteldata/otlp/docbuilder/MetricDocumentBuilderTests.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.opentelemetry.proto.common.v1.InstrumentationScope;
1111
import io.opentelemetry.proto.common.v1.KeyValue;
1212
import io.opentelemetry.proto.metrics.v1.AggregationTemporality;
13-
import io.opentelemetry.proto.metrics.v1.Metric;
1413
import io.opentelemetry.proto.metrics.v1.SummaryDataPoint;
1514
import io.opentelemetry.proto.resource.v1.Resource;
1615

@@ -201,26 +200,28 @@ public void testSummary() throws Exception {
201200
Resource resource = Resource.newBuilder().build();
202201
InstrumentationScope scope = InstrumentationScope.newBuilder().build();
203202

204-
SummaryDataPoint dataPoint = SummaryDataPoint.newBuilder()
205-
.setTimeUnixNano(timestamp)
206-
.setStartTimeUnixNano(startTimestamp)
207-
.setCount(1)
208-
.setSum(42.0)
209-
.addAllAttributes(mappingHints(MappingHints.DOC_COUNT))
210-
.build();
211-
Metric metric = createSummaryMetric("summary", "", List.of());
212-
List<DataPoint> dataPoints = List.of(new DataPoint.Summary(dataPoint, metric));
213-
214203
DataPointGroupingContext.DataPointGroup dataPointGroup = new DataPointGroupingContext.DataPointGroup(
215204
resource,
216205
null,
217206
scope,
218207
null,
219208
List.of(),
220209
"",
221-
dataPoints,
222210
"metrics-generic.otel-default"
223211
);
212+
dataPointGroup.addDataPoint(
213+
Set.of(),
214+
new DataPoint.Summary(
215+
SummaryDataPoint.newBuilder()
216+
.setTimeUnixNano(timestamp)
217+
.setStartTimeUnixNano(startTimestamp)
218+
.setCount(1)
219+
.setSum(42.0)
220+
.addAllAttributes(mappingHints(MappingHints.DOC_COUNT))
221+
.build(),
222+
createSummaryMetric("summary", "", List.of())
223+
)
224+
);
224225

225226
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
226227
HashMap<String, String> dynamicTemplates = documentBuilder.buildMetricDocument(builder, dataPointGroup);

0 commit comments

Comments
 (0)