2024-03-11 14:34:34 +00:00
|
|
|
// Copyright The OpenTelemetry Authors
|
2024-08-26 16:05:54 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2024-03-11 14:34:34 +00:00
|
|
|
|
|
|
|
package exemplar // import "go.opentelemetry.io/otel/sdk/metric/internal/exemplar"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"go.opentelemetry.io/otel/attribute"
|
|
|
|
)
|
|
|
|
|
2024-08-26 16:05:54 +00:00
|
|
|
// Drop returns a [FilteredReservoir] that drops all measurements it is offered.
|
|
|
|
func Drop[N int64 | float64]() FilteredReservoir[N] { return &dropRes[N]{} }
|
2024-03-11 14:34:34 +00:00
|
|
|
|
|
|
|
type dropRes[N int64 | float64] struct{}
|
|
|
|
|
|
|
|
// Offer does nothing, all measurements offered will be dropped.
|
2024-08-26 16:05:54 +00:00
|
|
|
func (r *dropRes[N]) Offer(context.Context, N, []attribute.KeyValue) {}
|
2024-03-11 14:34:34 +00:00
|
|
|
|
|
|
|
// Collect resets dest. No exemplars will ever be returned.
|
2024-08-26 16:05:54 +00:00
|
|
|
func (r *dropRes[N]) Collect(dest *[]Exemplar) {
|
2024-03-11 14:34:34 +00:00
|
|
|
*dest = (*dest)[:0]
|
|
|
|
}
|