bfmatei / apollo-prometheus-exporter

Plugin for Apollo Server to export metrics in Prometheus format
MIT License
55 stars 29 forks source link

Possible perf_hooks memory leak detected #17

Closed leledumbo closed 3 years ago

leledumbo commented 3 years ago

Hello, we just tested your library and we're comparing it against the one in the thanks section by including both in a single app. Dotellie one is copied and modified a little (labelValues -> LabelValues) because it uses prom-client 11.5.3 which is incompatible with 12.0.0 that you're using), upon which we encounter this warning:

(node:17) Warning: Possible perf_hooks memory leak detected. There are 169 entries in the Performance Timeline. Use the clear methods to remove entries that are no longer needed or set performance.maxEntries equal to a higher value (currently the maxEntries is 150).

Is this safe? Should we just follow the message to increase performance.maxEntries? If yes, what's the expected safe value? If not, then what's your suggestion?

leledumbo commented 3 years ago

Seems like the value is increasing indefinitely. The last value before we turn it off is 16376, so I think raising performance.maxEntries isn't the route to go.

bfmatei commented 3 years ago

I think the warning is related to prom-client. Have a look here: https://github.com/siimon/prom-client/issues/429

leledumbo commented 3 years ago

Ah, sorry, forgot to update. I've managed to get rid of this by upgrading to node 10.X, seems like 8.X needs to be said goodbye, there are other things that don't work with it as well.