From bb2f88980c4309ae21f65a62d8abf0fcfc6870d7 Mon Sep 17 00:00:00 2001 From: David Leek Date: Thu, 8 Feb 2024 14:46:54 +0100 Subject: [PATCH] chore: add feature flag for request counting inside Unleash (#6164) ## About the changes Adds the feature flag for use in request traffic counting --- src/lib/__snapshots__/create-config.test.ts.snap | 1 + src/lib/types/experimental.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 328c45fee9..67e002234e 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -79,6 +79,7 @@ exports[`should create default config 1`] = ` "caseInsensitiveInOperators": false, "celebrateUnleash": false, "changeRequestConflictHandling": false, + "collectTrafficDataUsage": false, "createdByUserIdDataMigration": false, "customRootRolesKillSwitch": false, "demo": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 60247db978..0038224348 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -48,6 +48,7 @@ export type IFlagKey = | 'createdByUserIdDataMigration' | 'showInactiveUsers' | 'inMemoryScheduledChangeRequests' + | 'collectTrafficDataUsage' | 'useMemoizedActiveTokens'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -237,6 +238,10 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_IN_MEMORY_SCHEDULED_CHANGE_REQUESTS, false, ), + collectTrafficDataUsage: parseEnvVarBoolean( + process.env.UNLEASH_EXPERIMENTAL_COLLECT_TRAFFIC_DATA_USAGE, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {