Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename built-in ExemplarFilters #2919

Merged
merged 13 commits into from
Dec 20, 2022
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ release.

### Metrics

- Rename built-in ExemplarFilters to AlwaysOn, AlwaysOff and TraceBased.
([#2919](https://github.com/open-telemetry/opentelemetry-specification/pull/2919))

### Logs

### Resource
Expand All @@ -28,6 +31,10 @@ release.

### SDK Configuration

- Rename knowns values for "OTEL_METRICS_EXEMPLAR_FILTER" to "always_on",
"always_off" and "trace_based".
([#2919](https://github.com/open-telemetry/opentelemetry-specification/pull/2919))

### Telemetry Schemas

### Common
Expand Down
28 changes: 25 additions & 3 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ linkTitle: SDK
- [Attribute limits](#attribute-limits)
- [Exemplar](#exemplar)
* [ExemplarFilter](#exemplarfilter)
* [Built-in ExemplarFilters](#built-in-exemplarfilters)
+ [AlwaysOn](#alwayson)
+ [AlwaysOff](#alwaysoff)
+ [TraceBased](#tracebased)
* [ExemplarReservoir](#exemplarreservoir)
* [Exemplar defaults](#exemplar-defaults)
- [MetricReader](#metricreader)
Expand Down Expand Up @@ -651,7 +655,9 @@ A Metric SDK SHOULD provide extensible hooks for Exemplar sampling, specifically
### ExemplarFilter

The `ExemplarFilter` interface MUST provide a method to determine if a
measurement should be sampled.
measurement should be sampled. Sampled here simply makes the measurement
eligible for being included as an exemplar. `ExemplarReservoir` makes the final
decision if a measurement becomes an exemplar.

This interface SHOULD have access to:

Expand All @@ -662,8 +668,24 @@ This interface SHOULD have access to:
[Span](../trace/api.md#span).
- A `timestamp` that best represents when the measurement was taken.

See [Defaults and Configuration](#defaults-and-configuration) for built-in
filters.
### Built-in ExemplarFilters

OpenTelemetry supports a number of built-in exemplar filters to choose from.
The default is `TraceBased`.

#### AlwaysOn

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

#### AlwaysOff

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

#### TraceBased

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

### ExemplarReservoir

Expand Down
6 changes: 3 additions & 3 deletions specification/sdk-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ Known values for `OTEL_LOGS_EXPORTER` are:

Known values for `OTEL_METRICS_EXEMPLAR_FILTER` are:

- `"none"`: No measurements are eligible for exemplar sampling.
- `"all"`: All measurements are eligible for exemplar sampling.
- `"with_sampled_trace"`: Only allow measurements with a sampled parent span in context.
- `"always_on"`: [AlwaysOn](./metrics/sdk.md#alwayson)
reyang marked this conversation as resolved.
Show resolved Hide resolved
- `"always_off"`: [AlwaysOff](./metrics/sdk.md#alwaysoff)
- `"trace_based"`: [TraceBased](./metrics/sdk.md#tracebased)

### Periodic exporting MetricReader

Expand Down