InfluxDB: InfluxQL: adds tags to timeseries data (#36702)

* influxdb: influxql: return tags in timeseries

* influxdb: influxql: added tests
pull/36730/head^2
Gábor Farkas 4 years ago committed by GitHub
parent f77f3d8a9d
commit 815f9a7557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/app/plugins/datasource/influxdb/influx_series.ts
  2. 8
      public/app/plugins/datasource/influxdb/specs/influx_series.test.ts

@ -51,7 +51,13 @@ export default class InfluxSeries {
}
}
output.push({ target: seriesName, datapoints: datapoints, meta: this.meta, refId: this.refId });
output.push({
target: seriesName,
datapoints: datapoints,
tags: series.tags,
meta: this.meta,
refId: this.refId,
});
}
});

@ -138,12 +138,20 @@ describe('when generating timeseries from influxdb response', () => {
expect(result[0].datapoints[0][1]).toBe(1431946625000);
expect(result[0].datapoints[1][0]).toBe(12);
expect(result[0].datapoints[1][1]).toBe(1431946626000);
expect(result[0].tags).toMatchObject({
app: 'test',
server: 'server1',
});
expect(result[1].target).toBe('cpu.mean {app: test2, server: server2}');
expect(result[1].datapoints[0][0]).toBe(15);
expect(result[1].datapoints[0][1]).toBe(1431946625000);
expect(result[1].datapoints[1][0]).toBe(16);
expect(result[1].datapoints[1][1]).toBe(1431946626000);
expect(result[1].tags).toMatchObject({
app: 'test2',
server: 'server2',
});
});
});

Loading…
Cancel
Save