Skip to content

Commit

Permalink
Use existing environment variables for cloudwatch
Browse files Browse the repository at this point in the history
We already have DD_SERVICE and DD_ENV that we use for datadog,
these might as well also be used for the request queue time metric.
  • Loading branch information
bjonord committed Aug 29, 2024
1 parent 15e36e7 commit 208d653
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ And then execute:
The following environment variables are required for the metric that is reported to cloudwatch:

```rb
ENV["APP_NAME"]
ENV["SERVER_ENVIRONMENT"]
ENV["DD_SERVICE"]
ENV["DD_ENV"]
```

For example:
```rb
ENV["DD_SERVICE"] = "teamtailor"
ENV["DD_ENV"] = "eu-cyan"
```

For the Reporter to run, you need to have the following flag set as well:
Expand Down
4 changes: 2 additions & 2 deletions lib/services/auto_scaling_metrics/reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Reporter
include Singleton

DIMENSIONS = [
{name: "service", value: ENV["APP_NAME"]},
{name: "environment", value: ENV["SERVER_ENVIRONMENT"]}
{name: "service", value: ENV["DD_SERVICE"]},
{name: "environment", value: ENV["DD_ENV"]}
]

attr_accessor :collector
Expand Down

0 comments on commit 208d653

Please sign in to comment.