From f50ab457bd17ab35f9a8b9c1bc776754b5ccddcc Mon Sep 17 00:00:00 2001 From: Hamas Shafiq Date: Wed, 19 Oct 2022 13:11:33 +0100 Subject: [PATCH] Tempo: Fix Node Graph visualization type in dashboard (#56931) Co-authored-by: Andrej Ocenas --- public/app/plugins/datasource/tempo/datasource.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/app/plugins/datasource/tempo/datasource.ts b/public/app/plugins/datasource/tempo/datasource.ts index bbbfb956de7..4338784e06a 100644 --- a/public/app/plugins/datasource/tempo/datasource.ts +++ b/public/app/plugins/datasource/tempo/datasource.ts @@ -427,6 +427,12 @@ function serviceMapQuery(request: DataQueryRequest, datasourceUid: s } const { nodes, edges } = mapPromMetricsToServiceMap(responses, request.range); + + // No handling of multiple targets assume just one. NodeGraph does not support it anyway, but still should be + // fixed at some point. + nodes.refId = request.targets[0].refId; + edges.refId = request.targets[0].refId; + nodes.fields[0].config = getFieldConfig( datasourceUid, tempoDatasourceUid, @@ -607,6 +613,7 @@ function makePromServiceMapRequest(options: DataQueryRequest): DataQ ...options, targets: serviceMapMetrics.map((metric) => { return { + format: 'table', refId: metric, // options.targets[0] is not correct here, but not sure what should happen if you have multiple queries for // service map at the same time anyway