Skip to content

Commit

Permalink
Update revision variable for Grafana Dashboard (caraml-dev#35)
Browse files Browse the repository at this point in the history
* Update revision variable for Grafana from Turing UI

Show metrics for all revision when current page is at router level.
Show metrics for a specific revision when current page is at router version level.

This requires the linked dashboard to support variables with All selection.
  • Loading branch information
davidheryanto authored Dec 17, 2020
1 parent df9b327 commit bdfff3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ui/src/hooks/useMonitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ export const useMonitoring = () => {
const { project } = useContext(CurrentProjectContext);

const getMonitoringDashboardUrl = useCallback(
(envName, routerName, revision) => {
(envName, routerName, revision="$_all") => {
const clusterName = getEnvironmentCluster(envName, environments);
const projectName = !!project ? project.name : undefined;

return getMonitoringLink(clusterName, projectName, routerName, revision);
},
[project, environments]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export const RouterDetailsPageNavigation = ({
),
href: getMonitoringDashboardUrl(
router.environment_name,
router.name,
config.version
router.name
),
disabled: !config.version
}
Expand Down
3 changes: 1 addition & 2 deletions ui/src/router/list/ListRoutersTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ const ListRoutersTable = ({ items, isLoaded, error, onRowClick }) => {
const monitoringLink = item.config
? getMonitoringDashboardUrl(
item.environment_name,
item.name,
item.config.version
item.name
)
: undefined;

Expand Down

0 comments on commit bdfff3a

Please sign in to comment.