DataDog / serverless-plugin-datadog

Serverless plugin to automagically instrument your Lambda functions with Datadog
Apache License 2.0
88 stars 50 forks source link

Variables are not Replaced in Recommended Monitor Title #495

Open ceagan opened 2 weeks ago

ceagan commented 2 weeks ago

Expected Behavior

When specifying a simple DataDog configuration like the following, the high_error_rate monitor should be created with a name that includes the information specific to the deployment and should not include unresolved variable references.

custom:
  datadog:
    monitors:
      - high_error_rate:

Actual Behavior

The high_error_rate monitor is created with a name of High Error Rate on $functionName in $regionName for $awsAccount with the variables left in variable notation.

Steps to Reproduce the Problem

  1. Create a serverless.yml config as shown above and a DataDog account with no monitors (so that a create is performed rather than an update).
  2. Run serverless deploy

Specifications

TalUsvyatsky commented 1 week ago

Hey @ceagan, thanks for creating this issue. This default monitor alerts on any functionname, region, and aws_account in a given stack. The monitor title is expected to have unresolved variable names until alert time, at which point the variables will be populated in the alert notification based on the specific functionname, region, aws_account combo that is experiencing high errors. That said, I think the variables are currently in the wrong format ($functionName vs. {{ functionname.name }}), so I've gone ahead and filed a ticket on our side.