-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: group by severity logs explorer page by default (#5772)
* feat: initial setup for group by severity logs explorer page * chore: reduce the height of the histogram * chore: pr cleanup * chore: minor color update * chore: clean the PR * chore: clean the PR * chore: better base handling * fix: append query names to the legends in case of multiple queries * feat: make the changes only for list view and add back legends
- Loading branch information
1 parent
6661aa7
commit 43577c7
Showing
6 changed files
with
68 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Color } from '@signozhq/design-tokens'; | ||
import { themeColors } from 'constants/theme'; | ||
import { colors } from 'lib/getRandomColor'; | ||
|
||
export function getColorsForSeverityLabels( | ||
label: string, | ||
index: number, | ||
): string { | ||
const lowerCaseLabel = label.toLowerCase(); | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="trace"}`)) { | ||
return Color.BG_ROBIN_300; | ||
} | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="debug"}`)) { | ||
return Color.BG_FOREST_500; | ||
} | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="info"}`)) { | ||
return Color.BG_SLATE_400; | ||
} | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="warn"}`)) { | ||
return Color.BG_AMBER_500; | ||
} | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="error"}`)) { | ||
return Color.BG_CHERRY_500; | ||
} | ||
|
||
if (lowerCaseLabel.includes(`{severity_text="fatal"}`)) { | ||
return Color.BG_SAKURA_500; | ||
} | ||
|
||
return colors[index % colors.length] || themeColors.red; | ||
} |
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