Unable to configure precision_threshold for Unique Count in Kibana Lens (v9.3.3)

Hi team,

I'm facing an accuracy issue with the Unique Count aggregation in Kibana Lens and could not find a way to configure precision_threshold through the UI.

Environment

  • Kibana version: 9.3.3
  • Visualization: Lens (Metric)
  • Index: ~25,000 unique conversationId values with multiple duplicates per ID

Issue
When I use unique_count(conversationId) in Lens, the result shows 24,345, which is incorrect.

Running the same query in Dev Tools:

GET my_index/_search
{
  "size": 0,
  "aggs": {
    "unique_convs": {
      "cardinality": {
        "field": "conversationId",
        "precision_threshold": 40000
      }
    }
  }
}

Returns the correct value of 25,000 when precision_threshold is set to 40000. Without precision_threshold, it returns the same incorrect value (24,345) that Lens shows — confirming Lens uses the default threshold of 3000.

What I've tried

  • Lens Formula: unique_count(conversationId, kql='...') — no parameter for precision_threshold.
  • Lens Metric → Advanced panel: only shows Normalize / Filter / Hide zero. No JSON input.
  • Aggregation-based Metric viz: Advanced JSON Input option is no longer visible in 9.3.3 for metric aggregations.
  • TSVB: panel options do not expose JSON input for cardinality precision.
  • Searched Stack Management → Advanced Settings and kibana.yml — no global setting found.

Question

  1. Is there any supported way to set precision_threshold for Unique Count in Lens or any other visualization in Kibana 9.3.3?
  2. If not, is there a recommended workaround other than Vega for displaying an accurate unique count on a production dashboard?
  3. Is there a plan to expose this parameter in the Lens UI in future releases?

Any guidance would be greatly appreciated. This is impacting accuracy of reporting tiles on our production dashboards.

Thanks,
Vignesh

Wrong Thread, Thread Open Again

There is an open issue about this, one workaround mentioned is to use an ESQL visualization where you can set the precision:

I try not to "moan" too often.

But that that issue has been open for 6 years is pretty poor.

Lens is the one of the really core kibana visualizations elements. That ESQL, which didn't exist when the issue was opened, does expose this functionality sort of makes it worse. It is quite far from obvious that the cardinality aggregations is "approximate", I am pretty sure the majority of kibana users would not even know this.

Hopefully someone from Elastic product/dev might see this coming up on the forum and ... the issue says "level of effort" is low.