1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-04 01:18:20 +02:00

fix: disable networkView for dev, fail more gracefully (#2701)

Disables networkView for dev for now. Attempts to fail more gracefully
both on the service and front-end.
This commit is contained in:
Nuno Góis 2022-12-15 10:12:02 +00:00 committed by GitHub
parent dc8a369b7b
commit 90f0d665f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 11 deletions

View File

@ -26,12 +26,13 @@ import theme from '../../../themes/theme';
import { formatDateHM } from '../../../utils/formatDate';
import { RequestsPerSecondSchema } from 'openapi';
import 'chartjs-adapter-date-fns';
import { PaletteColor } from '@mui/material';
import { Alert, PaletteColor } from '@mui/material';
import { PageContent } from '../../common/PageContent/PageContent';
import { PageHeader } from '../../common/PageHeader/PageHeader';
import { Box } from '@mui/system';
import { current } from 'immer';
import { CyclicIterator } from 'utils/cyclicIterator';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
interface IPoint {
x: number;
y: number;
@ -184,15 +185,21 @@ export const InstanceMetricsChart: VFC = () => {
return (
<PageContent header={<PageHeader title="Requests per second" />}>
<Box sx={{ display: 'grid', gap: 4 }}>
<div style={{ height: 400 }}>
<Line
data={data}
options={options}
aria-label="An instance metrics line chart with two lines: requests per second for admin API and requests per second for client API"
/>
</div>
</Box>
<ConditionallyRender
condition={data.datasets.length === 0}
show={<Alert severity="warning">No data available.</Alert>}
elseShow={
<Box sx={{ display: 'grid', gap: 4 }}>
<div style={{ height: 400 }}>
<Line
data={data}
options={options}
aria-label="An instance metrics line chart with two lines: requests per second for admin API and requests per second for client API"
/>
</div>
</Box>
}
/>
</PageContent>
);
};

View File

@ -225,6 +225,10 @@ export default class ClientInstanceService {
}
async getRPSForPath(path: string, hoursToQuery: number): Promise<any> {
if (!this.prometheusApi) {
this.logger.warn('Prometheus not configured');
return;
}
const timeoutSeconds = 5;
const basePath = this.serverOption.baseUriPath;
const compositePath = `${basePath}/${path}`.replaceAll('//', '/');

View File

@ -42,7 +42,6 @@ process.nextTick(async () => {
changeRequests: true,
favorites: true,
variantsPerEnvironment: true,
networkView: true,
},
},
authentication: {