Skip to content

Commit

Permalink
alias handling for metric label
Browse files Browse the repository at this point in the history
Signed-off-by: Ramneet Chopra <[email protected]>
  • Loading branch information
ramneet-persistent committed Sep 15, 2022
1 parent d080dfe commit a86e813
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions dashboards-observability/common/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export interface ConfigListEntry {
name: string;
side: string;
type: string;
alias?: string;
}

export interface HistogramConfigList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a86e813

Please sign in to comment.