diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index d5f1617b9b68..0b34e2d36e70 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -146,7 +146,6 @@ exports[`should create default config 1`] = ` "removeUnsafeInlineStyleSrc": false, "resourceLimits": false, "responseTimeMetricsFix": false, - "responseTimeWithAppNameKillSwitch": false, "showInactiveUsers": false, "signals": false, "strictSchemaValidation": false, diff --git a/src/lib/middleware/response-time-metrics.ts b/src/lib/middleware/response-time-metrics.ts index 92d5e4661480..d83e3d926445 100644 --- a/src/lib/middleware/response-time-metrics.ts +++ b/src/lib/middleware/response-time-metrics.ts @@ -6,7 +6,6 @@ import type { InstanceStatsService } from '../services'; import type { RequestHandler } from 'express'; const _responseTime = responseTime.default; -const appNameReportingThreshold = 1000; export const storeRequestedRoute: RequestHandler = (req, res, next) => { if (req.route) { @@ -55,13 +54,6 @@ export function responseTimeMetrics( // when pathname is undefined use a fallback pathname = pathname ?? collapse(req.path); let appName: string | undefined; - if ( - !flagResolver.isEnabled('responseTimeWithAppNameKillSwitch') && - (instanceStatsService.getAppCountSnapshot('7d') ?? - appNameReportingThreshold) < appNameReportingThreshold - ) { - appName = req.headers['unleash-appname'] ?? req.query.appName; - } const timingInfo = { path: pathname, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index e6df34fecd5a..ac75f60da073 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -10,7 +10,6 @@ export type IFlagKey = | 'enableLicenseChecker' | 'embedProxy' | 'embedProxyFrontend' - | 'responseTimeWithAppNameKillSwitch' | 'maintenanceMode' | 'messageBanner' | 'featuresExportImport' @@ -83,10 +82,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND, true, ), - responseTimeWithAppNameKillSwitch: parseEnvVarBoolean( - process.env.UNLEASH_RESPONSE_TIME_WITH_APP_NAME_KILL_SWITCH, - false, - ), maintenanceMode: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_MAINTENANCE_MODE, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index 33037fd15747..e38e397bada7 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -39,7 +39,6 @@ process.nextTick(async () => { embedProxy: true, embedProxyFrontend: true, anonymiseEventLog: false, - responseTimeWithAppNameKillSwitch: false, stripHeadersOnAPI: true, celebrateUnleash: true, featureSearchFeedbackPosting: true,