Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda: Aliases generate incorrect metric configurations #3724

Closed
RomainMuller opened this issue Aug 20, 2019 · 2 comments · Fixed by #3728
Closed

lambda: Aliases generate incorrect metric configurations #3724

RomainMuller opened this issue Aug 20, 2019 · 2 comments · Fixed by #3728
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. needs-reproduction This issue needs reproduction.

Comments

@RomainMuller
Copy link
Contributor

🐛 Bug Report

What is the problem?

When using the metric* methods on an @aws-cdk/aws-lambda.Alias instance, the generated metric configuration object uses the Alias' ARN as the FunctionName dimension, which is incorrect.

@RomainMuller RomainMuller added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. @aws-cdk/aws-lambda Related to AWS Lambda and removed needs-triage This issue or PR still needs to be triaged. labels Aug 20, 2019
@RomainMuller
Copy link
Contributor Author

This might have been on an older version of CDK though (pending repro on >= 1.0.0 at this stage).

@RomainMuller RomainMuller self-assigned this Aug 20, 2019
@RomainMuller RomainMuller added the needs-reproduction This issue needs reproduction. label Aug 20, 2019
@RomainMuller
Copy link
Contributor Author

Yeah so in fact the issue is that the generated ResourceName has the Alias' ARN instead of having the alias' name (FunctionName:label).

RomainMuller added a commit that referenced this issue Aug 20, 2019
Lambda supports metrics on individual aliases by specifying the metric
dimensions with `FunctionName` set to the underlying function's `Name`,
and `ResourceName` set to the qualified function `Name` (i.e:
`FunctionName:aliasName`).

The previous iteration of this code used the function's ARN instead of
it's name, resulting in incorrect metrics.

Fixes #3724
RomainMuller added a commit that referenced this issue Aug 26, 2019
Lambda supports metrics on individual aliases by specifying the metric
dimensions with `FunctionName` set to the underlying function's `Name`,
and `ResourceName` set to the qualified function `Name` (i.e:
`FunctionName:aliasName`).

The previous iteration of this code used the function's ARN instead of
it's name, resulting in incorrect metrics.

Fixes #3724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. needs-reproduction This issue needs reproduction.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant