DataDog / serverless-plugin-datadog

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

How can I add my warmer lambda to the exclude list? #515

Closed alanmun closed 3 months ago

alanmun commented 3 months ago

My lambdas have this fully qualified naming scheme:

application-name-function_name

To exclude the above, I did:

I don't see lambdas show up in the datadog serverless output (monitor links etc) when I try the above, so I think it works.

However, for my serverless warmer, I can't figure out the proper name that would exclude it. The documentation isn't helpful and doesn't describe where to get the function names from, so I guessed the above approach for my app's lambdas and that worked. If I named my warmer choco, I noticed it gets deployed with the fully qualified name:

application-name-warmup-plugin-choco

I have tried:

And neither seem to have worked. What do I put as the function name in the datadog exclude list, if I named my warmer function choco within serverless.yml? I took care to make sure that datadog appears AFTER serverless-warmup-plugin in the plugins list in the yml. Thank you.

alanmun commented 3 months ago

Solved:

When serverless deploy completes, it spits out a list of functions like this:

functions:
  functionNameA: my-sls-app-function-name-A
  ...

You should see your warmer listed here, take whatever your warmer has in place of functionNameA, that is the actual name to exclude.

astuyve commented 3 months ago

Hey @alanmun - thanks for following up

Yeah, the framework and the warmup plugin sort of make this hard to tell, but we need the actual function name in the fully generated CF template. You could also run serverless package and open up the cloudformation template to find the generated name.

Glad you got this sorted!