mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: some integrations only counted errors not all results (#8295)
This commit is contained in:
		
							parent
							
								
									81840ed574
								
							
						
					
					
						commit
						530af3d7d6
					
				| @ -113,16 +113,16 @@ export default class DatadogAddon extends Addon { | ||||
|             state = 'failed'; | ||||
|             const failedMessage = `Datadog Events API request failed with status code: ${res.status}.`; | ||||
|             stateDetails.push(failedMessage); | ||||
|             if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|                 this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                     result: state, | ||||
|                     destination: 'datadog', | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             this.logger.warn(failedMessage); | ||||
|         } | ||||
| 
 | ||||
|         if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|             this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                 result: state, | ||||
|                 destination: 'datadog', | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         this.registerEvent({ | ||||
|             integrationId, | ||||
|             state, | ||||
|  | ||||
| @ -179,6 +179,9 @@ export default class SlackAppAddon extends Addon { | ||||
|             stateDetails.push(eventErrorMessage); | ||||
|             this.logger.warn(eventErrorMessage); | ||||
|             const errorMessage = this.parseError(error); | ||||
|             stateDetails.push(errorMessage); | ||||
|             this.logger.warn(errorMessage, error); | ||||
|         } finally { | ||||
|             if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|                 this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                     result: state, | ||||
| @ -186,9 +189,6 @@ export default class SlackAppAddon extends Addon { | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             stateDetails.push(errorMessage); | ||||
|             this.logger.warn(errorMessage, error); | ||||
|         } finally { | ||||
|             this.registerEvent({ | ||||
|                 integrationId, | ||||
|                 state, | ||||
|  | ||||
| @ -131,16 +131,16 @@ export default class SlackAddon extends Addon { | ||||
|             state = 'successWithErrors'; | ||||
|             const successWithErrorsMessage = `Some (${failedRequests.length} of ${results.length}) Slack webhook requests failed. Status codes: ${codes}.`; | ||||
|             stateDetails.push(successWithErrorsMessage); | ||||
|             if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|                 this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                     result: state, | ||||
|                     destination: 'slack', | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             this.logger.warn(successWithErrorsMessage); | ||||
|         } | ||||
| 
 | ||||
|         if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|             this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                 result: state, | ||||
|                 destination: 'slack', | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         this.registerEvent({ | ||||
|             integrationId, | ||||
|             state, | ||||
|  | ||||
| @ -107,16 +107,16 @@ export default class TeamsAddon extends Addon { | ||||
|             state = 'failed'; | ||||
|             const failedMessage = `Teams webhook request failed with status code: ${res.status}.`; | ||||
|             stateDetails.push(failedMessage); | ||||
|             if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|                 this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                     result: state, | ||||
|                     destination: 'teams', | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             this.logger.warn(failedMessage); | ||||
|         } | ||||
| 
 | ||||
|         if (this.flagResolver.isEnabled('addonUsageMetrics')) { | ||||
|             this.eventBus.emit(ADDON_EVENTS_HANDLED, { | ||||
|                 result: state, | ||||
|                 destination: 'teams', | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         this.registerEvent({ | ||||
|             integrationId, | ||||
|             state, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user