1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: GA responseTimeWithAppNames (#3178)

## About the changes
This makes response time with app names enabled for everyone but also
kept a way of turning it off (kill switch) in case it cause some issues
because of misconfigured app names
This commit is contained in:
Gastón Fournier 2023-02-22 10:10:06 +01:00 committed by GitHub
parent 613babda4f
commit 4e3ce8e0af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View File

@ -81,7 +81,7 @@ exports[`should create default config 1`] = `
"notifications": false, "notifications": false,
"projectStatusApi": false, "projectStatusApi": false,
"proxyReturnAllToggles": false, "proxyReturnAllToggles": false,
"responseTimeWithAppName": false, "responseTimeWithAppNameKillSwitch": false,
"showProjectApiAccess": false, "showProjectApiAccess": false,
"strictSchemaValidation": false, "strictSchemaValidation": false,
}, },
@ -102,7 +102,7 @@ exports[`should create default config 1`] = `
"notifications": false, "notifications": false,
"projectStatusApi": false, "projectStatusApi": false,
"proxyReturnAllToggles": false, "proxyReturnAllToggles": false,
"responseTimeWithAppName": false, "responseTimeWithAppNameKillSwitch": false,
"showProjectApiAccess": false, "showProjectApiAccess": false,
"strictSchemaValidation": false, "strictSchemaValidation": false,
}, },

View File

@ -20,7 +20,7 @@ export function responseTimeMetrics(
let appName; let appName;
if ( if (
flagResolver.isEnabled('responseTimeWithAppName') && !flagResolver.isEnabled('responseTimeWithAppNameKillSwitch') &&
(instanceStatsService.getAppCountSnapshot('7d') ?? (instanceStatsService.getAppCountSnapshot('7d') ??
appNameReportingThreshold) < appNameReportingThreshold appNameReportingThreshold) < appNameReportingThreshold
) { ) {

View File

@ -22,8 +22,8 @@ const flags = {
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND, process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND,
true, true,
), ),
responseTimeWithAppName: parseEnvVarBoolean( responseTimeWithAppNameKillSwitch: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_WITH_APP_NAME, process.env.UNLEASH_RESPONSE_TIME_WITH_APP_NAME_KILL_SWITCH,
false, false,
), ),
proxyReturnAllToggles: parseEnvVarBoolean( proxyReturnAllToggles: parseEnvVarBoolean(

View File

@ -37,7 +37,7 @@ process.nextTick(async () => {
embedProxy: true, embedProxy: true,
embedProxyFrontend: true, embedProxyFrontend: true,
anonymiseEventLog: false, anonymiseEventLog: false,
responseTimeWithAppName: true, responseTimeWithAppNameKillSwitch: false,
maintenance: true, maintenance: true,
featuresExportImport: true, featuresExportImport: true,
newProjectOverview: true, newProjectOverview: true,

View File

@ -131,6 +131,7 @@ unleash.start(unleashOptions);
- **frontendApi** - Configuration options for the [Unleash front-end API](../front-end-api.md). - **frontendApi** - Configuration options for the [Unleash front-end API](../front-end-api.md).
- `refreshIntervalInMs` - how often (in milliseconds) front-end clients should refresh their data from the cache. Overridable with the `FRONTEND_API_REFRESH_INTERVAL_MS` environment variable. - `refreshIntervalInMs` - how often (in milliseconds) front-end clients should refresh their data from the cache. Overridable with the `FRONTEND_API_REFRESH_INTERVAL_MS` environment variable.
- **accessControlMaxAge** - You can configure the max-age of the Access-Control-Max-Age header. Defaults to 86400 seconds. Overridable with the `ACCESS_CONTROL_MAX_AGE` environment variable. - **accessControlMaxAge** - You can configure the max-age of the Access-Control-Max-Age header. Defaults to 86400 seconds. Overridable with the `ACCESS_CONTROL_MAX_AGE` environment variable.
- **responseTimeWithAppNameKillSwitch** - use this to disable metrics with app names. This is enabled by default but may increase the cardinality of metrics causing Unleash memory usage to grow if your app name is randomly generated (which is not recommended). Overridable with the `UNLEASH_RESPONSE_TIME_WITH_APP_NAME_KILL_SWITCH` environment variable.
You can also set the environment variable `ENABLED_ENVIRONMENTS` to a comma delimited string of environment names to override environments. You can also set the environment variable `ENABLED_ENVIRONMENTS` to a comma delimited string of environment names to override environments.