Skip to content

Commit d83ff5d

Browse files
committed
Add a missing test
1 parent 26a3413 commit d83ff5d

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

exporters/otlp/common/src/testIncubating/java/io/opentelemetry/exporter/internal/otlp/logs/LogsRequestMarshalerIncubatingTest.java

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import com.google.protobuf.Message;
1414
import com.google.protobuf.util.JsonFormat;
1515
import io.opentelemetry.api.common.Attributes;
16+
import io.opentelemetry.api.common.Value;
17+
import io.opentelemetry.api.incubator.common.ExtendedAttributeKey;
1618
import io.opentelemetry.api.incubator.common.ExtendedAttributes;
1719
import io.opentelemetry.api.internal.OtelEncodingUtils;
1820
import io.opentelemetry.api.logs.Severity;
@@ -91,7 +93,7 @@ void toProtoLogRecord(MarshalerSource marshalerSource) {
9193
.setSpanContext(
9294
SpanContext.create(
9395
TRACE_ID, SPAN_ID, TraceFlags.getDefault(), TraceState.getDefault()))
94-
.setTotalAttributeCount(10)
96+
.setTotalAttributeCount(11)
9597
.setTimestamp(12345, TimeUnit.NANOSECONDS)
9698
.setObservedTimestamp(6789, TimeUnit.NANOSECONDS)
9799
// Extended fields
@@ -119,6 +121,21 @@ void toProtoLogRecord(MarshalerSource marshalerSource) {
119121
.build())
120122
.put("str_key", "str_value")
121123
.build())
124+
.put(
125+
ExtendedAttributeKey.valueKey("value_key"),
126+
Value.of(
127+
io.opentelemetry.api.common.KeyValue.of(
128+
"bool_key", Value.of(true)),
129+
io.opentelemetry.api.common.KeyValue.of(
130+
"double_key", Value.of(1.1)),
131+
io.opentelemetry.api.common.KeyValue.of("int_key", Value.of(1)),
132+
io.opentelemetry.api.common.KeyValue.of(
133+
"value_key",
134+
Value.of(
135+
io.opentelemetry.api.common.KeyValue.of(
136+
"str_key", Value.of("str_value")))),
137+
io.opentelemetry.api.common.KeyValue.of(
138+
"str_key", Value.of("str_value"))))
122139
.build())
123140
.build()));
124141

@@ -163,6 +180,27 @@ void toProtoLogRecord(MarshalerSource marshalerSource) {
163180
.build()))
164181
.addValues(keyValue("str_key", anyValue("str_value")))
165182
.build())
183+
.build()),
184+
keyValue(
185+
"value_key",
186+
AnyValue.newBuilder()
187+
.setKvlistValue(
188+
KeyValueList.newBuilder()
189+
.addValues(keyValue("bool_key", anyValue(true)))
190+
.addValues(keyValue("double_key", anyValue(1.1)))
191+
.addValues(keyValue("int_key", anyValue(1)))
192+
.addValues(
193+
keyValue(
194+
"value_key",
195+
AnyValue.newBuilder()
196+
.setKvlistValue(
197+
KeyValueList.newBuilder()
198+
.addValues(
199+
keyValue("str_key", anyValue("str_value")))
200+
.build())
201+
.build()))
202+
.addValues(keyValue("str_key", anyValue("str_value")))
203+
.build())
166204
.build()));
167205
}
168206

0 commit comments

Comments
 (0)