diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index c809fb0b..844b6624 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -126,6 +126,7 @@ jobs: AWS_ACCESS_KEY_ID=${{ secrets.SERVER_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.SERVER_AWS_SECRET_ACCESS_KEY }} VERSION=${{github.sha}} + NODE_ENV=staging - name: Deploy Amazon ECS task definition uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a with: @@ -172,6 +173,7 @@ jobs: VERSION=${{github.sha}} AWS_ACCESS_KEY_ID=${{ secrets.SERVER_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.SERVER_AWS_SECRET_ACCESS_KEY }} + NODE_ENV=production - name: Deploy Amazon ECS task definition uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a with: diff --git a/server/metrics.js b/server/metrics.js index b8857f27..8ce375ed 100644 --- a/server/metrics.js +++ b/server/metrics.js @@ -1,6 +1,7 @@ const { CloudWatchClient, PutMetricDataCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import const client = new CloudWatchClient(); +const env = process.env.NODE_ENV // [ // { @@ -16,7 +17,7 @@ const report = async ({ metricName, unit = "None", value = 1.0, dims = [] }) => MetricData: [ { MetricName: metricName, - Dimensions: dims, + Dimensions: [...dims, { Name: "environment", Value: env }], Unit: unit, Value: value, },