-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metric SDK specification OUTLINE (#347)
* WIP: Metric SDK specification * Updates following Tigran's feedback * More rewording * Strengthen requirements for aggregators * Fix typos noted by MrAlias * Address some of freeformzSFDC's feedback * Capitalization * Respond to feedback * Respond to feedback * Handle->Bound instrument * New img * New img ref * Update image * Rename to Differentiator/Integrator * Remove reference to defaultkeys batcher * Batcher->Integrator * Differentiator->Accumulator * Upstream * Move the image * Update image * Simplify the diagram * Remove much dead code * Remove more dead code * Lint * Ignore * Rename metrics SDK * Bold * CheckpointSet -> ExportRecordSet * Update diagram * Update diagram (png) * Editing * Undo
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Metrics SDK | ||
|
||
Note: This document assumes you are familiar with the (Metrics | ||
API)[api.md] specification. | ||
|
||
TODO: TOC | ||
|
||
## Purpose | ||
|
||
This document describes a model implementation of the OpenTelemetry | ||
Metrics SDK. The architectural details of the model SDK described | ||
here are meant to offer guidance to implementors, not to mandate an | ||
exact reproduction of the model architecture across languages. | ||
|
||
## Expectations | ||
|
||
The SDK implementors are expected to follow the best practices for the | ||
language and runtime environment when implementing the OpenTelemetry | ||
API. Implementors SHOULD follow the general prescriptions on safety | ||
and performance given in [OpenTelemetry library | ||
guidelines](../library-guidelines.md). | ||
|
||
## Export Pipeline Terminology | ||
|
||
**Export Pipeline** is used to describe a whole assembly of SDK parts. | ||
There are three major components of the Metrics SDK that data flows | ||
through, in order: | ||
|
||
1. **Accumulator**: Receives metric events from the API, computes one Accumulation per active Instrument and Label Set pair | ||
2. **Processor**: Receives Accumulations from the Accumulator, transforms into ExportRecordSet | ||
3. **Exporter**: Receives ExportRecordSet, transforms into some protocol and sends it somewhere. | ||
|
||
These terms are defined in the Metrics API specification: | ||
|
||
- **Metric Instrument**: the API object used by a developer for instrumentation | ||
- **Synchronous Instrument**: a metric instrument called by the user with application context | ||
- **Asynchronous Instrument**: a metric instrument invoked through a callback from the SDK | ||
- **Metric Descriptor**: describes a metric instrument | ||
- **Metric Event**: a single recorded or observed (Instrument, Label Set, Measurement) | ||
- **Collection Interval**: the period between calls to Accumulator.Collect() | ||
- **Label**: a key-value describing a property of the metric event | ||
- **Label Set**: a set of key-values with unique keys | ||
- **Measurement**: an integer or floating point number. | ||
|
||
Defined in the [Resource SDK](../resource/sdk.md) specification: | ||
|
||
- **Resource**: a set of key-values with unique keys describing the process. | ||
|
||
These are the significant data types used in the model architecture: | ||
|
||
- **Aggregator**: aggregates one or more measurements in a useful way | ||
- **AggregatorSelector**: chooses which Aggregator to assign to a metric instrument | ||
- **Aggregation**: the result of aggregating one or more events by a specific aggregator | ||
- **AggregationKind**: describes the kind of read API the Aggregation supports (e.g., Sum) | ||
- **Accumulation**: consists of Instrument, Label Set, Resource, and Aggregator snapshot | ||
- **ExportRecordSet**: a set of export records | ||
- **Controller**: coordinates the Accumulator, Processor, and Exporter components in an export pipeline | ||
- **Export Record**: consists of Instrument, Label Set, Resource, Timestamp(s), and Aggregation | ||
- **ExportKind**: one of Delta, Cumulative, or Pass-Through | ||
- **ExportKindSelector**: chooses which ExportKind to use for a metric instrument. | ||
|
||
## Dataflow Diagram | ||
|
||
![Metrics SDK Design Diagram](img/metrics-sdk.png) | ||
|
||
## Accumulator Detail | ||
|
||
## Controller Detail | ||
|
||
## Basic Processor Detail | ||
|
||
## Reducing Processor Detail | ||
|
||
## Aggregator Implementations |