diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts
index c691ba02..07032df1 100644
--- a/src/views/dashboard/data.ts
+++ b/src/views/dashboard/data.ts
@@ -266,8 +266,9 @@ export const TextColors: { [key: string]: string } = {
};
export const RefIdTypes = [
- { label: "Trace ID", value: "traceId" },
{ label: "None", value: "none" },
+ { label: "Trace ID", value: "traceId" },
+ { label: "Owner", value: "owner" },
];
export const RefreshOptions = [
{ label: "Last 30 minutes", value: "30", step: "MINUTE" },
diff --git a/src/views/dashboard/graphs/TopList.vue b/src/views/dashboard/graphs/TopList.vue
index 2c1349f3..de9e9861 100644
--- a/src/views/dashboard/graphs/TopList.vue
+++ b/src/views/dashboard/graphs/TopList.vue
@@ -32,7 +32,7 @@ limitations under the License. -->
{{ t("copy") }}
-
+
{{ t("viewTrace") }}
@@ -75,7 +75,7 @@ limitations under the License. -->
const props = defineProps({
data: {
type: Object as PropType<{
- [key: string]: { name: string; value: number; refId: string }[];
+ [key: string]: { name: string; value: number; refId: string; owner: object }[];
}>,
default: () => ({}),
},
@@ -97,9 +97,7 @@ limitations under the License. -->
const traceOptions = ref<{ type: string; filters?: unknown }>({
type: WidgetType.Trace,
});
- const refIdType = computed(
- () => (props.config.relatedTrace && props.config.relatedTrace.refIdType) || RefIdTypes[0].value,
- );
+ const refIdType = computed(() => props.config.relatedTrace && props.config.relatedTrace.refIdType);
const key = computed(() => Object.keys(props.data)[0] || "");
const available = computed(
() => Array.isArray(props.data[key.value]) && props.data[key.value][0] && props.data[key.value][0].value,
@@ -114,14 +112,15 @@ limitations under the License. -->
function handleClick(i: string) {
copy(i);
}
- function viewTrace(item: { name: string; refId: string; value: unknown }) {
+ function viewTrace(item: { name: string; refId: string; value: unknown; owner: object }) {
const filters = {
...item,
queryOrder: QueryOrders[1].value,
status: Status[2].value,
- id: item.refId,
+ id: refIdType.value === RefIdTypes[1].value ? item.refId : undefined,
metricValue: [{ label: props.config.expressions[0], data: item.value, value: item.name }],
isReadRecords: props.config.typesOfMQE.includes(ExpressionResultType.RECORD_LIST) || undefined,
+ owner: refIdType.value === RefIdTypes[2].value ? item.owner : null,
};
traceOptions.value = {
...traceOptions.value,
diff --git a/src/views/dashboard/related/trace/Header.vue b/src/views/dashboard/related/trace/Header.vue
index f845ebbb..8ea1cfdf 100644
--- a/src/views/dashboard/related/trace/Header.vue
+++ b/src/views/dashboard/related/trace/Header.vue
@@ -103,6 +103,7 @@ limitations under the License. -->
});
const { t } = useI18n();
const filters = reactive(props.data.filters || {});
+ const owner = reactive(props.data.owner || {});
const appStore = useAppStoreWithOut();
const selectorStore = useSelectorStore();
const dashboardStore = useDashboardStore();
@@ -133,14 +134,16 @@ limitations under the License. -->
}
conditions.value = (items.value[0] && items.value[0].label) || "";
if (!filters.id) {
- state.service = selectorStore.currentService.id;
- if (dashboardStore.entity === EntityType[2].value) {
- state.endpoint = selectorStore.currentPod.id;
+ if (owner) {
+ state.service = owner.serviceID;
+ if (owner.scope === EntityType[2].value) {
+ state.endpoint = owner.endpointID;
+ }
+ if (owner.scope === EntityType[3].value) {
+ state.instance = owner.serviceInstanceID;
+ }
+ await queryTraces();
}
- if (dashboardStore.entity === EntityType[3].value) {
- state.instance = selectorStore.currentPod.id;
- }
- await queryTraces();
return;
}
if (filters.isReadRecords) {