rust-prometheus
rust-prometheus copied to clipboard
Consider replacing most owned data with a `Cow<'static, _>` where it is plausible to carry static data
Currently a large number of APIs deal directly with owned strings, however in my experience most APIs deal with data that is most likely static: labels & sometimes their values, histogram buckets, namespaces, registry prefixes, etc.
Prometheus could internally use Cow<'static, str>
instead of String
and Cow<'static, [_]>
instead of Vec<_>
lowering the memory overhead of prometheus metrics and registries.