awslabs/aws-embedded-metrics-python

Ability to automatically flush log before impending Lambda timeout

benkehoe opened this issue · 3 comments

One of the frustrating things about running into a Lambda timeout when using structured logs is that nothing is logged. Ideally, when using metric_scope, it should be able to flush the log before the timeout expires using context.get_remaining_time_in_millis(), perhaps setting a property indicating this was the case (since there's a possibility the function actually does complete after the flush occurs and some logging was lost)

@jaredcnance are there any updates on this ? Or any suggested workarounds ?

@prasanthnarasimha I think this repo is unmaintained. It's been on my mind to fork it and implement some of these improvements

@benkehoe We have added this request to our queue and will look into it as soon as we can. Feel free to open a PR if you would like this change sooner and we can review it and publish for you.