diff --git a/helpers/cloudwatch.ts b/helpers/cloudwatch.ts index e8a4943..9bb677a 100644 --- a/helpers/cloudwatch.ts +++ b/helpers/cloudwatch.ts @@ -1,22 +1,26 @@ -import AWS from "aws-sdk"; +// import AWS from "aws-sdk"; import { logger } from "../helpers/logger"; -import { isProduction } from "../config"; +// import { isProduction } from "../config"; export const saveMetric = async ({ label, value }) => { - if (isProduction) { - const cloudwatch = new AWS.CloudWatch({apiVersion: "2010-08-01"}); + // We disabled saving metrics in cloudwatch because of + // rapidly growing costs. We've switched to our self-hosted + // metrics storage in oracle-monitoring instances + logger.info("Metric saving in AWS cloudwatch skipped"); + // if (isProduction) { + // const cloudwatch = new AWS.CloudWatch({apiVersion: "2010-08-01"}); - const metricParams = { - MetricData: [{ - MetricName: label, - Value: value, - }], - Namespace: "CustomPerformanceMetrics", - }; + // const metricParams = { + // MetricData: [{ + // MetricName: label, + // Value: value, + // }], + // Namespace: "CustomPerformanceMetrics", + // }; - await cloudwatch.putMetricData(metricParams).promise(); - } else { - logger.info( - "Metric saving in AWS cloudwatch skipped in non-prod environment"); - } + // await cloudwatch.putMetricData(metricParams).promise(); + // } else { + // logger.info( + // "Metric saving in AWS cloudwatch skipped in non-prod environment"); + // } };