1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-26 21:05:00 +02:00
opentelemetry-go/sdk
David Ashpole 6b251b804c
Allow configuring the exemplar filter on the metrics SDK (#5850)
Part of https://github.com/open-telemetry/opentelemetry-go/issues/5249

### Spec

https://opentelemetry.io/docs/specs/otel/metrics/sdk/#exemplarfilter

> The ExemplarFilter configuration MUST allow users to select between
one of the built-in ExemplarFilters. While ExemplarFilter determines
which measurements are eligible for becoming an Exemplar, the
ExemplarReservoir makes the final decision if a measurement becomes an
exemplar and is stored.

> The ExemplarFilter SHOULD be a configuration parameter of a
MeterProvider for an SDK. The default value SHOULD be TraceBased. The
filter configuration SHOULD follow the [environment variable
specification](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exemplar).

> An OpenTelemetry SDK MUST support the following filters:

> *
[AlwaysOn](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#alwayson)
> *
[AlwaysOff](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#alwaysoff)
> *
[TraceBased](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#tracebased)

### Changes

* adds exemplar.AlwaysOffFilter, which is one of the required filters
from the SDK:
https://opentelemetry.io/docs/specs/otel/metrics/sdk/#alwaysoff
* adds `metric.WithExemplarFilter` as an option for the metrics SDK.
* moves handling of `OTEL_METRICS_EXEMPLAR_FILTER` to the same location
as config handling to make code easier to navigate.



dropReservoir can actually be removed, but I plan to do that in a
follow-up refactor, since it will be a large diff.

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-10-11 16:02:20 -04:00
..
instrumentation Allow relying on InstrumentationScope in SpanStub and fix remaining deprecation issues (#5627) 2024-07-24 09:33:07 +02:00
internal [chore]: enable suite-extra-assert-call rule from testifylint (#5833) 2024-09-23 08:56:45 +02:00
log Release v1.31.0/v0.53.0/v0.7.0/v0.0.10 (#5883) 2024-10-11 12:59:27 -04:00
metric Allow configuring the exemplar filter on the metrics SDK (#5850) 2024-10-11 16:02:20 -04:00
resource [chore]: enable expected-actual rule from testifylint (#5848) 2024-09-26 12:04:33 +02:00
trace Performance improvements for the trace SDK in Span. (#5874) 2024-10-09 09:51:17 +02:00
go.mod Release v1.31.0/v0.53.0/v0.7.0/v0.0.10 (#5883) 2024-10-11 12:59:27 -04:00
go.sum fix(deps): update golang.org/x (#5872) 2024-10-07 09:13:11 +02:00
README.md Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
version_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
version.go Release v1.31.0/v0.53.0/v0.7.0/v0.0.10 (#5883) 2024-10-11 12:59:27 -04:00

SDK

PkgGoDev