|
1 | 1 | use std::{borrow::Cow, collections::HashSet, sync::Arc};
|
2 | 2 |
|
3 | 3 | use opentelemetry::{
|
4 |
| - metrics::{AsyncInstrument, SyncCounter, SyncGauge, SyncHistogram, SyncUpDownCounter}, |
| 4 | + metrics::{AsyncInstrument, SyncInstrument}, |
5 | 5 | Key, KeyValue,
|
6 | 6 | };
|
7 | 7 |
|
@@ -252,32 +252,8 @@ pub(crate) struct ResolvedMeasures<T> {
|
252 | 252 | pub(crate) measures: Vec<Arc<dyn Measure<T>>>,
|
253 | 253 | }
|
254 | 254 |
|
255 |
| -impl<T: Copy + 'static> SyncCounter<T> for ResolvedMeasures<T> { |
256 |
| - fn add(&self, val: T, attrs: &[KeyValue]) { |
257 |
| - for measure in &self.measures { |
258 |
| - measure.call(val, attrs) |
259 |
| - } |
260 |
| - } |
261 |
| -} |
262 |
| - |
263 |
| -impl<T: Copy + 'static> SyncUpDownCounter<T> for ResolvedMeasures<T> { |
264 |
| - fn add(&self, val: T, attrs: &[KeyValue]) { |
265 |
| - for measure in &self.measures { |
266 |
| - measure.call(val, attrs) |
267 |
| - } |
268 |
| - } |
269 |
| -} |
270 |
| - |
271 |
| -impl<T: Copy + 'static> SyncGauge<T> for ResolvedMeasures<T> { |
272 |
| - fn record(&self, val: T, attrs: &[KeyValue]) { |
273 |
| - for measure in &self.measures { |
274 |
| - measure.call(val, attrs) |
275 |
| - } |
276 |
| - } |
277 |
| -} |
278 |
| - |
279 |
| -impl<T: Copy + 'static> SyncHistogram<T> for ResolvedMeasures<T> { |
280 |
| - fn record(&self, val: T, attrs: &[KeyValue]) { |
| 255 | +impl<T: Copy + 'static> SyncInstrument<T> for ResolvedMeasures<T> { |
| 256 | + fn measure(&self, val: T, attrs: &[KeyValue]) { |
281 | 257 | for measure in &self.measures {
|
282 | 258 | measure.call(val, attrs)
|
283 | 259 | }
|
|
0 commit comments