siimon / prom-client

Prometheus client for node.js
Apache License 2.0
3.14k stars 376 forks source link

Prom-client high memory usage #611

Open shappir opened 9 months ago

shappir commented 9 months ago

I have a service that uses several histograms, some with high cardinality. As a result, the retained memory size just for those histograms is 25-30MB. I'm hoping that this commit, and this PR will significantly improve the situation.

shappir commented 9 months ago

Another cause for the large memory consumption are the long hash key values used: all the label name / value pairs concatenated into a string. Here are possible ways to reduce its size: