in src/datasource.ts [115:136]
function transformSpan(df: DataFrame): TraceSpanRow[] {
let traceSpanRows: TraceSpanRow[] = [];
const fields = df.fields;
const result = new Map(fields.map((key) => [key.name, key.values]));
for (let i = 0; i < df.length; i++) {
const tsd = {
traceID: result.get('traceID')?.get(i),
spanID: result.get('spanID')?.get(i),
parentSpanID: result.get('parentSpanID')?.get(i),
operationName: result.get('operationName')?.get(i),
serviceName: result.get('serviceName')?.get(i),
serviceTags: transServiceTags(result, i),
startTime: result.get('startTime')?.get(i),
duration: result.get('duration')?.get(i),
tags: transTags(result, i),
errorIconColor: result.get('statusCode')?.get(i) === 'ERROR' ? '#f00' : '',
logs: transLogs(result, i),
};
traceSpanRows.push(tsd);
}
return traceSpanRows;
}