librato-rack icon indicating copy to clipboard operation
librato-rack copied to clipboard

Flushing at exit

Open jonleighton opened this issue 8 years ago • 1 comments

I'm switching from using statsd to using this gem, and I was surprised to not be able to find any code which is ensuring a final flush is performed before the process exits. Is there a reason for this? It obviously means that when a server is restarted then there will be up to flush_interval of data loss.

I was able to achieve the final flush via:

at_exit { Librato.tracker.flush }

Perhaps this isn't included by default for some reason I haven't thought of. Is there any reason not to do this?

Thanks

jonleighton avatar Sep 21 '16 15:09 jonleighton

@jonleighton - apologies for the delayed response. This is a great point. Originally I think we had some reservations about some possible negative aspects of an at_exit force flush but at this point I think adding it would make a lot of sense.

we'll do a little digging and look into adding this.

nextmat avatar Oct 04 '16 00:10 nextmat