1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +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,
"disableMetrics": false,
"disableNotifications": false,
"edgeBulkMetricsKillSwitch": false,
"edgeBulkMetrics": false,
"embedProxy": true,
"embedProxyFrontend": true,
"enableLicense": false,

View File

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

View File

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