Mirror of https://github.com/roostorg/osprey github.com/roostorg/osprey
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use _is_spammy_exception for action_health metric filtering (#193)

authored by

Leon Shi and committed by
GitHub
5261d84b bd2fe922

+11 -6
+11 -6
osprey_worker/src/osprey/engine/executor/executor.py
··· 408 408 409 409 effects = context.get_effects() 410 410 411 - total_errors = len(error_infos) 412 - unexpected_errors = len(unexpected_error_infos) 411 + actionable_error_infos = [ 412 + error_info 413 + for error_info in error_infos 414 + if isinstance(error_info.error, Exception) and not _is_spammy_exception(error_info.error) 415 + ] 413 416 has_effects = len(effects) > 0 417 + has_actionable_errors = len(actionable_error_infos) > 0 414 418 action_tags = [ 415 419 f'action:{action.action_name}', 416 - f'had_errors:{total_errors > 0}', 417 - f'had_unexpected_errors:{unexpected_errors > 0}', 420 + f'had_actionable_errors:{has_actionable_errors}', 418 421 f'had_effects:{has_effects}', 419 422 ] 420 423 metrics.increment('osprey.action_health', tags=action_tags) 421 - if total_errors > 0: 422 - metrics.histogram('osprey.action_error_count', total_errors, tags=[f'action:{action.action_name}']) 424 + if has_actionable_errors: 425 + metrics.histogram( 426 + 'osprey.action_error_count', len(actionable_error_infos), tags=[f'action:{action.action_name}'] 427 + ) 423 428 424 429 result = ExecutionResult( 425 430 extracted_features=context.get_extracted_features(),