From eb5cd995395a8224edbf595ce76d9e4f206015cd Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Tue, 6 Apr 2021 08:28:19 -0700 Subject: [PATCH] specify that the callback ensures a single timestamp --- specification/metrics/new_api.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/specification/metrics/new_api.md b/specification/metrics/new_api.md index d91dfa6a250..423704641da 100644 --- a/specification/metrics/new_api.md +++ b/specification/metrics/new_api.md @@ -351,11 +351,12 @@ some examples: * Return a list (or tuple, generator, enumerator, etc.) of `Measurement`s. * Use an observer argument to allow individual `Measurement`s to be reported. -Duplicates are not allowed. If it happens, the [SDK](./README.md#sdk) can decide -how to handle it. For example, during the callback invocation if two -measurements `value=1, attributes={pid:4 bitness:64}` and `value=2, -attributes={pid:4, bitness:64}` are reported, the SDK can decide to drop the -entire data, pick the last one, take all the data and add them together, or +A single timestamp MUST be used per invocation of the callback. Duplicates are +not allowed. If it happens, the [SDK](./README.md#sdk) can decide how to handle +it. For example, during the callback invocation if two measurements `value=1, +attributes={pid:4 bitness:64}` and `value=2, attributes={pid:4, bitness:64}` are +reported, the SDK can decide to simply let them pass through (so the downstream +consumer can handle duplication), drop the entire data, pick the last one, or something else. The API SHOULD provide some way to pass `state` to the callback. Individual