heatmap: fix middle bucket bound for prometheus

This commit is contained in:
Alexander Zobnin 2019-03-11 15:54:40 +03:00
parent 57f48f17a0
commit 2085397f31
No known key found for this signature in database
GPG Key ID: E17E9ABACEFA59EB

View File

@ -231,7 +231,10 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
tsBuckets = _.map(this.series, 'label'); tsBuckets = _.map(this.series, 'label');
const yBucketBound = this.panel.yBucketBound; const yBucketBound = this.panel.yBucketBound;
if ((panelDatasource === 'prometheus' && yBucketBound !== 'lower') || yBucketBound === 'upper') { if (
(panelDatasource === 'prometheus' && yBucketBound !== 'lower' && yBucketBound !== 'middle') ||
yBucketBound === 'upper'
) {
// Prometheus labels are upper inclusive bounds, so add empty bottom bucket label. // Prometheus labels are upper inclusive bounds, so add empty bottom bucket label.
tsBuckets = [''].concat(tsBuckets); tsBuckets = [''].concat(tsBuckets);
} else { } else {