Skip to content

Commit 792aa84

Browse files
committed
Fixes #3812 - ExemplarFilter does not need to be exposed as an interface.
1 parent 2580724 commit 792aa84

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

specification/metrics/sdk.md

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ series and the topic requires further analysis.
879879

880880
## Exemplar
881881

882-
**Status**: [Feature-freeze](../document-status.md)
882+
**Status**: [Experimental, Feature-freeze](../document-status.md)
883883

884884
Exemplars are example data points for aggregated data. They provide specific
885885
context to otherwise general aggregations. Exemplars allow correlation between
@@ -934,52 +934,42 @@ A Metric SDK MUST allow exemplar sampling to leverage the configuration of
934934
metric aggregation. For example, Exemplar sampling of histograms should be able
935935
to leverage bucket boundaries.
936936

937-
A Metric SDK SHOULD provide extensible hooks for Exemplar sampling, specifically:
937+
A Metric SDK SHOULD provide configuration for Exemplar sampling, specifically:
938938

939939
- `ExemplarFilter`: filter which measurements can become exemplars.
940940
- `ExemplarReservoir`: storage and sampling of exemplars.
941941

942942
### ExemplarFilter
943943

944-
The `ExemplarFilter` interface MUST provide a method to determine if a
945-
measurement should be sampled. Sampled here simply makes the measurement
946-
eligible for being included as an exemplar. `ExemplarReservoir` makes the final
947-
decision if a measurement becomes an exemplar.
944+
The `ExemplarFilter` configuration MUST allow users to select between one of the
945+
built-in ExemplarFilters. While `ExemplarFilter` detrmines which measurements
946+
are *eligible* for becoming an `Exemplar`, the `ExemplarReservoir` makes the
947+
final decision if a measurement becomes an exemplar and is stored.
948948

949-
This interface SHOULD have access to:
950-
951-
- The `value` of the measurement.
952-
- The complete set of `Attributes` of the measurement.
953-
- The [Context](../context/README.md) of the measurement, which covers the
954-
[Baggage](../baggage/api.md) and the current active
955-
[Span](../trace/api.md#span).
956-
- A `timestamp` that best represents when the measurement was taken.
949+
The ExemplarFilter SHOULD be a configuration parameter of a `MeterProvider` for
950+
an SDK. The default value SHOULD be `TraceBased`. The filter configuration
951+
SHOULD follow the [environment variable specification](../configuration/sdk-environment-variables.md#exemplar).
957952

958-
### Built-in ExemplarFilters
953+
An OpenTelemetry SDK MUST support the following filters:
959954

960-
OpenTelemetry supports a number of built-in exemplar filters to choose from.
961-
The default is `TraceBased`.
955+
- [AlwaysOn](#alwayson)
956+
- [AlwaysOff](#alwaysoff)
957+
- [TraceBased](#tracebased)
962958

963-
#### AlwaysOn
959+
### AlwaysOn
964960

965961
An ExemplarFilter which makes all measurements eligible for being an Exemplar.
966962

967-
#### AlwaysOff
963+
### AlwaysOff
968964

969965
An ExemplarFilter which makes no measurements eligible for being an Exemplar.
970966
Using this ExemplarFilter is as good as disabling Exemplar feature.
971967

972-
#### TraceBased
968+
### TraceBased
973969

974970
An ExemplarFilter which makes those measurements eligible for being an
975971
Exemplar, which are recorded in the context of a sampled parent span.
976972

977-
#### Configuration
978-
979-
The ExemplarFilter SHOULD be a configuration parameter of a `MeterProvider` for
980-
an SDK. The default value SHOULD be `TraceBased`. The filter configuration
981-
SHOULD follow the [environment variable specification](../configuration/sdk-environment-variables.md#exemplar).
982-
983973
### ExemplarReservoir
984974

985975
The `ExemplarReservoir` interface MUST provide a method to offer measurements
@@ -1695,8 +1685,6 @@ specific guarantees and safeties.
16951685
**MeterProvider** - Meter creation, `ForceFlush` and `Shutdown` are safe to be
16961686
called concurrently.
16971687

1698-
**ExemplarFilter** - all methods are safe to be called concurrently.
1699-
17001688
**ExemplarReservoir** - all methods are safe to be called concurrently.
17011689

17021690
**MetricReader** - `Collect`, `ForceFlush` (for periodic exporting MetricReader)

0 commit comments

Comments
 (0)