Skip to content

Commit

Permalink
add note to SDK package documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Jul 10, 2024
1 parent d186132 commit 1f6d0d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/metric/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
// is being run on. That way when multiple instances of the code are collected
// at a single endpoint their origin is decipherable.
//
// To avoid leaking memory, the SDK returns the same instrument for calls to
// create new instruments with the same Unit, Name, and Description.
// Importantly, callbacks provided using metric.WithFloat64Callback or
// metric.WithInt64Callback will only apply for the first instrument created
// with a given Name, Unit, and Description. Instead, use
// Meter.RegisterCallback and Registration.Unregister to add and remove
// callbacks without leaking memory.
//
// See [go.opentelemetry.io/otel/metric] for more information about
// the metric API.
//
Expand Down

0 comments on commit 1f6d0d3

Please sign in to comment.