Open
Description
import(
"go.opentelemetry.io/collector/pdata/plog"
"github.com/open-telemetry/otel-arrow/pkg/otel/arrow_record"
)
// ...
logs := plog.NewLogs()
resourceLogs := logs.ResourceLogs().AppendEmpty()
scopeLogs := resourceLogs.ScopeLogs().AppendEmpty()
_ = scopeLogs.LogRecords().AppendEmpty()
producer := arrow_record.NewProducer()
bar, err := producer.BatchArrowRecordsFromLogs(logs)
This produces a single record batch with the following content:
| resource | scope | time_unix_nano | observed_time_unix_nano | trace_id | span_id |
+----------+---------+----------------------+-------------------------+----------------------------------+------------------+
| {id: 0} | {id: 0} | 1970-01-01T00:00:00Z | 1970-01-01T00:00:00Z | 00000000000000000000000000000000 | 0000000000000000 |
+----------+---------+----------------------+-------------------------+----------------------------------+------------------+
I'm thinking it was probably not intentional that we add the trace_id & span_id columns to the record batch, especially considering in the schema metadata we mark them as optional columns:
otel-arrow/pkg/otel/logs/arrow/logs.go
Lines 48 to 49 in ff5ba27