diff --git a/dashboards-observability/common/types/explorer.ts b/dashboards-observability/common/types/explorer.ts index 1342826a4..682cec360 100644 --- a/dashboards-observability/common/types/explorer.ts +++ b/dashboards-observability/common/types/explorer.ts @@ -264,6 +264,7 @@ export interface ConfigListEntry { name: string; side: string; type: string; + alias?: string; } export interface HistogramConfigList { diff --git a/dashboards-observability/public/components/visualizations/charts/stats/stats.tsx b/dashboards-observability/public/components/visualizations/charts/stats/stats.tsx index e6f6229b5..f67c5083a 100644 --- a/dashboards-observability/public/components/visualizations/charts/stats/stats.tsx +++ b/dashboards-observability/public/components/visualizations/charts/stats/stats.tsx @@ -286,7 +286,9 @@ export const Stats = ({ visualizations, layout, config }: any) => { const generateLineTraces = () => { return metrics.map((metric: ConfigListEntry, metricIndex: number) => { - const metricLabel = `${metric.aggregation}(${metric.name})`; + const metricLabel = `${ + metric.alias ? metric.alias : `${metric.aggregation}(${metric.name})` + }`; const isLabelExisted = queriedVizData[metricLabel] ? true : false; const annotationOption = { label: metricLabel,