Remove targetFull

It was used in the past two store the query interpolated with sub-queries inside the model and send both to the backed (interpolated and not interpolated). This has been changed though - the logic has been moved away from model to the data source where interpolation happens and now only interpolated query is passed meaning targetFull is not needed anymore.
This commit is contained in:
Piotr Jamróz 2021-08-18 12:14:02 +02:00
parent 698f8e13d4
commit 499f8b33fa
3 changed files with 5 additions and 18 deletions

View File

@ -132,12 +132,7 @@ func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest)
return nil, err
}
s.logger.Debug("graphite", "query", model)
currTarget := ""
if fullTarget, err := model.Get("targetFull").String(); err == nil {
currTarget = fullTarget
} else {
currTarget = model.Get("target").MustString()
}
currTarget := model.Get("target").MustString()
if currTarget == "" {
s.logger.Debug("graphite", "empty query target", model)
emptyQueries = append(emptyQueries, fmt.Sprintf("Query: %v has no target", model))

View File

@ -3566,8 +3566,7 @@
{
"refCount": 0,
"refId": "C",
"target": "alias(asPercent(sumSeries(keepLastValue(metrictank.stats.$environment.$instance.idx.memory.find-cache.ops.hit.rate32, 10)), #B), 'hit-rate')",
"targetFull": "alias(asPercent(sumSeries(keepLastValue(metrictank.stats.$environment.$instance.idx.memory.find-cache.ops.hit.rate32, 10)), alias(sumSeries(keepLastValue(metrictank.stats.$environment.$instance.idx.memory.find-cache.ops.*.rate32, 10)), 'sum')), 'hit-rate')"
"target": "alias(asPercent(sumSeries(keepLastValue(metrictank.stats.$environment.$instance.idx.memory.find-cache.ops.hit.rate32, 10)), alias(sumSeries(keepLastValue(metrictank.stats.$environment.$instance.idx.memory.find-cache.ops.*.rate32, 10)), 'sum')), 'hit-rate')"
}
],
"thresholds": [],
@ -4078,8 +4077,7 @@
{
"refCount": 0,
"refId": "C",
"target": "alias(divideSeries(#B,#A), 'utilisation')",
"targetFull": "alias(divideSeries(alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.used.gauge64), 'used'),alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.max.gauge64), 'max')), 'utilisation')",
"target": "alias(divideSeries(alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.used.gauge64), 'used'),alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.max.gauge64), 'max')), 'utilisation')",
"textEditor": true
},
{
@ -4092,8 +4090,7 @@
{
"refCount": 0,
"refId": "E",
"target": "alias(sum(#B, #D),'total used')",
"targetFull": "alias(sum(alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.used.gauge64), 'used'), sortByName(groupByNodes(aliasByNode(metrictank.stats.$environment.$instance.cache.overhead.*.gauge64, 6), 'sum', 0))),'total used')",
"target": "alias(sum(alias(sumSeries(metrictank.stats.$environment.$instance.cache.size.used.gauge64), 'used'), sortByName(groupByNodes(aliasByNode(metrictank.stats.$environment.$instance.cache.overhead.*.gauge64, 6), 'sum', 0))),'total used')",
"textEditor": true
}
],
@ -4225,8 +4222,7 @@
"hide": true,
"refCount": 0,
"refId": "D",
"target": "alias(divideSeries(#A,#B),'utilisation')",
"targetFull": "alias(divideSeries(alias(sumSeries(metrictank.stats.$environment.$instance.cache.accounting.queue.size.max.gauge64), 'max'),alias(sumSeries(metrictank.stats.$environment.$instance.cache.accounting.queue.size.used.max.gauge32), 'used')),'utilisation')",
"target": "alias(divideSeries(alias(sumSeries(metrictank.stats.$environment.$instance.cache.accounting.queue.size.max.gauge64), 'max'),alias(sumSeries(metrictank.stats.$environment.$instance.cache.accounting.queue.size.used.max.gauge32), 'used')),'utilisation')",
"textEditor": true
}
],

View File

@ -18,10 +18,6 @@ export type GraphiteTag = {
type GraphiteTarget = {
refId: string | number;
target: string;
/**
* Contains full query after interpolating sub-queries (e.g. "function(#A)" referencing query with refId=A)
*/
targetFull: string;
textEditor: boolean;
paused: boolean;
};