dbader / node-datadog-metrics

Buffered metrics reporting via the DataDog HTTP API
https://dbader.org/blog/monitoring-your-nodejs-app-with-datadog
MIT License
142 stars 58 forks source link

Cap the number of samples in node-datadog-metrics #19

Open dbader opened 8 years ago

dbader commented 8 years ago

https://github.com/dbader/node-datadog-metrics/blob/10d3b29d1fa527807e1301857caac400c54127b6/lib/metrics.js#L133-L136

If ddog is down this will hog a lot of memory.

csabapalfi commented 8 years ago

Have you considered using https://github.com/circonus-labs/circllhist.js ?

dbader commented 7 years ago

Personally, I'd be in favor of a simple solution like dropping new/old samples if the buffer is full. Especially for a first implementation to plug the memory issue.

Under normal operation it should be quite rare we encounter this situation. For my use cases, it would be okay to drop samples.