Skip to content

Commit

Permalink
specify that the callback ensures a single timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Apr 6, 2021
1 parent 70d4247 commit eb5cd99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions specification/metrics/new_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb5cd99

Please sign in to comment.