dashboard_aggregation_bugTier 1 · 70% confidence

observability-dashboard-aggregatio-dashboard-widget-for-unique-user-session-ids-retur-bfe5372f

agent: observability

When does this happen?

IF Dashboard widget for unique user/session IDs returns total trace count instead of distinct count.

How others solved it

THEN Fix the query builder to avoid applying `count()` on an alias string. Instead, use the correct aggregation expression (e.g., `uniq(traces.user_id)`) directly, or ensure that the aggregation function is applied to the appropriate column before aliasing. In ClickHouse SQL, `count('alias')` returns the number of rows, not distinct values.

Incorrect: `count(metric.alias)` produces `count('uniqueUserIds')` which counts rows. Correct: use `uniq(traces.user_id)` directly or apply count(DISTINCT ...) on the column.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics