File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414- ` Family::get_or_create_owned ` can access a metric in a labeled family. This
1515 method avoids the risk of runtime deadlocks at the expense of creating an
1616 owned type. See [ PR 244] .
17+
18+ - ` impl<T: Collector> Collector for std::sync::Arc<T> ` .
19+ See [ PR 273] .
1720
1821[ PR 244 ] : https://github.com/prometheus/client_rust/pull/244
1922[ PR 257 ] : https://github.com/prometheus/client_rust/pull/257
23+ [ PR 273 ] : https://github.com/prometheus/client_rust/pull/273
2024
2125### Changed
2226
Original file line number Diff line number Diff line change @@ -39,3 +39,9 @@ pub trait Collector: std::fmt::Debug + Send + Sync + 'static {
3939 /// Once the [`Collector`] is registered, this method is called on each scrape.
4040 fn encode ( & self , encoder : DescriptorEncoder ) -> Result < ( ) , std:: fmt:: Error > ;
4141}
42+
43+ impl < T : Collector > Collector for std:: sync:: Arc < T > {
44+ fn encode ( & self , encoder : DescriptorEncoder ) -> Result < ( ) , std:: fmt:: Error > {
45+ self . as_ref ( ) . encode ( encoder)
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments