From e608493b19c0b3bed3ad2506df03f467bd55bd8c Mon Sep 17 00:00:00 2001 From: liangling Date: Wed, 4 Dec 2024 10:33:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=91=E6=8E=A7trace=20datasource?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=BC=80=E5=8F=91=20#=20Reviewed,=20transact?= =?UTF-8?q?ion=20id:=2025761?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/lang/en.json | 8 +++++++- src/trace/src/components/QueryEditor.tsx | 9 +++++++++ src/trace/src/responseTransform.ts | 3 +-- src/trace/src/types.ts | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/common/lang/en.json b/src/common/lang/en.json index af8afbf..b2c679d 100644 --- a/src/common/lang/en.json +++ b/src/common/lang/en.json @@ -82,5 +82,11 @@ "应用/服务": "Application/Service", "无数据": "No data", "Profile 类型": "Profile type", - "加载中": "Loading" + "加载中": "Loading", + "最小耗时": "Min Duration", + "最大耗时": "Max Duration", + "服务": "Service", + "接口": "Span Name", + "应用": "App Name", + "查询方式": "Query Mode" } diff --git a/src/trace/src/components/QueryEditor.tsx b/src/trace/src/components/QueryEditor.tsx index a0cc507..147277a 100644 --- a/src/trace/src/components/QueryEditor.tsx +++ b/src/trace/src/components/QueryEditor.tsx @@ -1,6 +1,7 @@ import { css } from '@emotion/css'; import type { QueryEditorProps, SelectableValue } from '@grafana/data'; import { + Button, HorizontalGroup, InlineField, InlineFieldRow, @@ -124,6 +125,14 @@ export function QueryEditor({ datasource, query, onChange, onRunQuery }: Props) /> + ): TraceSp ...l, timestamp: l.timestamp / 1000, })), - tags: span.tags, + tags: span.attributes, warnings: span.warnings ?? undefined, stackTraces: span.stackTraces, serviceName: processes[span.processID].serviceName, @@ -109,7 +109,6 @@ export function createTableFrame( app_name: appName, }); } - console.info(frame, '=============='); return frame; } diff --git a/src/trace/src/types.ts b/src/trace/src/types.ts index 2ec1e4e..e217d62 100644 --- a/src/trace/src/types.ts +++ b/src/trace/src/types.ts @@ -36,6 +36,7 @@ export type Span = { duration: number; logs: TraceLog[]; tags?: TraceKeyValuePair[]; + attributes?: TraceKeyValuePair[]; references?: TraceSpanReference[]; warnings?: null | string[]; stackTraces?: string[];