Chore: fixes Loki annotation tags deduplication (#24275)

(cherry picked from commit fa260fec87)
This commit is contained in:
Lukas Siatka
2020-05-07 14:59:21 +02:00
committed by Arve Knudsen
parent dcdedaca82
commit 56622c2ba1
2 changed files with 2 additions and 1 deletions
@@ -355,6 +355,7 @@ describe('LokiDatasource', () => {
{
stream: {
label: 'value',
label2: 'value ',
},
values: [['1549016857498000000', 'hello']],
},
@@ -497,7 +497,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
const tags: string[] = [];
for (const field of frame.fields) {
if (field.labels) {
tags.push.apply(tags, Object.values(field.labels));
tags.push.apply(tags, [...new Set(Object.values(field.labels).map((label: string) => label.trim()))]);
}
}
const view = new DataFrameView<{ ts: string; line: string }>(frame);