Skip to content

Commit

Permalink
Update specification of the next parameter and remove NoopProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinkuu committed Jan 22, 2025
1 parent 8fbc341 commit f57fe00
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ linkTitle: SDK
+ [OnMeasure](#onmeasure)
* [Built-in processors](#built-in-processors)
+ [DefaultProcessor](#defaultprocessor)
+ [NoopProcessor](#noopprocessor)
- [Exemplar](#exemplar)
* [ExemplarFilter](#exemplarfilter)
+ [AlwaysOn](#alwayson)
Expand Down Expand Up @@ -1000,7 +999,7 @@ Built-in measurement processors are responsible for [Measurement Processing](#me

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

Each processor registered on the `MeterProvider` is part of a pipeline. The SDK MUST inject the `OnMeasure` function from the next processor in the chain into the current processor. It is RECOMMENDED that the SDK adds a `NoopProcessor` at the end of a pipeline.
Each processor registered on the `MeterProvider` is part of a pipeline.

SDK MUST allow users to implement and configure custom processors.

Expand Down Expand Up @@ -1032,15 +1031,15 @@ The following diagram shows `MeasurementProcessor`'s relationship to other compo

* `context` - the resolved `Context` (the explicitly passed `Context` or the current `Context`)
* `measurement` - a [Measurement](./api.md#measurement) that was recorded
* `next` - the `OnMeasure` function from the next processor in the chain
* `next` - a callback to invoke `OnMeasure` on the next processor in the chain. It MUST be callable without a reference to the next processor.

**Returns:** Void

For a `MeasurementProcessor` registered directly on SDK `MeterProvider`, the `measurement` mutations MUST be visible in next registered processors.

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

A `MeasurementProcessor` SHOULD invoke `OnMeasure` on the next registered processor. A `MeasurementProcessor` MAY decide to drop the `Measurement` by not invoking the next processor.
A `MeasurementProcessor` SHOULD invoke `next`. A `MeasurementProcessor` MAY decide to drop the `Measurement` by not invoking the next processor.

### Built-in processors

Expand All @@ -1050,10 +1049,6 @@ The standard OpenTelemetry SDK MUST implement default processor as described bel

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

#### NoopProcessor

This is an implementation of `MeasurementProcessor` which does nothing. It can be used to entirely disable processing of `Measurements` or to safely terminate a chain of processors.

## Exemplar

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

0 comments on commit f57fe00

Please sign in to comment.