Skip to content

Commit 5f5f4af

Browse files
dashpoleMrAlias
andauthored
Document the ordering guarantees provided by the metrics SDK (#7453)
Forked from this discussion here: #7443 (comment) It seems like a good idea for us as a group to align on and document what we are comfortable with in terms of how ordered measurements are reflected in collected metric data. --------- Co-authored-by: Tyler Yahn <[email protected]>
1 parent b64883d commit 5f5f4af

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sdk/metric/doc.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@
6363
// issues for databases that cannot handle high cardinality.
6464
// - A too low of a limit causes loss of attribute detail as more data falls into overflow.
6565
//
66+
// # Ordering and Collection Guarantees
67+
//
68+
// For performance reasons, the SDK does not guarantee that the order in which
69+
// synchronous measurements are made to the SDK is reflected in the collected
70+
// metric data. This means that even when a single goroutine makes sequential
71+
// synchronous measurements, it is possible for a later measurement to be
72+
// included in the collected metric data when an earlier measurement is not.
73+
// This applies to measurements made to different instruments, or to different
74+
// attribute sets on the same instrument. Sequential measurements made to the
75+
// same instrument and with the same attributes are guaranteed to preserve
76+
// ordering with respect to collection.
77+
//
78+
// Additionally, the SDK does not guarantee that exemplars are always included
79+
// in the same batch of metric data as the measurement they are associated
80+
// with.
81+
//
6682
// See [go.opentelemetry.io/otel/metric] for more information about
6783
// the metric API.
6884
//

0 commit comments

Comments
 (0)