addCardinality

suspend fun addCardinality(key: MetricKey, element: String): MetricExportResult

Add element to the HyperLogLog sketch for key. Elements are hashed with MurmurHash3 — the element string is the canonical identifier (e.g. a user id, session id, or request id).

No double-count under retry. Adding the same element twice produces the same hash and the same register max — the estimate is unchanged. Returns MetricExportResult.Success after the durable write.