diff --git a/public/app/core/logs_model.ts b/public/app/core/logs_model.ts index bde1bd525a0..2e16093b144 100644 --- a/public/app/core/logs_model.ts +++ b/public/app/core/logs_model.ts @@ -364,9 +364,7 @@ export function logSeriesToLogsModel(logSeries: DataFrame[]): LogsModel | undefi series, timeField, labelsField, - timeNanosecondField: fieldCache.hasFieldWithNameAndType('tsNs', FieldType.time) - ? fieldCache.getFieldByName('tsNs') - : undefined, + timeNanosecondField: fieldCache.getFieldByName('tsNs'), stringField, logLevelField: fieldCache.getFieldByName('level'), idField: getIdField(fieldCache), diff --git a/public/app/plugins/datasource/loki/backendResultTransformer.test.ts b/public/app/plugins/datasource/loki/backendResultTransformer.test.ts index 2d01b584b63..89ee35f8dfd 100644 --- a/public/app/plugins/datasource/loki/backendResultTransformer.test.ts +++ b/public/app/plugins/datasource/loki/backendResultTransformer.test.ts @@ -62,7 +62,6 @@ describe('loki backendResultTransformer', () => { lokiQueryStatKey: 'Summary: total bytes processed', }, }; - expectedFrame.fields[3].type = FieldType.time; const expected: DataQueryResponse = { data: [expectedFrame] }; diff --git a/public/app/plugins/datasource/loki/backendResultTransformer.ts b/public/app/plugins/datasource/loki/backendResultTransformer.ts index cff060731d7..d2d8004f6f2 100644 --- a/public/app/plugins/datasource/loki/backendResultTransformer.ts +++ b/public/app/plugins/datasource/loki/backendResultTransformer.ts @@ -28,28 +28,8 @@ function processStreamFrame(frame: DataFrame, query: LokiQuery | undefined): Dat lokiQueryStatKey: 'Summary: total bytes processed', }, }; - const newFrame = setFrameMeta(frame, meta); - const newFields = newFrame.fields.map((field) => { - switch (field.name) { - case 'tsNs': { - // we need to switch the field-type to be `time` - return { - ...field, - type: FieldType.time, - }; - } - default: { - // no modification needed - return field; - } - } - }); - - return { - ...newFrame, - fields: newFields, - }; + return setFrameMeta(frame, meta); } function processStreamsFrames(frames: DataFrame[], queryMap: Map): DataFrame[] {