1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00

task: Make /edge/metrics toggleable by toggle (#6003)

Previously we used a killswitch and returned 404 if the feature was
enabled. This flips that to a default disabled toggle, that has to be
turned on to handle old Edge (pre 17.0.0) posting bulk metrics
This commit is contained in:
Christopher Kolstad 2024-01-24 14:09:03 +01:00 committed by GitHub
parent 1f7c7940b4
commit 3acdfc2cf4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -85,7 +85,7 @@ exports[`should create default config 1`] = `
"disableBulkToggle": false, "disableBulkToggle": false,
"disableMetrics": false, "disableMetrics": false,
"disableNotifications": false, "disableNotifications": false,
"edgeBulkMetricsKillSwitch": false, "edgeBulkMetrics": false,
"embedProxy": true, "embedProxy": true,
"embedProxyFrontend": true, "embedProxyFrontend": true,
"enableLicense": false, "enableLicense": false,

View File

@ -118,7 +118,7 @@ export default class EdgeController extends Controller {
req: IAuthRequest<void, void, BulkMetricsSchema>, req: IAuthRequest<void, void, BulkMetricsSchema>,
res: Response<void>, res: Response<void>,
): Promise<void> { ): Promise<void> {
if (!this.flagResolver.isEnabled('edgeBulkMetricsKillSwitch')) { if (this.flagResolver.isEnabled('edgeBulkMetrics')) {
const { body, ip: clientIp } = req; const { body, ip: clientIp } = req;
const { metrics, applications } = body; const { metrics, applications } = body;

View File

@ -40,7 +40,7 @@ export type IFlagKey =
| 'featureSearchFeedback' | 'featureSearchFeedback'
| 'featureSearchFeedbackPosting' | 'featureSearchFeedbackPosting'
| 'newStrategyConfigurationFeedback' | 'newStrategyConfigurationFeedback'
| 'edgeBulkMetricsKillSwitch' | 'edgeBulkMetrics'
| 'extendedUsageMetrics' | 'extendedUsageMetrics'
| 'extendedUsageMetricsUI' | 'extendedUsageMetricsUI'
| 'adminTokenKillSwitch' | 'adminTokenKillSwitch'
@ -185,8 +185,8 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_ENCRYPT_EMAILS, process.env.UNLEASH_EXPERIMENTAL_ENCRYPT_EMAILS,
false, false,
), ),
edgeBulkMetricsKillSwitch: parseEnvVarBoolean( edgeBulkMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EDGE_BULK_METRICS_KILL_SWITCH, process.env.UNLEASH_EXPERIMENTAL_EDGE_BULK_METRICS,
false, false,
), ),
extendedUsageMetrics: parseEnvVarBoolean( extendedUsageMetrics: parseEnvVarBoolean(