Skip to content

Commit 7a4c75b

Browse files
authored
Merge branch 'main' into move-errors-to-sdk
2 parents 56ba6a3 + 6a079eb commit 7a4c75b

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

examples/self-diagnostics/otel-collector-config.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ receivers:
88
otlp:
99
protocols:
1010
grpc:
11+
endpoint: 0.0.0.0:4317
1112
http:
13+
endpoint: 0.0.0.0:4318
1214

1315
exporters:
1416
debug:

opentelemetry-sdk/src/metrics/internal/histogram.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct HistogramTracker<T> {
1414
buckets: Mutex<Buckets<T>>,
1515
}
1616

17-
impl<T> Aggregator<T> for HistogramTracker<T>
17+
impl<T> Aggregator for HistogramTracker<T>
1818
where
1919
T: Number,
2020
{
@@ -88,7 +88,7 @@ impl<T: Number> Buckets<T> {
8888
/// Summarizes a set of measurements as a histogram with explicitly defined
8989
/// buckets.
9090
pub(crate) struct Histogram<T: Number> {
91-
value_map: ValueMap<T, HistogramTracker<T>>,
91+
value_map: ValueMap<HistogramTracker<T>>,
9292
bounds: Vec<f64>,
9393
record_min_max: bool,
9494
record_sum: bool,

opentelemetry-sdk/src/metrics/internal/last_value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717
pub(crate) value: T::AtomicTracker,
1818
}
1919

20-
impl<T> Aggregator<T> for Assign<T>
20+
impl<T> Aggregator for Assign<T>
2121
where
2222
T: Number,
2323
{
@@ -37,7 +37,7 @@ where
3737

3838
/// Summarizes a set of measurements as the last one made.
3939
pub(crate) struct LastValue<T: Number> {
40-
value_map: ValueMap<T, Assign<T>>,
40+
value_map: ValueMap<Assign<T>>,
4141
start: Mutex<SystemTime>,
4242
}
4343

opentelemetry-sdk/src/metrics/internal/mod.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ use crate::metrics::AttributeSet;
2222
pub(crate) static STREAM_OVERFLOW_ATTRIBUTES: Lazy<Vec<KeyValue>> =
2323
Lazy::new(|| vec![KeyValue::new("otel.metric.overflow", "true")]);
2424

25-
pub(crate) trait Aggregator<T>
26-
where
27-
T: Number,
28-
{
25+
pub(crate) trait Aggregator {
2926
/// A static configuration that is needed in order to initialize aggregator.
3027
/// E.g. bucket_size at creation time .
3128
type InitConfig;
@@ -46,10 +43,9 @@ where
4643
///
4744
/// This structure is parametrized by an `Operation` that indicates how
4845
/// updates to the underlying value trackers should be performed.
49-
pub(crate) struct ValueMap<T, A>
46+
pub(crate) struct ValueMap<A>
5047
where
51-
T: Number,
52-
A: Aggregator<T>,
48+
A: Aggregator,
5349
{
5450
/// Trackers store the values associated with different attribute sets.
5551
trackers: RwLock<HashMap<Vec<KeyValue>, Arc<A>>>,
@@ -63,10 +59,9 @@ where
6359
config: A::InitConfig,
6460
}
6561

66-
impl<T, A> ValueMap<T, A>
62+
impl<A> ValueMap<A>
6763
where
68-
T: Number,
69-
A: Aggregator<T>,
64+
A: Aggregator,
7065
{
7166
fn new(config: A::InitConfig) -> Self {
7267
ValueMap {

opentelemetry-sdk/src/metrics/internal/precomputed_sum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111

1212
/// Summarizes a set of pre-computed sums as their arithmetic sum.
1313
pub(crate) struct PrecomputedSum<T: Number> {
14-
value_map: ValueMap<T, Assign<T>>,
14+
value_map: ValueMap<Assign<T>>,
1515
monotonic: bool,
1616
start: Mutex<SystemTime>,
1717
reported: Mutex<HashMap<Vec<KeyValue>, T>>,

opentelemetry-sdk/src/metrics/internal/sum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717
value: T::AtomicTracker,
1818
}
1919

20-
impl<T> Aggregator<T> for Increment<T>
20+
impl<T> Aggregator for Increment<T>
2121
where
2222
T: Number,
2323
{
@@ -37,7 +37,7 @@ where
3737

3838
/// Summarizes a set of measurements made as their arithmetic sum.
3939
pub(crate) struct Sum<T: Number> {
40-
value_map: ValueMap<T, Increment<T>>,
40+
value_map: ValueMap<Increment<T>>,
4141
monotonic: bool,
4242
start: Mutex<SystemTime>,
4343
}

0 commit comments

Comments
 (0)