1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
5 #ifndef ENABLE_METRICS_PREVIEW
6 # include "opentelemetry/sdk/metrics/exemplar/filter.h"
8 OPENTELEMETRY_BEGIN_NAMESPACE
14 class AlwaysSampleFilter final
: public ExemplarFilter
17 static nostd::shared_ptr
<ExemplarFilter
> GetAlwaysSampleFilter()
19 static nostd::shared_ptr
<ExemplarFilter
> alwaysSampleFilter
{new AlwaysSampleFilter
{}};
20 return alwaysSampleFilter
;
23 bool ShouldSampleMeasurement(long value
,
24 const MetricAttributes
&attributes
,
25 const opentelemetry::context::Context
&context
) noexcept override
30 bool ShouldSampleMeasurement(double value
,
31 const MetricAttributes
&attributes
,
32 const opentelemetry::context::Context
&context
) noexcept override
38 explicit AlwaysSampleFilter() = default;
40 } // namespace metrics
42 OPENTELEMETRY_END_NAMESPACE