From b9ff68d4d6f1abcc15a5b21feb9e097b41697d67 Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Tue, 19 Oct 2021 11:58:21 +0200 Subject: [PATCH] Tempo: Rename metrics for service graph (#40584) * Rename tempo -> traces * Fix tests Co-authored-by: Ivana --- .../app/plugins/datasource/tempo/datasource.test.ts | 8 ++++---- .../plugins/datasource/tempo/graphTransform.test.ts | 8 ++++---- .../app/plugins/datasource/tempo/graphTransform.ts | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/app/plugins/datasource/tempo/datasource.test.ts b/public/app/plugins/datasource/tempo/datasource.test.ts index 33a6002ac73..444f5c44772 100644 --- a/public/app/plugins/datasource/tempo/datasource.test.ts +++ b/public/app/plugins/datasource/tempo/datasource.test.ts @@ -255,7 +255,7 @@ const defaultSettings: DataSourceInstanceSettings = { }; const totalsPromMetric = new MutableDataFrame({ - refId: 'tempo_service_graph_request_total', + refId: 'traces_service_graph_request_total', fields: [ { name: 'Time', values: [1628169788000, 1628169788000] }, { name: 'client', values: ['app', 'lb'] }, @@ -263,12 +263,12 @@ const totalsPromMetric = new MutableDataFrame({ { name: 'job', values: ['local_scrape', 'local_scrape'] }, { name: 'server', values: ['db', 'app'] }, { name: 'tempo_config', values: ['default', 'default'] }, - { name: 'Value #tempo_service_graph_request_total', values: [10, 20] }, + { name: 'Value #traces_service_graph_request_total', values: [10, 20] }, ], }); const secondsPromMetric = new MutableDataFrame({ - refId: 'tempo_service_graph_request_server_seconds_sum', + refId: 'traces_service_graph_request_server_seconds_sum', fields: [ { name: 'Time', values: [1628169788000, 1628169788000] }, { name: 'client', values: ['app', 'lb'] }, @@ -276,7 +276,7 @@ const secondsPromMetric = new MutableDataFrame({ { name: 'job', values: ['local_scrape', 'local_scrape'] }, { name: 'server', values: ['db', 'app'] }, { name: 'tempo_config', values: ['default', 'default'] }, - { name: 'Value #tempo_service_graph_request_server_seconds_sum', values: [10, 40] }, + { name: 'Value #traces_service_graph_request_server_seconds_sum', values: [10, 40] }, ], }); diff --git a/public/app/plugins/datasource/tempo/graphTransform.test.ts b/public/app/plugins/datasource/tempo/graphTransform.test.ts index 1be5eee83e2..3f622cf35f4 100644 --- a/public/app/plugins/datasource/tempo/graphTransform.test.ts +++ b/public/app/plugins/datasource/tempo/graphTransform.test.ts @@ -110,7 +110,7 @@ const missingSpanResponse = new MutableDataFrame({ }); const totalsPromMetric = new MutableDataFrame({ - refId: 'tempo_service_graph_request_total', + refId: 'traces_service_graph_request_total', fields: [ { name: 'Time', values: [1628169788000, 1628169788000] }, { name: 'client', values: ['app', 'lb'] }, @@ -118,12 +118,12 @@ const totalsPromMetric = new MutableDataFrame({ { name: 'job', values: ['local_scrape', 'local_scrape'] }, { name: 'server', values: ['db', 'app'] }, { name: 'tempo_config', values: ['default', 'default'] }, - { name: 'Value #tempo_service_graph_request_total', values: [10, 20] }, + { name: 'Value #traces_service_graph_request_total', values: [10, 20] }, ], }); const secondsPromMetric = new MutableDataFrame({ - refId: 'tempo_service_graph_request_server_seconds_sum', + refId: 'traces_service_graph_request_server_seconds_sum', fields: [ { name: 'Time', values: [1628169788000, 1628169788000] }, { name: 'client', values: ['app', 'lb'] }, @@ -131,6 +131,6 @@ const secondsPromMetric = new MutableDataFrame({ { name: 'job', values: ['local_scrape', 'local_scrape'] }, { name: 'server', values: ['db', 'app'] }, { name: 'tempo_config', values: ['default', 'default'] }, - { name: 'Value #tempo_service_graph_request_server_seconds_sum', values: [10, 40] }, + { name: 'Value #traces_service_graph_request_server_seconds_sum', values: [10, 40] }, ], }); diff --git a/public/app/plugins/datasource/tempo/graphTransform.ts b/public/app/plugins/datasource/tempo/graphTransform.ts index db124af78b7..c8a95482e11 100644 --- a/public/app/plugins/datasource/tempo/graphTransform.ts +++ b/public/app/plugins/datasource/tempo/graphTransform.ts @@ -127,18 +127,18 @@ function findTraceDuration(view: DataFrameView): number { return traceEndTime - traceStartTime; } -const secondsMetric = 'tempo_service_graph_request_server_seconds_sum'; -const totalsMetric = 'tempo_service_graph_request_total'; +const secondsMetric = 'traces_service_graph_request_server_seconds_sum'; +const totalsMetric = 'traces_service_graph_request_total'; export const serviceMapMetrics = [ secondsMetric, totalsMetric, // We don't show histogram in node graph at the moment but we could later add that into a node context menu. - // 'tempo_service_graph_request_seconds_bucket', - // 'tempo_service_graph_request_seconds_count', + // 'traces_service_graph_request_seconds_bucket', + // 'traces_service_graph_request_seconds_count', // These are used for debugging the tempo collection so probably not useful for service map right now. - // 'tempo_service_graph_unpaired_spans_total', - // 'tempo_service_graph_untagged_spans_total', + // 'traces_service_graph_unpaired_spans_total', + // 'traces_service_graph_untagged_spans_total', ]; /**