mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: project actions count metric (#7929)
This commit is contained in:
		
							parent
							
								
									e714a7fe2b
								
							
						
					
					
						commit
						4e11e57f7f
					
				| @ -66,7 +66,7 @@ export const DeleteProjectDialogue = ({ | |||||||
|                 <ul> |                 <ul> | ||||||
|                     <li>project with all of its settings</li> |                     <li>project with all of its settings</li> | ||||||
|                     <li>all feature flags archived in it</li> |                     <li>all feature flags archived in it</li> | ||||||
|                     <li>all API keys scoped to only to this project</li> |                     <li>all API keys scoped only to this project</li> | ||||||
|                     <ConditionallyRender |                     <ConditionallyRender | ||||||
|                         condition={isEnterprise() && automatedActionsEnabled} |                         condition={isEnterprise() && automatedActionsEnabled} | ||||||
|                         show={<li>all actions configured for it</li>} |                         show={<li>all actions configured for it</li>} | ||||||
|  | |||||||
| @ -19,6 +19,10 @@ import { | |||||||
|     CLIENT_METRICS, |     CLIENT_METRICS, | ||||||
|     CLIENT_REGISTER, |     CLIENT_REGISTER, | ||||||
|     PROJECT_ENVIRONMENT_REMOVED, |     PROJECT_ENVIRONMENT_REMOVED, | ||||||
|  |     PROJECT_CREATED, | ||||||
|  |     PROJECT_ARCHIVED, | ||||||
|  |     PROJECT_REVIVED, | ||||||
|  |     PROJECT_DELETED, | ||||||
| } from './types/events'; | } from './types/events'; | ||||||
| import type { IUnleashConfig } from './types/option'; | import type { IUnleashConfig } from './types/option'; | ||||||
| import type { ISettingStore, IUnleashStores } from './types/stores'; | import type { ISettingStore, IUnleashStores } from './types/stores'; | ||||||
| @ -315,6 +319,12 @@ export default class MetricsMonitor { | |||||||
|             labelNames: ['stage'], |             labelNames: ['stage'], | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|  |         const projectActionsCounter = createCounter({ | ||||||
|  |             name: 'project_actions_count', | ||||||
|  |             help: 'Count project actions', | ||||||
|  |             labelNames: ['action'], | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|         const projectEnvironmentsDisabled = createCounter({ |         const projectEnvironmentsDisabled = createCounter({ | ||||||
|             name: 'project_environments_disabled', |             name: 'project_environments_disabled', | ||||||
|             help: 'How many "environment disabled" events we have received for each project', |             help: 'How many "environment disabled" events we have received for each project', | ||||||
| @ -851,6 +861,18 @@ export default class MetricsMonitor { | |||||||
|                 environmentType: 'n/a', |                 environmentType: 'n/a', | ||||||
|             }); |             }); | ||||||
|         }); |         }); | ||||||
|  |         eventStore.on(PROJECT_CREATED, () => { | ||||||
|  |             projectActionsCounter.labels({ action: PROJECT_CREATED }).inc(); | ||||||
|  |         }); | ||||||
|  |         eventStore.on(PROJECT_ARCHIVED, () => { | ||||||
|  |             projectActionsCounter.labels({ action: PROJECT_ARCHIVED }).inc(); | ||||||
|  |         }); | ||||||
|  |         eventStore.on(PROJECT_REVIVED, () => { | ||||||
|  |             projectActionsCounter.labels({ action: PROJECT_REVIVED }).inc(); | ||||||
|  |         }); | ||||||
|  |         eventStore.on(PROJECT_DELETED, () => { | ||||||
|  |             projectActionsCounter.labels({ action: PROJECT_DELETED }).inc(); | ||||||
|  |         }); | ||||||
| 
 | 
 | ||||||
|         const logger = config.getLogger('metrics.ts'); |         const logger = config.getLogger('metrics.ts'); | ||||||
|         eventBus.on(CLIENT_METRICS, (metrics: IClientMetricsEnv[]) => { |         eventBus.on(CLIENT_METRICS, (metrics: IClientMetricsEnv[]) => { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user