Skip to content

Commit

Permalink
fix(misc): Update error message with region and account details (#3761)
Browse files Browse the repository at this point in the history
* fix(misc): Update error message with region and account details

* Add region and account to metrics tag
  • Loading branch information
aravindmd committed Jun 6, 2019
1 parent aebb1b0 commit a812268
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,27 @@ public Void operate(List priorOutputs) {
.getAmazonEC2(description.getCredentials(), description.getRegion())
.deleteSnapshot(new DeleteSnapshotRequest().withSnapshotId(description.getSnapshotId()));
} catch (Exception e) {
registry.counter(deleteSnapshotTaskId.withTag("success", false)).increment();
log.error(String.format("Failed to delete snapshotId %s", description.getSnapshotId()), e);
registry
.counter(
deleteSnapshotTaskId
.withTag("success", false)
.withTag("region", description.getRegion())
.withTag("account", description.getAccount()))
.increment();
log.error(
String.format(
"Failed to delete snapshotId: %s , region: %s , account: %s",
description.getSnapshotId(), description.getRegion(), description.getAccount()),
e);
throw e;
}
registry.counter(deleteSnapshotTaskId.withTag("success", true)).increment();
registry
.counter(
deleteSnapshotTaskId
.withTag("success", true)
.withTag("region", description.getRegion())
.withTag("account", description.getAccount()))
.increment();

getTask()
.updateStatus(
Expand Down

0 comments on commit a812268

Please sign in to comment.