awslabs / aws-embedded-metrics-node

Amazon CloudWatch Embedded Metric Format Client Library
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format.html
Apache License 2.0
252 stars 35 forks source link

Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed #129

Closed davidweimapbox closed 2 years ago

davidweimapbox commented 2 years ago

This issue might be still related to https://github.com/awslabs/aws-embedded-metrics-node/issues/120. @markkuhn

After we bumped up to the latest v2.0.6, still see the same error in Cloudwatch.

image

The issue is only in our stacks with node v16, no issue for stacks in node v14.

markkuhn commented 2 years ago

Can you give me a bit more information so that I can reproduce this locally?

davidweimapbox commented 2 years ago

Actually, when I run our stack locally, I can see the metrics created, no any errors in console log. However, after we deploy the stack to AWS, the errors keep showing in the Cloudwatch logs. We are in node v16.16. Not sure how to reproduce it locally, maybe in docker?

markkuhn commented 2 years ago

Are you running it in EC2, ECS, EKS or Lambda?

davidweimapbox commented 2 years ago

We are using ECS, thanks!

davidweimapbox commented 2 years ago

We are using this module via a wrapper component, I am going to double check if the issue is on our side first. Will close this ticket to avoid wasting your time. Thanks for the great help and quick response on the bug fixing! @markkuhn