Skip to content

Commit 956dd76

Browse files
authored
Specify that Unbind() is a MUST (#833)
1 parent e52c763 commit 956dd76

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

specification/metrics/api.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,14 @@ To bind an instrument, use the `Bind(labels...)` method to return an
838838
interface that supports the corresponding synchronous API (i.e.,
839839
`Add()` or `Record()`). Bound instruments are invoked without labels;
840840
the corresponding metric event is associated with the labels that were
841-
bound to the instrument. Bound instruments may consume SDK resources
842-
indefinitely until the user calls `Unbind()` to release the bound
843-
instrument.
841+
bound to the instrument.
842+
843+
As a consequence of their performance advantage, bound instruments
844+
also consume resources in the SDK. Bound instruments MUST support an
845+
`Unbind()` method for users to indicate they are finished with the
846+
binding and release the associated resources. Note that `Unbind()`
847+
does not imply deletion of a timeseries, it only permits the SDK to
848+
forget the timeseries existed after there are no pending updates.
844849

845850
For example, to repeatedly update a counter with the same labels:
846851

0 commit comments

Comments
 (0)