Compare commits

...

3 Commits

Author SHA1 Message Date
Andre Pereira
d977bef175 prettier fix 2025-12-17 15:00:26 +00:00
Joe Elliott
3fe6533637 cleanup
Signed-off-by: Joe Elliott <number101010@gmail.com>
2025-11-24 09:42:40 -05:00
Joe Elliott
5f0b58b830 Correctly stream multiple metrics series
Signed-off-by: Joe Elliott <number101010@gmail.com>
2025-11-24 08:32:48 -05:00
2 changed files with 12 additions and 3 deletions

View File

@@ -811,7 +811,7 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
return merge( return merge(
...targets.map((target) => ...targets.map((target) =>
doTempoSearchStreaming( doTempoSearchStreaming(
{ ...target, query }, { ...target, query: this.applyVariables(target, options.scopedVars).query },
this, // the datasource this, // the datasource
options, options,
this.instanceSettings this.instanceSettings
@@ -857,7 +857,7 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
return merge( return merge(
...targets.map((target) => ...targets.map((target) =>
doTempoMetricsStreaming( doTempoMetricsStreaming(
{ ...target, query }, { ...target, query: this.applyVariables(target, options.scopedVars).query },
this, // the datasource this, // the datasource
options options
) )

View File

@@ -5,6 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
import { import {
DataFrame, DataFrame,
dataFrameFromJSON, dataFrameFromJSON,
DataFrameJSON,
DataQueryRequest, DataQueryRequest,
DataQueryResponse, DataQueryResponse,
DataSourceInstanceSettings, DataSourceInstanceSettings,
@@ -165,7 +166,15 @@ export function doTempoMetricsStreaming(
} }
newResult = { newResult = {
data: data?.map(dataFrameFromJSON) ?? [], data:
data?.map((frame: DataFrameJSON) => {
const df = dataFrameFromJSON(frame);
// preserve the query's refId to prevent conflation of series from different queries
if (query.refId) {
df.refId = query.refId;
}
return df;
}) ?? [],
state, state,
}; };
} }