mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-13 13:48:59 +02:00
chore: clear unknown flags every 24h instead of every 7d
This commit is contained in:
parent
1d3aea47dc
commit
f50df47a7d
@ -22,9 +22,15 @@ const StyledAlert = styled(Alert)(({ theme }) => ({
|
|||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const StyledAlertContent = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
}));
|
||||||
|
|
||||||
const StyledUl = styled('ul')(({ theme }) => ({
|
const StyledUl = styled('ul')(({ theme }) => ({
|
||||||
paddingTop: theme.spacing(2),
|
paddingTop: theme.spacing(1),
|
||||||
paddingBottom: theme.spacing(2),
|
paddingBottom: theme.spacing(1),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const UnknownFlagsTable = () => {
|
export const UnknownFlagsTable = () => {
|
||||||
@ -142,29 +148,40 @@ export const UnknownFlagsTable = () => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StyledAlert severity='info'>
|
<StyledAlert severity='info'>
|
||||||
<p>
|
<StyledAlertContent>
|
||||||
<strong>Unknown flags</strong> are feature flags that your
|
<p>
|
||||||
SDKs tried to evaluate but which Unleash doesn't recognize.
|
<strong>Unknown flags</strong> are feature flags that
|
||||||
Tracking them helps you catch typos, remove outdated flags,
|
your SDKs tried to evaluate but which Unleash doesn't
|
||||||
and keep your code and configuration in sync. These can
|
recognize. Tracking them helps you catch typos, remove
|
||||||
include:
|
outdated flags, and keep your code and configuration in
|
||||||
</p>
|
sync. These can include:
|
||||||
|
</p>
|
||||||
|
|
||||||
<StyledUl>
|
<StyledUl>
|
||||||
<li>
|
<li>
|
||||||
<b>Missing flags</b>: typos or flags referenced in code
|
<b>Missing flags</b>: typos or flags referenced in
|
||||||
that don't exist in Unleash.
|
code that don't exist in Unleash.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>Invalid flags</b>: flags with malformed or unexpected
|
<b>Invalid flags</b>: flags with malformed or
|
||||||
names, unsupported by Unleash.
|
unexpected names, unsupported by Unleash.
|
||||||
</li>
|
</li>
|
||||||
</StyledUl>
|
</StyledUl>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
We display up to 1,000 unknown flag reports from the last 7
|
Each row in the table represents an{' '}
|
||||||
days. Older flags are automatically pruned.
|
<strong>unknown flag report</strong>, which is a unique
|
||||||
</p>
|
combination of <em>flag name</em>, <em>application</em>,
|
||||||
|
and <em>environment</em>. The same flag name may appear
|
||||||
|
multiple times if it's been seen in different
|
||||||
|
applications or environments.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
We display up to 1,000 unknown flag reports from the
|
||||||
|
last 24 hours. Older reports are automatically pruned.
|
||||||
|
</p>
|
||||||
|
</StyledAlertContent>
|
||||||
</StyledAlert>
|
</StyledAlert>
|
||||||
|
|
||||||
<SearchHighlightProvider value={getSearchText(searchValue)}>
|
<SearchHighlightProvider value={getSearchText(searchValue)}>
|
||||||
@ -181,14 +198,14 @@ export const UnknownFlagsTable = () => {
|
|||||||
condition={searchValue?.length > 0}
|
condition={searchValue?.length > 0}
|
||||||
show={
|
show={
|
||||||
<TablePlaceholder>
|
<TablePlaceholder>
|
||||||
No unknown flags found matching “
|
No unknown flag reports found matching “
|
||||||
{searchValue}
|
{searchValue}
|
||||||
”
|
”
|
||||||
</TablePlaceholder>
|
</TablePlaceholder>
|
||||||
}
|
}
|
||||||
elseShow={
|
elseShow={
|
||||||
<TablePlaceholder>
|
<TablePlaceholder>
|
||||||
No unknown flags reported in the last 7 days.
|
No unknown flags reported in the last 24 hours.
|
||||||
</TablePlaceholder>
|
</TablePlaceholder>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -43,9 +43,9 @@ export default class UnknownFlagsController extends Controller {
|
|||||||
openApiService.validPath({
|
openApiService.validPath({
|
||||||
operationId: 'getUnknownFlags',
|
operationId: 'getUnknownFlags',
|
||||||
tags: ['Unstable'],
|
tags: ['Unstable'],
|
||||||
summary: 'Get latest reported unknown flag names',
|
summary: 'Get unknown flag reports',
|
||||||
description:
|
description:
|
||||||
'Returns a list of unknown flag reports from the last 7 days, if any. Maximum of 1000.',
|
'Returns a list of unknown flag reports from the last 24 hours, if any. Maximum of 1000.',
|
||||||
responses: {
|
responses: {
|
||||||
200: createResponseSchema('unknownFlagsResponseSchema'),
|
200: createResponseSchema('unknownFlagsResponseSchema'),
|
||||||
},
|
},
|
||||||
|
@ -203,8 +203,8 @@ export const scheduleServices = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
schedulerService.schedule(
|
schedulerService.schedule(
|
||||||
unknownFlagsService.clear.bind(unknownFlagsService, 24 * 7),
|
unknownFlagsService.clear.bind(unknownFlagsService, 24),
|
||||||
hoursToMilliseconds(24),
|
hoursToMilliseconds(6),
|
||||||
'clearUnknownFlags',
|
'clearUnknownFlags',
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -761,7 +761,7 @@ export function registerPrometheusMetrics(
|
|||||||
|
|
||||||
const unknownFlagsGauge = createGauge({
|
const unknownFlagsGauge = createGauge({
|
||||||
name: 'unknown_flags',
|
name: 'unknown_flags',
|
||||||
help: 'Number of unknown flags reported in the last 24 hours, if any. Maximum of 10.',
|
help: 'Number of unknown flags reported in the last 24 hours, if any. Maximum of 1000.',
|
||||||
});
|
});
|
||||||
|
|
||||||
// register event listeners
|
// register event listeners
|
||||||
|
@ -5,7 +5,7 @@ export const unknownFlagSchema = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
required: ['name', 'appName', 'seenAt', 'environment'],
|
required: ['name', 'appName', 'seenAt', 'environment'],
|
||||||
description: 'An unknown flag that has been reported by the system',
|
description: 'An unknown flag report',
|
||||||
properties: {
|
properties: {
|
||||||
name: {
|
name: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -6,8 +6,7 @@ export const unknownFlagsResponseSchema = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
required: ['unknownFlags'],
|
required: ['unknownFlags'],
|
||||||
description:
|
description: 'A list of unknown flag reports',
|
||||||
'A list of unknown flags that have been reported by the system',
|
|
||||||
properties: {
|
properties: {
|
||||||
unknownFlags: {
|
unknownFlags: {
|
||||||
description: 'The list of recently reported unknown flags.',
|
description: 'The list of recently reported unknown flags.',
|
||||||
|
Loading…
Reference in New Issue
Block a user