File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
kork-core/src/main/java/com/netflix/spinnaker/kork/aws Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,18 @@ public class AwsMetricsSupport {
26
26
static String [] buildExceptionTags (AmazonWebServiceRequest originalRequest , Exception exception ) {
27
27
final AmazonServiceException ase = amazonServiceException (exception );
28
28
29
+ String targetAccountId = DEFAULT_UNKNOWN ;
30
+ if (ase .getHttpHeaders () != null ) {
31
+ targetAccountId = ase .getHttpHeaders ().get ("targetAccountId" );
32
+ }
33
+
29
34
return new String [] {
30
35
"requestType" , originalRequest .getClass ().getSimpleName (),
31
36
"statusCode" , Integer .toString (ase .getStatusCode ()),
32
37
"errorCode" , Optional .ofNullable (ase .getErrorCode ()).orElse (DEFAULT_UNKNOWN ),
33
38
"serviceName" , Optional .ofNullable (ase .getServiceName ()).orElse (DEFAULT_UNKNOWN ),
34
- "errorType" , Optional .ofNullable (ase .getErrorType ()).orElse (AmazonServiceException .ErrorType .Unknown ).name ()
39
+ "errorType" , Optional .ofNullable (ase .getErrorType ()).orElse (AmazonServiceException .ErrorType .Unknown ).name (),
40
+ "accountId" , Optional .ofNullable (targetAccountId ).orElse (DEFAULT_UNKNOWN )
35
41
};
36
42
}
37
43
You can’t perform that action at this time.
0 commit comments