lazywithclass / winston-cloudwatch

Send logs to Amazon Cloudwatch using Winston.
MIT License
258 stars 104 forks source link

Allow skipping ensure loggroup #140

Closed talha5389 closed 3 years ago

talha5389 commented 3 years ago

This could help to have only 1 DescribeLog calls instead of 2 if a user is sure that loggroup is present

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.05%) to 94.286% when pulling 0e4dea5abab806f780fd7efb2429c5dd358c21df on eyeconictv:skip-ensure-loggroup into 3bacfdd7ed88e007f1c097d06c88093954e1dcd8 on lazywithclass:master.

lazywithclass commented 3 years ago

First of all thanks for this, I gave it a look and looks fine.

Are you already using this code somewhere in your infrastructure?

talha5389 commented 3 years ago

Yes. We have hundred of devices that are logging to cloudwatch. Each device with its own stream but they start daily at some time. We were having issues with limits of DescribeLogStream.

One fix was this pull request changes, that reduces number of requests by 50% and then we further randomly distributed calls for winston logger creation within interval of X minutes to distribute this api call requests

lazywithclass commented 3 years ago

I've just published winston-cloudwatch@2.5.0 with these changes, thanks for the contribution and sorry for the delay :]