#include "OpenTelemetryLog.h" #include #include #include #include #include #include #include namespace DB { Block OpenTelemetrySpanLogElement::createBlock() { return { {std::make_shared(), "trace_id"}, {std::make_shared(), "span_id"}, {std::make_shared(), "parent_span_id"}, {std::make_shared(), "operation_name"}, {std::make_shared(6), "start_time_us"}, {std::make_shared(6), "finish_time_us"}, {std::make_shared(), "finish_date"}, {std::make_shared(std::make_shared()), "attribute.names"}, {std::make_shared(std::make_shared()), "attribute.values"} }; } void OpenTelemetrySpanLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; columns[i++]->insert(UInt128(Int128(trace_id))); columns[i++]->insert(span_id); columns[i++]->insert(parent_span_id); columns[i++]->insert(operation_name); columns[i++]->insert(start_time_us); columns[i++]->insert(finish_time_us); columns[i++]->insert(DateLUT::instance().toDayNum(finish_time_us / 1000000)); columns[i++]->insert(attribute_names); columns[i++]->insert(attribute_values); } }