Skip to content

Commit

Permalink
Merge pull request #211 from Clever/infra-3435
Browse files Browse the repository at this point in the history
add metric for failed workflows with dimension for failing job
  • Loading branch information
ghirsch1 authored Sep 3, 2019
2 parents 557c63d + 8cb85b0 commit 2f0927e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions executor/workflow_manager_sfn.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,21 @@ func (wm *SFNWorkflowManager) UpdateWorkflowSummary(ctx context.Context, workflo
if err := wm.updateWorkflowLastJob(ctx, workflow); err != nil {
return err
}
failedJob := ""
failedJobResource := ""
if workflow.LastJob != nil {
failedJob = workflow.LastJob.State
if workflow.LastJob.StateResource != nil {
failedJobResource = workflow.LastJob.StateResource.Name
}
}
log.CounterD("workflow-failed", 1, logger.M{
"workflow-name": workflow.WorkflowDefinition.Name,
"workflow-version": workflow.WorkflowDefinition.Version,
"workflow-id": workflow.ID,
"failed-job-name": failedJob,
"failed-job-resource": failedJobResource,
})
}

workflow.Output = aws.StringValue(describeOutput.Output) // use for error or success (TODO: actually this is only sent for success)
Expand Down
9 changes: 9 additions & 0 deletions kvconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ routes:
dimensions: ["id"]
stat_type: "counter"

workflow-job-failed-metric:
matchers:
title: ["workflow-failed"]
output:
type: "alerts"
series: "workflow-manager.job-failed"
dimensions: ["workflow-name", "failed-job-name", "failed-job-resource", "workflow-version"]
stat_type: "counter"

execution-not-found-alert:
matchers:
title: ["execution-not-found"]
Expand Down

0 comments on commit 2f0927e

Please sign in to comment.