We have a use case to have semi-dynamic names for some metrics, and it'd be great if KeyName could impl From<std::borrow::Cow> so that we construct the key name once (at runtime) and then cheaply emit metrics using that without reallocating every time. Unless I'm missing something that should be easy enough since SharedString (the crate's Cow) already has impl From<std::borrow::Cow<'static, str>>. Will be happy to craft a PR for this unless I hear objections. Thanks!
We have a use case to have semi-dynamic names for some metrics, and it'd be great if
KeyName
couldimpl From<std::borrow::Cow>
so that we construct the key name once (at runtime) and then cheaply emit metrics using that without reallocating every time. Unless I'm missing something that should be easy enough sinceSharedString
(the crate'sCow
) already hasimpl From<std::borrow::Cow<'static, str>>
. Will be happy to craft a PR for this unless I hear objections. Thanks!