in auditLogMover/auditLogMoverHelper.ts [127:154]
private static async getMetricDataPromise(
stage: string,
functionName: string,
isSuccessful: boolean,
metricValue: number,
) {
const MetricName = `${functionName}-${isSuccessful ? 'Succeeded' : 'Failed'}`;
const params: any = {
MetricData: [
{
MetricName,
Dimensions: [
{
Name: 'Stage',
Value: stage,
},
],
StorageResolution: 60,
Timestamp: new Date(),
Unit: 'Count',
Value: metricValue,
},
],
Namespace: 'Audit-Log-Mover',
};
const cloudwatch = new AWS.CloudWatch();
return cloudwatch.putMetricData(params).promise();
}