mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 17:48:59 +08:00
feat: limit is updated (#3730)
This commit is contained in:
parent
d5df9a1f7f
commit
1588d3a199
@ -1,4 +1,5 @@
|
|||||||
import { themeColors } from 'constants/theme';
|
import { themeColors } from 'constants/theme';
|
||||||
|
import { limit } from 'lib/getChartData';
|
||||||
import { CSSProperties } from 'react';
|
import { CSSProperties } from 'react';
|
||||||
|
|
||||||
const positionCss: CSSProperties['position'] = 'absolute';
|
const positionCss: CSSProperties['position'] = 'absolute';
|
||||||
@ -26,5 +27,4 @@ export const overlayStyles: CSSProperties = {
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WARNING_MESSAGE =
|
export const WARNING_MESSAGE = `Too many timeseries in the result. UI has restricted to showing the top ${limit}. Please check the query if this is needed and contact support@signoz.io if you need to show >${limit} timeseries in the panel`;
|
||||||
'Too many timeseries in the result. UI has restricted to showing the top 20. Please check the query if this is needed and contact support@signoz.io if you need to show >20 timeseries in the panel';
|
|
||||||
|
@ -5,6 +5,8 @@ import { QueryData } from 'types/api/widgets/getQuery';
|
|||||||
import convertIntoEpoc from './covertIntoEpoc';
|
import convertIntoEpoc from './covertIntoEpoc';
|
||||||
import { colors } from './getRandomColor';
|
import { colors } from './getRandomColor';
|
||||||
|
|
||||||
|
export const limit = 30;
|
||||||
|
|
||||||
const getChartData = ({
|
const getChartData = ({
|
||||||
queryData,
|
queryData,
|
||||||
createDataset,
|
createDataset,
|
||||||
@ -14,10 +16,6 @@ const getChartData = ({
|
|||||||
isWarning: boolean;
|
isWarning: boolean;
|
||||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||||
} => {
|
} => {
|
||||||
const limit = process.env.FRONTEND_CHART_LIMIT
|
|
||||||
? +process.env.FRONTEND_CHART_LIMIT
|
|
||||||
: 20;
|
|
||||||
|
|
||||||
const uniqueTimeLabels = new Set<number>();
|
const uniqueTimeLabels = new Set<number>();
|
||||||
queryData.forEach((data) => {
|
queryData.forEach((data) => {
|
||||||
data.queryData.forEach((query) => {
|
data.queryData.forEach((query) => {
|
||||||
@ -118,7 +116,7 @@ const getChartData = ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
data: updatedData,
|
data: updatedData,
|
||||||
isWarning: isWarningLimit && (updatedDataSet?.length || 0) > limit,
|
isWarning: isWarningLimit && (allLabels?.length || 0) > limit,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ const plugins = [
|
|||||||
INTERCOM_APP_ID: process.env.INTERCOM_APP_ID,
|
INTERCOM_APP_ID: process.env.INTERCOM_APP_ID,
|
||||||
SEGMENT_ID: process.env.SEGMENT_ID,
|
SEGMENT_ID: process.env.SEGMENT_ID,
|
||||||
CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID,
|
CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID,
|
||||||
FRONTEND_CHART_LIMIT: process.env.FRONTEND_CHART_LIMIT,
|
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
@ -42,7 +42,6 @@ const plugins = [
|
|||||||
INTERCOM_APP_ID: process.env.INTERCOM_APP_ID,
|
INTERCOM_APP_ID: process.env.INTERCOM_APP_ID,
|
||||||
SEGMENT_ID: process.env.SEGMENT_ID,
|
SEGMENT_ID: process.env.SEGMENT_ID,
|
||||||
CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID,
|
CLARITY_PROJECT_ID: process.env.CLARITY_PROJECT_ID,
|
||||||
FRONTEND_CHART_LIMIT: process.env.FRONTEND_CHART_LIMIT,
|
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin(),
|
new MiniCssExtractPlugin(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user