Chore: fixes Loki annotation tags deduplication (#24275)

This commit is contained in:
Lukas Siatka 2020-05-06 19:05:00 +02:00 committed by GitHub
parent c0a1319a25
commit fa260fec87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -355,6 +355,7 @@ describe('LokiDatasource', () => {
{
stream: {
label: 'value',
label2: 'value ',
},
values: [['1549016857498000000', 'hello']],
},

View File

@ -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);