mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: impact metrics resolver (#10209)
This commit is contained in:
		
							parent
							
								
									7c31ec71a1
								
							
						
					
					
						commit
						abcc9248e2
					
				| @ -14,7 +14,7 @@ const requestLogger: (config: IUnleashConfig) => RequestHandler = (config) => { | ||||
|         if (enable) { | ||||
|             res.on('finish', () => { | ||||
|                 const { pathname } = url.parse(req.originalUrl); | ||||
|                 if (res.statusCode >= 400 || res.statusCode < 500) { | ||||
|                 if (res.statusCode >= 400 && res.statusCode < 500) { | ||||
|                     impactMetrics?.incrementCounter(CLIENT_ERROR_COUNT); | ||||
|                 } | ||||
|                 if (res.statusCode >= 500) { | ||||
|  | ||||
| @ -6,6 +6,7 @@ import type { | ||||
|     IFlags, | ||||
|     IFlagResolver, | ||||
|     IFlagKey, | ||||
|     IImpactMetricsResolver, | ||||
| } from '../types/experimental.js'; | ||||
| import { getDefaultVariant } from 'unleash-client/lib/variant.js'; | ||||
| 
 | ||||
| @ -65,6 +66,10 @@ export default class FlagResolver implements IFlagResolver { | ||||
|     getStaticContext(): IFlagContext { | ||||
|         return this.externalResolver.getStaticContext(); | ||||
|     } | ||||
| 
 | ||||
|     get impactMetrics(): IImpactMetricsResolver | undefined { | ||||
|         return this.externalResolver?.impactMetrics; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| export const getVariantValue = <T = string>( | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user