diff --git a/pkg/redis-time-series.go b/pkg/redis-time-series.go index 5388b1f..319ca59 100644 --- a/pkg/redis-time-series.go +++ b/pkg/redis-time-series.go @@ -42,9 +42,9 @@ func (ds *redisDatasource) queryTsRange(from int64, to int64, qm queryModel, cli } // Create data frame response - frame := data.NewFrame(qm.Key, + frame := data.NewFrame(legend, data.NewField("time", nil, []time.Time{}), - data.NewField(legend, nil, []float64{})) + data.NewField(qm.Value, nil, []float64{})) // Previous time to fill missing intervals var prevTime time.Time @@ -140,7 +140,7 @@ func (ds *redisDatasource) queryTsMRange(from int64, to int64, qm queryModel, cl } // Use value's label if specified - value := "value" + value := "" if qm.Value != "" { value = labels[qm.Value] } diff --git a/src/components/query-editor.tsx b/src/components/query-editor.tsx index f382fb7..a892296 100644 --- a/src/components/query-editor.tsx +++ b/src/components/query-editor.tsx @@ -241,6 +241,17 @@ export class QueryEditor extends PureComponent { /> )} + {CommandParameters.value.includes(command) && ( + + )} + {CommandParameters.legendLabel.includes(command) && ( { value={legend} onChange={this.onLegendChange} label="Legend Label" - tooltip="Legend Label" /> )} diff --git a/src/data-source.ts b/src/data-source.ts index 09bbf72..29db346 100644 --- a/src/data-source.ts +++ b/src/data-source.ts @@ -79,6 +79,8 @@ export class DataSource extends DataSourceWithBackend> = [ { label: 'Max', description: 'Maximum', value: AggregationValue.MAX }, { label: 'Min', description: 'Minimum', value: AggregationValue.MIN }, { label: 'Range', description: 'Diff between maximum and minimum in the bucket', value: AggregationValue.RANGE }, - { label: 'Sum', description: 'Sum', value: AggregationValue.SUM }, + { label: 'Sum', description: 'Summation', value: AggregationValue.SUM }, ];