Skip to content

Commit

Permalink
feat: define built-in measurement processor
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinkuu committed Jan 2, 2025
1 parent 4cbc0ec commit 01bcc0a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ linkTitle: SDK
- [MeasurementProcessor](#measurementprocessor)
* [MeasurementProcessor operations](#measurementprocessor-operations)
+ [OnMeasure](#onmeasure)
* [Built-in processors](#built-in-processors)
+ [SimpleProcessor](#simpleprocessor)
- [Exemplar](#exemplar)
* [ExemplarFilter](#exemplarfilter)
+ [AlwaysOn](#alwayson)
Expand Down Expand Up @@ -993,6 +995,8 @@ series and the topic requires further analysis.

`MeasurementProcessor` is an interface which allows hooks when a `Measurement` is recorded by an `Instrument`.

Built-in measurement processors are responsible for [Measurement Processing](#measurement-processing).

`MeasurementProcessors` can be registered directly on SDK `MeterProvider` and they are invoked in the same order as they were registered.

SDK MUST allow users to implement and configure custom processors.
Expand Down Expand Up @@ -1032,6 +1036,16 @@ For a `MeasurementProcessor` registered directly on SDK `MeterProvider`, the `me

A `MeasuremenetProcessor` may freely modify `measurement` for the duration of the `OnMeasure` call.

A `MeasurementProcessor` MUST invoke `OnMeasure` on the next registered processor.

### Built-in processors

The standard OpenTelemetry SDK MUST implement simple processor as described below.

#### SimpleProcessor

This is an implementation of `MeasurementProcessor` which calculates an in-memory state from incoming `Measurements`.

## Exemplar

**Status**: [Stable](../document-status.md)
Expand Down

0 comments on commit 01bcc0a

Please sign in to comment.