deadtrickster / prometheus.erl

Prometheus.io client in Erlang
MIT License
341 stars 117 forks source link

add limit to too many kind of metrics label #161

Closed enjolras1205 closed 9 months ago

enjolras1205 commented 10 months ago

A common mistake is having too many possibilities in label, such as including random strings within the label. This can lead to unnecessary CPU and memory consumption.

I would like to propose a feature that allows setting the maximum size for label types by registry and name. If a label needs to be inserted and exceeds a configured value, the insertion will not be performed. Instead, an event will be emitted through telemetry.

If it work, i will make a pr.