query log with trace params

This commit is contained in:
Qiuxia Fan 2022-07-26 18:13:15 +08:00
parent 4dd198b9a6
commit 04014a13be
3 changed files with 11 additions and 2 deletions

View File

@ -48,6 +48,8 @@ export interface LayoutConfig {
endTime: string;
};
traceId?: string;
spanId?: string;
segmentId?: string;
};
}

View File

@ -252,6 +252,11 @@ function searchLogs() {
category: state.category.value,
});
} else {
let segmentId, spanId;
if (options && options.filters) {
segmentId = options.filters.segmentId;
spanId = options.filters.spanId;
}
logStore.setLogCondition({
serviceId: selectorStore.currentService
? selectorStore.currentService.id
@ -263,7 +268,9 @@ function searchLogs() {
excludingKeywordsOfContent: excludingKeywordsOfContent.value,
tags: tagsMap.value.length ? tagsMap.value : undefined,
paging: { pageNum: 1, pageSize: 15 },
relatedTrace: traceId.value ? { traceId: traceId.value } : undefined,
relatedTrace: traceId.value
? { traceId: traceId.value, segmentId, spanId }
: undefined,
});
}
queryLogs();

View File

@ -83,7 +83,7 @@ limitations under the License. -->
</div>
</template>
<script lang="ts" setup>
import { ref, inject } from "vue";
import { inject } from "vue";
import { useI18n } from "vue-i18n";
import type { PropType } from "vue";
import dayjs from "dayjs";