Skip to content

Commit

Permalink
feat: GA service health dashboard + metrics alerting + k8s dashboard …
Browse files Browse the repository at this point in the history
…/ metrics side panel (#379)
  • Loading branch information
wrn14897 authored Apr 19, 2024
1 parent 3a85c0a commit 4d6fb8f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 70 deletions.
6 changes: 6 additions & 0 deletions .changeset/gold-stingrays-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperdx/app': minor
'@hyperdx/api': minor
---

feat: GA service health dashboard + metrics alert
6 changes: 6 additions & 0 deletions .changeset/sweet-singers-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperdx/app': minor
'@hyperdx/api': minor
---

feat: GA k8s dashboard / metrics side panel
85 changes: 38 additions & 47 deletions packages/app/src/AppNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ import { version } from '../package.json';

import api from './api';
import AuthLoadingBlocker from './AuthLoadingBlocker';
import {
IS_LOCAL_MODE,
K8S_DASHBOARD_ENABLED,
SERVER_URL,
SERVICE_DASHBOARD_ENABLED,
} from './config';
import { IS_LOCAL_MODE, SERVER_URL } from './config';
import Icon from './Icon';
import Logo from './Logo';
import { KubernetesFlatIcon } from './SVGIcons';
Expand Down Expand Up @@ -1126,48 +1121,44 @@ export default function AppNav({ fixed = false }: { fixed?: boolean }) {
</Link>
</div>

{SERVICE_DASHBOARD_ENABLED ? (
<div className="px-3 my-3">
<Link
href="/services"
className={cx(
'text-decoration-none d-flex justify-content-between align-items-center fs-7 text-muted-hover',
{
'fw-bold text-success': pathname.includes('/services'),
},
)}
>
<span>
<i className="bi bi-heart-pulse pe-1 text-slate-300" />{' '}
{!isCollapsed && <span>Service Health</span>}
</span>
</Link>
</div>
) : null}
<div className="px-3 my-3">
<Link
href="/services"
className={cx(
'text-decoration-none d-flex justify-content-between align-items-center fs-7 text-muted-hover',
{
'fw-bold text-success': pathname.includes('/services'),
},
)}
>
<span>
<i className="bi bi-heart-pulse pe-1 text-slate-300" />{' '}
{!isCollapsed && <span>Service Health</span>}
</span>
</Link>
</div>

{K8S_DASHBOARD_ENABLED ? (
<div className="px-3 my-3">
<Link
href="/kubernetes"
className={cx(
'text-decoration-none d-flex justify-content-between align-items-center fs-7 text-muted-hover',
{
'fw-bold text-success': pathname.includes('/kubernetes'),
},
)}
>
<span>
<span
className="pe-1 text-slate-300"
style={{ top: -2, position: 'relative' }}
>
<KubernetesFlatIcon width={16} />
</span>{' '}
{!isCollapsed && <span>Kubernetes</span>}
</span>
</Link>
</div>
) : null}
<div className="px-3 my-3">
<Link
href="/kubernetes"
className={cx(
'text-decoration-none d-flex justify-content-between align-items-center fs-7 text-muted-hover',
{
'fw-bold text-success': pathname.includes('/kubernetes'),
},
)}
>
<span>
<span
className="pe-1 text-slate-300"
style={{ top: -2, position: 'relative' }}
>
<KubernetesFlatIcon width={16} />
</span>{' '}
{!isCollapsed && <span>Kubernetes</span>}
</span>
</Link>
</div>

<div>
<div
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/EditChartForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
} from './ChartUtils';
import Checkbox from './Checkbox';
import * as config from './config';
import { METRIC_ALERTS_ENABLED } from './config';
import EditChartFormAlerts from './EditChartFormAlerts';
import GranularityPicker from './GranularityPicker';
import HDXHistogramChart from './HDXHistogramChart';
Expand Down Expand Up @@ -1274,7 +1273,8 @@ export const EditLineChartForm = ({

const isChartAlertsFeatureEnabled =
alerts != null &&
(_editedChart.series[0].table === 'logs' || METRIC_ALERTS_ENABLED);
((_editedChart.series[0].table ?? 'logs') === 'logs' ||
_editedChart.series[0].table === 'metrics');

return (
<form
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/LogSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import {
K8S_FILESYSTEM_NUMBER_FORMAT,
K8S_MEM_NUMBER_FORMAT,
} from './ChartUtils';
import { K8S_METRICS_ENABLED } from './config';
import { CurlGenerator } from './curlGenerator';
import LogLevel from './LogLevel';
import {
Expand Down Expand Up @@ -2734,7 +2733,7 @@ export default function LogSidePanel({
},
] as const)
: []),
...(K8S_METRICS_ENABLED && hasK8sContext
...(hasK8sContext
? ([
{
text: 'Infrastructure',
Expand Down
25 changes: 10 additions & 15 deletions packages/app/src/Spotlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useRouter } from 'next/router';
import { Spotlight, SpotlightActionData } from '@mantine/spotlight';

import api from './api';
import { SERVICE_DASHBOARD_ENABLED } from './config';
import Logo from './Icon';

import '@mantine/spotlight/styles.css';
Expand Down Expand Up @@ -104,20 +103,16 @@ const useSpotlightActions = () => {
router.push('/alerts');
},
},
...(SERVICE_DASHBOARD_ENABLED
? [
{
id: 'service-health',
group: 'Menu',
label: 'Service Health',
leftSection: <i className="bi bi-heart-pulse" />,
description: 'HTTP, Database and Infrastructure metrics',
onClick: () => {
router.push('/services');
},
},
]
: []),
{
id: 'service-health',
group: 'Menu',
label: 'Service Health',
leftSection: <i className="bi bi-heart-pulse" />,
description: 'HTTP, Database and Infrastructure metrics',
onClick: () => {
router.push('/services');
},
},
{
id: 'team-settings',
group: 'Menu',
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ export const IS_LOCAL_MODE =
process.env.NEXT_PUBLIC_IS_LOCAL_MODE ?? 'false' === 'true';

// Features in development
export const METRIC_ALERTS_ENABLED = process.env.NODE_ENV === 'development';
export const K8S_METRICS_ENABLED = process.env.NODE_ENV === 'development';
export const SERVICE_DASHBOARD_ENABLED = process.env.NODE_ENV === 'development';
export const K8S_DASHBOARD_ENABLED = process.env.NODE_ENV === 'development';

0 comments on commit 4d6fb8f

Please sign in to comment.