Skip to content

Commit

Permalink
feat: 监控trace datasource插件开发
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 25761
  • Loading branch information
liangling0628 committed Dec 4, 2024
1 parent e7ba861 commit e608493
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/common/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@
"应用/服务": "Application/Service",
"无数据": "No data",
"Profile 类型": "Profile type",
"加载中": "Loading"
"加载中": "Loading",
"最小耗时": "Min Duration",
"最大耗时": "Max Duration",
"服务": "Service",
"接口": "Span Name",
"应用": "App Name",
"查询方式": "Query Mode"
}
9 changes: 9 additions & 0 deletions src/trace/src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { css } from '@emotion/css';
import type { QueryEditorProps, SelectableValue } from '@grafana/data';
import {
Button,
HorizontalGroup,
InlineField,
InlineFieldRow,
Expand Down Expand Up @@ -124,6 +125,14 @@ export function QueryEditor({ datasource, query, onChange, onRunQuery }: Props)
/>
</HorizontalGroup>
</InlineField>
<Button
style={{ marginLeft: '10px' }}
size='md'
fill='solid'
onClick={onRunQuery}
>
{t('查询')}
</Button>
</InlineFieldRow>
<InlineFieldRow style={{ maxWidth: '500px' }}>
<InlineField
Expand Down
3 changes: 1 addition & 2 deletions src/trace/src/responseTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function toSpanRow(span: Span, processes: Record<string, TraceProcess>): TraceSp
...l,
timestamp: l.timestamp / 1000,
})),
tags: span.tags,
tags: span.attributes,
warnings: span.warnings ?? undefined,
stackTraces: span.stackTraces,
serviceName: processes[span.processID].serviceName,
Expand Down Expand Up @@ -109,7 +109,6 @@ export function createTableFrame(
app_name: appName,
});
}
console.info(frame, '==============');
return frame;
}

Expand Down
1 change: 1 addition & 0 deletions src/trace/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type Span = {
duration: number;
logs: TraceLog[];
tags?: TraceKeyValuePair[];
attributes?: TraceKeyValuePair[];
references?: TraceSpanReference[];
warnings?: null | string[];
stackTraces?: string[];
Expand Down

0 comments on commit e608493

Please sign in to comment.