@@ -427,7 +427,7 @@ func TestExporterLogs(t *testing.T) {
427
427
body : func () pcommon.Value {
428
428
return pcommon .NewValueStr ("foo" )
429
429
}(),
430
- wantDocument : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"1970-01-01T00:00:00.000000000Z ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"text":"foo"}}` ),
430
+ wantDocument : []byte (`{"@timestamp":"0.0 ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"0.0 ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"text":"foo"}}` ),
431
431
},
432
432
{
433
433
body : func () pcommon.Value {
@@ -438,7 +438,7 @@ func TestExporterLogs(t *testing.T) {
438
438
m .PutEmptyMap ("inner" ).PutStr ("foo" , "bar" )
439
439
return vm
440
440
}(),
441
- wantDocument : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"1970-01-01T00:00:00.000000000Z ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"flattened":{"true":true,"false":false,"inner":{"foo":"bar"}}}}` ),
441
+ wantDocument : []byte (`{"@timestamp":"0.0 ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"0.0 ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"flattened":{"true":true,"false":false,"inner":{"foo":"bar"}}}}` ),
442
442
},
443
443
{
444
444
body : func () pcommon.Value {
@@ -450,7 +450,7 @@ func TestExporterLogs(t *testing.T) {
450
450
return vm
451
451
}(),
452
452
isEvent : true ,
453
- wantDocument : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"1970-01-01T00:00:00.000000000Z ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"structured":{"true":true,"false":false,"inner":{"foo":"bar"}}}}` ),
453
+ wantDocument : []byte (`{"@timestamp":"0.0 ","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"0.0 ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"structured":{"true":true,"false":false,"inner":{"foo":"bar"}}}}` ),
454
454
},
455
455
{
456
456
body : func () pcommon.Value {
@@ -461,7 +461,7 @@ func TestExporterLogs(t *testing.T) {
461
461
s .AppendEmpty ().SetEmptyMap ().PutStr ("foo" , "bar" )
462
462
return vs
463
463
}(),
464
- wantDocument : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"1970-01-01T00:00:00.000000000Z ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"flattened":{"value":["foo",false,{"foo":"bar"}]}}}` ),
464
+ wantDocument : []byte (`{"@timestamp":"0.0 ","attributes":{"attr.foo":"attr.foo.value"},"data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"0.0 ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"flattened":{"value":["foo",false,{"foo":"bar"}]}}}` ),
465
465
},
466
466
{
467
467
body : func () pcommon.Value {
@@ -473,7 +473,7 @@ func TestExporterLogs(t *testing.T) {
473
473
return vs
474
474
}(),
475
475
isEvent : true ,
476
- wantDocument : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"1970-01-01T00:00:00.000000000Z ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"structured":{"value":["foo",false,{"foo":"bar"}]}}}` ),
476
+ wantDocument : []byte (`{"@timestamp":"0.0 ","attributes":{"attr.foo":"attr.foo.value","event.name":"foo"},"event_name":"foo","data_stream":{"dataset":"attr.dataset.otel","namespace":"resource.attribute.namespace","type":"logs"},"observed_timestamp":"0.0 ","resource":{"attributes":{"resource.attr.foo":"resource.attr.foo.value"}},"scope":{},"body":{"structured":{"value":["foo",false,{"foo":"bar"}]}}}` ),
477
477
},
478
478
} {
479
479
rec := newBulkRecorder ()
@@ -1196,19 +1196,19 @@ func TestExporterMetrics(t *testing.T) {
1196
1196
expected := []itemRequest {
1197
1197
{
1198
1198
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.metric.foo":"histogram"}}}` ),
1199
- Document : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.foo":{"counts":[1,2,3,4],"values":[0.5,1.5,2.5,3.0]}},"resource":{},"scope":{}}` ),
1199
+ Document : []byte (`{"@timestamp":"0.0 ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.foo":{"counts":[1,2,3,4],"values":[0.5,1.5,2.5,3.0]}},"resource":{},"scope":{}}` ),
1200
1200
},
1201
1201
{
1202
1202
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.metric.foo":"histogram"}}}` ),
1203
- Document : []byte (`{"@timestamp":"1970-01-01T01:00:00.000000000Z ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.foo":{"counts":[4,5,6,7],"values":[2.0,4.5,5.5,6.0]}},"resource":{},"scope":{}}` ),
1203
+ Document : []byte (`{"@timestamp":"3600000.0 ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.foo":{"counts":[4,5,6,7],"values":[2.0,4.5,5.5,6.0]}},"resource":{},"scope":{}}` ),
1204
1204
},
1205
1205
{
1206
1206
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.metric.sum":"gauge_double"}}}` ),
1207
- Document : []byte (`{"@timestamp":"1970-01-01T01:00:00.000000000Z ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.sum":1.5},"resource":{},"scope":{},"start_timestamp":"1970-01-01T02:00:00.000000000Z "}` ),
1207
+ Document : []byte (`{"@timestamp":"3600000.0 ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.sum":1.5},"resource":{},"scope":{},"start_timestamp":"7200000.0 "}` ),
1208
1208
},
1209
1209
{
1210
1210
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.metric.summary":"summary"}}}` ),
1211
- Document : []byte (`{"@timestamp":"1970-01-01T03:00:00.000000000Z ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.summary":{"sum":1.5,"value_count":1}},"resource":{},"scope":{},"start_timestamp":"1970-01-01T03:00:00.000000000Z "}` ),
1211
+ Document : []byte (`{"@timestamp":"10800000.0 ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"metric.summary":{"sum":1.5,"value_count":1}},"resource":{},"scope":{},"start_timestamp":"10800000.0 "}` ),
1212
1212
},
1213
1213
}
1214
1214
@@ -1277,7 +1277,7 @@ func TestExporterMetrics(t *testing.T) {
1277
1277
expected := []itemRequest {
1278
1278
{
1279
1279
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.sum":"gauge_long","metrics.summary":"summary"}}}` ),
1280
- Document : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"sum":0,"summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1280
+ Document : []byte (`{"@timestamp":"0.0 ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"sum":0,"summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1281
1281
},
1282
1282
}
1283
1283
@@ -1327,11 +1327,11 @@ func TestExporterMetrics(t *testing.T) {
1327
1327
expected := []itemRequest {
1328
1328
{
1329
1329
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.histogram.summary":"summary"}}}` ),
1330
- Document : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"histogram.summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1330
+ Document : []byte (`{"@timestamp":"0.0 ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"histogram.summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1331
1331
},
1332
1332
{
1333
1333
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.exphistogram.summary":"summary"}}}` ),
1334
- Document : []byte (`{"@timestamp":"1970-01-01T01:00:00.000000000Z ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"exphistogram.summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1334
+ Document : []byte (`{"@timestamp":"3600000.0 ","_doc_count":10,"data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"exphistogram.summary":{"sum":1.0,"value_count":10}},"resource":{},"scope":{}}` ),
1335
1335
},
1336
1336
}
1337
1337
@@ -1370,7 +1370,7 @@ func TestExporterMetrics(t *testing.T) {
1370
1370
expected := []itemRequest {
1371
1371
{
1372
1372
Action : []byte (`{"create":{"_index":"metrics-generic.otel-default","dynamic_templates":{"metrics.foo.bar":"gauge_long","metrics.foo":"gauge_long","metrics.foo.bar.baz":"gauge_long"}}}` ),
1373
- Document : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"foo":0,"foo.bar":0,"foo.bar.baz":0},"resource":{},"scope":{}}` ),
1373
+ Document : []byte (`{"@timestamp":"0.0 ","data_stream":{"dataset":"generic.otel","namespace":"default","type":"metrics"},"attributes":{},"metrics":{"foo":0,"foo.bar":0,"foo.bar.baz":0},"resource":{},"scope":{}}` ),
1374
1374
},
1375
1375
}
1376
1376
@@ -1655,11 +1655,11 @@ func TestExporterTraces(t *testing.T) {
1655
1655
expected := []itemRequest {
1656
1656
{
1657
1657
Action : []byte (`{"create":{"_index":"traces-generic.otel-default"}}` ),
1658
- Document : []byte (`{"@timestamp":"1970-01-01T01:00:00.000000000Z ","attributes":{"attr.foo":"attr.bar"},"data_stream":{"dataset":"generic.otel","namespace":"default","type":"traces"},"dropped_attributes_count":2,"dropped_events_count":3,"dropped_links_count":4,"duration":3600000000000,"kind":"Unspecified","links":[{"attributes":{"link.attr.foo":"link.attr.bar"},"dropped_attributes_count":11,"span_id":"0100000000000000","trace_id":"01000000000000000000000000000000","trace_state":"bar"}],"name":"name","resource":{"attributes":{"resource.foo":"resource.bar"}},"scope":{},"status":{"code":"Unset"},"trace_state":"foo"}` ),
1658
+ Document : []byte (`{"@timestamp":"3600000.0 ","attributes":{"attr.foo":"attr.bar"},"data_stream":{"dataset":"generic.otel","namespace":"default","type":"traces"},"dropped_attributes_count":2,"dropped_events_count":3,"dropped_links_count":4,"duration":3600000000000,"kind":"Unspecified","links":[{"attributes":{"link.attr.foo":"link.attr.bar"},"dropped_attributes_count":11,"span_id":"0100000000000000","trace_id":"01000000000000000000000000000000","trace_state":"bar"}],"name":"name","resource":{"attributes":{"resource.foo":"resource.bar"}},"scope":{},"status":{"code":"Unset"},"trace_state":"foo"}` ),
1659
1659
},
1660
1660
{
1661
1661
Action : []byte (`{"create":{"_index":"logs-generic.otel-default"}}` ),
1662
- Document : []byte (`{"@timestamp":"1970-01-01T00:00:00.000000000Z ","event_name":"exception","attributes":{"event.attr.foo":"event.attr.bar","event.name":"exception"},"event_name":"exception","data_stream":{"dataset":"generic.otel","namespace":"default","type":"logs"},"dropped_attributes_count":1,"resource":{"attributes":{"resource.foo":"resource.bar"}},"scope":{}}` ),
1662
+ Document : []byte (`{"@timestamp":"0.0 ","event_name":"exception","attributes":{"event.attr.foo":"event.attr.bar","event.name":"exception"},"event_name":"exception","data_stream":{"dataset":"generic.otel","namespace":"default","type":"logs"},"dropped_attributes_count":1,"resource":{"attributes":{"resource.foo":"resource.bar"}},"scope":{}}` ),
1663
1663
},
1664
1664
}
1665
1665
0 commit comments