@@ -27,7 +27,7 @@ import (
27
27
"go.opentelemetry.io/otel/api/label"
28
28
"go.opentelemetry.io/otel/api/metric"
29
29
export "go.opentelemetry.io/otel/sdk/export/metric"
30
- "go.opentelemetry.io/otel/sdk/export/metric/aggregator "
30
+ "go.opentelemetry.io/otel/sdk/export/metric/aggregation "
31
31
"go.opentelemetry.io/otel/sdk/metric/controller/pull"
32
32
"go.opentelemetry.io/otel/sdk/metric/selector/simple"
33
33
)
@@ -216,11 +216,11 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
216
216
217
217
desc := c .toDesc (record , labelKeys )
218
218
219
- if hist , ok := agg .(aggregator .Histogram ); ok {
219
+ if hist , ok := agg .(aggregation .Histogram ); ok {
220
220
if err := c .exportHistogram (ch , hist , numberKind , desc , labels ); err != nil {
221
221
return fmt .Errorf ("exporting histogram: %w" , err )
222
222
}
223
- } else if dist , ok := agg .(aggregator .Distribution ); ok {
223
+ } else if dist , ok := agg .(aggregation .Distribution ); ok {
224
224
// TODO: summaries values are never being resetted.
225
225
// As measurements are recorded, new records starts to have less impact on these summaries.
226
226
// We should implement an solution that is similar to the Prometheus Clients
@@ -232,11 +232,11 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
232
232
if err := c .exportSummary (ch , dist , numberKind , desc , labels ); err != nil {
233
233
return fmt .Errorf ("exporting summary: %w" , err )
234
234
}
235
- } else if sum , ok := agg .(aggregator .Sum ); ok {
235
+ } else if sum , ok := agg .(aggregation .Sum ); ok {
236
236
if err := c .exportCounter (ch , sum , numberKind , desc , labels ); err != nil {
237
237
return fmt .Errorf ("exporting counter: %w" , err )
238
238
}
239
- } else if lastValue , ok := agg .(aggregator .LastValue ); ok {
239
+ } else if lastValue , ok := agg .(aggregation .LastValue ); ok {
240
240
if err := c .exportLastValue (ch , lastValue , numberKind , desc , labels ); err != nil {
241
241
return fmt .Errorf ("exporting last value: %w" , err )
242
242
}
@@ -248,7 +248,7 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
248
248
}
249
249
}
250
250
251
- func (c * collector ) exportLastValue (ch chan <- prometheus.Metric , lvagg aggregator .LastValue , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
251
+ func (c * collector ) exportLastValue (ch chan <- prometheus.Metric , lvagg aggregation .LastValue , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
252
252
lv , _ , err := lvagg .LastValue ()
253
253
if err != nil {
254
254
return fmt .Errorf ("error retrieving last value: %w" , err )
@@ -263,7 +263,7 @@ func (c *collector) exportLastValue(ch chan<- prometheus.Metric, lvagg aggregato
263
263
return nil
264
264
}
265
265
266
- func (c * collector ) exportCounter (ch chan <- prometheus.Metric , sum aggregator .Sum , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
266
+ func (c * collector ) exportCounter (ch chan <- prometheus.Metric , sum aggregation .Sum , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
267
267
v , err := sum .Sum ()
268
268
if err != nil {
269
269
return fmt .Errorf ("error retrieving counter: %w" , err )
@@ -278,7 +278,7 @@ func (c *collector) exportCounter(ch chan<- prometheus.Metric, sum aggregator.Su
278
278
return nil
279
279
}
280
280
281
- func (c * collector ) exportSummary (ch chan <- prometheus.Metric , dist aggregator .Distribution , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
281
+ func (c * collector ) exportSummary (ch chan <- prometheus.Metric , dist aggregation .Distribution , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
282
282
count , err := dist .Count ()
283
283
if err != nil {
284
284
return fmt .Errorf ("error retrieving count: %w" , err )
@@ -305,7 +305,7 @@ func (c *collector) exportSummary(ch chan<- prometheus.Metric, dist aggregator.D
305
305
return nil
306
306
}
307
307
308
- func (c * collector ) exportHistogram (ch chan <- prometheus.Metric , hist aggregator .Histogram , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
308
+ func (c * collector ) exportHistogram (ch chan <- prometheus.Metric , hist aggregation .Histogram , kind metric.NumberKind , desc * prometheus.Desc , labels []string ) error {
309
309
buckets , err := hist .Histogram ()
310
310
if err != nil {
311
311
return fmt .Errorf ("error retrieving histogram: %w" , err )
0 commit comments