-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tracing): overall and per-span latency display (#1871)
* fix(tracing): overall and per-span latency display * fix(tracing): update and reorganize sampler attributes * fix(tracing): remove unused color constants * fix(tracing): output type * fix(tracing): add more span attribute keys * fix(tracing): move all latency attributes to the dedicated section * fix(tracing): revert * fix(tracing): address feedback on latency display
- Loading branch information
1 parent
8f71361
commit 0b418a4
Showing
20 changed files
with
495 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,8 @@ | |
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
body { | ||
overscroll-behavior-y: none; | ||
} | ||
</style> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
packages/core/tracing/src/components/trace-viewer/SpanLatencyTable.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<template> | ||
<div | ||
v-if="latencies.length > 0" | ||
class="span-latency-table" | ||
> | ||
<div class="title"> | ||
{{ t('trace_viewer.latency.section_title') }} | ||
</div> | ||
|
||
<div class="latencies"> | ||
<template | ||
v-for="latency in latencies" | ||
:key="latency.key" | ||
> | ||
<ConfigCardItem | ||
:item="{ | ||
type: ConfigurationSchemaType.Text, | ||
key: latency.key, | ||
label: latency.labelKey ? t(latency.labelKey) : latency.key, | ||
value: formatLatency(latency.milliseconds), | ||
}" | ||
/> | ||
|
||
<template v-if="Array.isArray(latency.children) && latency.children.length > 0"> | ||
<ConfigCardItem | ||
v-for="child in latency.children" | ||
:key="child.key" | ||
class="latency-nested" | ||
:item="{ | ||
type: ConfigurationSchemaType.Text, | ||
key: child.key, | ||
label: child.labelKey ? t(child.labelKey) : child.key, | ||
value: formatLatency(child.milliseconds), | ||
}" | ||
/> | ||
</template> | ||
</template> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ConfigCardItem, ConfigurationSchemaType } from '@kong-ui-public/entities-shared' | ||
import { computed } from 'vue' | ||
import composables from '../../composables' | ||
import { WATERFALL_ROW_PADDING_X } from '../../constants' | ||
import type { SpanNode } from '../../types' | ||
import { formatLatency, toSpanLatencies } from '../../utils' | ||
const { i18n: { t } } = composables.useI18n() | ||
const props = defineProps<{ span: SpanNode['span'] }>() | ||
const latencies = computed(() => toSpanLatencies(props.span.attributes)) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.span-latency-table { | ||
align-items: flex-start; | ||
display: flex; | ||
flex-direction: column; | ||
.title { | ||
background-color: $kui-color-background-neutral-weakest; | ||
border-bottom: 1px solid $kui-color-border-neutral-weaker; | ||
font-size: $kui-font-size-30; | ||
font-weight: $kui-font-weight-semibold; | ||
padding: $kui-space-60 v-bind(WATERFALL_ROW_PADDING_X); | ||
width: 100%; | ||
} | ||
.latencies { | ||
width: 100%; | ||
:deep(.config-card-details-value) { | ||
font-family: $kui-font-family-code; | ||
font-size: $kui-font-size-30; | ||
.copy-text { | ||
font-size: $kui-font-size-30; | ||
} | ||
} | ||
.latency-nested { | ||
:deep(.config-card-details-label) { | ||
padding-left: $kui-space-40; | ||
} | ||
} | ||
} | ||
} | ||
</style> |
45 changes: 45 additions & 0 deletions
45
packages/core/tracing/src/components/trace-viewer/TraceLatency.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<div class="trace-latency"> | ||
<div class="title"> | ||
{{ t('trace_viewer.latency.label') }} | ||
</div> | ||
|
||
<div | ||
v-for="latency in latencies" | ||
:key="latency.key" | ||
class="latency" | ||
> | ||
{{ latency.labelKey ? t(latency.labelKey) : latency.key }}: {{ formatLatency(latency.milliseconds) }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
import composables from '../../composables' | ||
import type { SpanNode } from '../../types' | ||
import { formatLatency, toOverviewLatencies } from '../../utils' | ||
const { i18n: { t } } = composables.useI18n() | ||
const props = defineProps<{ span: SpanNode['span'] }>() | ||
const latencies = computed(() => toOverviewLatencies(props.span.attributes)) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.trace-latency { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: row; | ||
flex-grow: 1; | ||
flex-shrink: 0; | ||
font-size: $kui-font-size-30; | ||
gap: $kui-space-40; | ||
justify-content: flex-start; | ||
.title { | ||
font-weight: $kui-font-weight-semibold; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.