summaryrefslogtreecommitdiff
path: root/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-09-04 15:29:27 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-09-04 15:29:27 +0200
commit78defcd9166a202eb3140dc27afd288e1f9bfec4 (patch)
treedfe061abc810096f0141b7f585d38401c099c488 /vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
parent[performance] faster request id generation (#4405) (diff)
downloadgotosocial-78defcd9166a202eb3140dc27afd288e1f9bfec4.tar.xz
[chore] bump dependencies (#4406)
- codeberg.org/gruf/go-ffmpreg: v0.6.9 -> v0.6.10 - github.com/ncruces/go-sqlite3: v0.27.1 -> v0.28.0 - github.com/stretchr/testify: v1.10.0 -> v1.11.1 - github.com/tdewolff/minify/v2 v2.23.11 -> v2.24.2 - go.opentelemetry.io/otel{,/*}: v1.37.0 -> v1.38.0 - go.opentelemetry.io/contrib/*: v0.62.0 -> v0.63.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4406 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/go.opentelemetry.io/otel/sdk/metric/doc.go')
-rw-r--r--vendor/go.opentelemetry.io/otel/sdk/metric/doc.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
index 90a4ae16c..0f3b9d623 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
@@ -39,6 +39,30 @@
// Meter.RegisterCallback and Registration.Unregister to add and remove
// callbacks without leaking memory.
//
+// # Cardinality Limits
+//
+// Cardinality refers to the number of unique attributes collected. High cardinality can lead to
+// excessive memory usage, increased storage costs, and backend performance issues.
+//
+// Currently, the OpenTelemetry Go Metric SDK does not enforce a cardinality limit by default
+// (note that this may change in a future release). Use [WithCardinalityLimit] to set the
+// cardinality limit as desired.
+//
+// New attribute sets are dropped when the cardinality limit is reached. The measurement of
+// these sets are aggregated into
+// a special attribute set containing attribute.Bool("otel.metric.overflow", true).
+// This ensures total metric values (e.g., Sum, Count) remain correct for the
+// collection cycle, but information about the specific dropped sets
+// is not preserved.
+//
+// Recommendations:
+//
+// - Set the limit based on the theoretical maximum combinations or expected
+// active combinations. The OpenTelemetry Specification recommends a default of 2000.
+// - A too high of a limit increases worst-case memory overhead in the SDK and may cause downstream
+// issues for databases that cannot handle high cardinality.
+// - A too low of a limit causes loss of attribute detail as more data falls into overflow.
+//
// See [go.opentelemetry.io/otel/metric] for more information about
// the metric API.
//