Skip to content

Metrics & Dimensions

How collected event data translates into queryable metrics and dimensions in the Dicolytics dashboard and Explore tool.

Metrics

A metric is a numeric value you can aggregate, chart, and compare over time. The dashboard computes metrics from the raw event stream.

Available Metrics

MetricComputationDescription
eventsCOUNT(*)Total number of event rows. For gateway events, each row represents one 60-second aggregation window.
interactionsCOUNT(*) WHERE type LIKE 'interaction_%'Total interaction events (all 6 types).
actionsCOUNT(*) WHERE type LIKE 'action_%'Total action events (all 22 types).
discord_eventsSUM(data.count) WHERE type LIKE 'event_%'Total gateway event occurrences (the real count, not the row count).
errorsCOUNT(*) WHERE type IN ('error', 'command_error')Total error events.
unique_usersHLL_DISTINCT(userId)Approximate count of distinct users.
unique_serversHLL_DISTINCT(guildId)Approximate count of distinct servers.
avg_latencyAVG(data.latencyMs)Average interaction response latency in milliseconds.
p95_latencyPERCENTILE_CONT(0.95, data.latencyMs)95th percentile response latency.
success_rateCOUNT(success=true) / COUNT(*)Interaction success rate as a percentage.

HyperLogLog (HLL) for Unique Counts

Approximate unique counting

unique_users and unique_servers use HyperLogLog (HLL), a probabilistic algorithm that provides approximate distinct counts with very low memory usage. The error margin is typically under 2%.

HLL is used because exact distinct counting over large time ranges would require scanning every individual event. HLL sketches are pre-computed and can be merged across time buckets efficiently.

In the dashboard, unique counts are labeled as approximate. For exact counts over small data sets, use the Explore tool with a specific date range and filter.

Dimensions

A dimension is a categorical attribute you can group by or filter on. Each event carries several dimensions extracted from the event data.

Available Dimensions

DimensionSourceDescription
timetsEvent timestamp. Supports bucketing by minute, hour, day, week, month.
event_typetypeThe event type string (e.g., interaction_slash, action_message_send).
guild_idguildIdServer snowflake ID.
channel_idchannelIdChannel snowflake ID.
user_iduserIdUser snowflake ID.
commanddata.commandNameCommand name or normalized customId.
interaction_kinddata.interactionKindInteraction type: slash, button, select, modal, context_menu, autocomplete.
shard_iddata.shardIdShard ID (0--32767).
cluster_iddata.clusterIdCluster ID (0--32767).
successdata.successWhether the interaction response succeeded.
error_namedata.nameError class name (for error and command_error types).
custom_event_namedata.nameCustom event name (for custom type).

Custom Event Props as Dimensions

Custom event properties are accessible as dimensions using the props.* prefix:

props.category = billing
props.priority = high
props.sku = pro

Only string, number, and boolean property values can be used as filter values. Nested objects are not directly filterable.

Reading Metric Values

In the Dashboard

Dashboard report pages display pre-configured combinations of metrics and dimensions:

  • KPI cards at the top show single aggregated values (e.g., total interactions, unique users).
  • Charts plot metrics over time or by dimension.
  • Tables show detailed breakdowns with sortable columns.

In Explore

The Explore tool lets you build custom queries by combining:

  1. One metric -- what to measure (e.g., events, unique_users, avg_latency)
  2. One dimension -- how to group results (e.g., time, command, guild_id)
  3. Zero or more filters -- conditions to narrow the data

Note

  • Use interactions to count user-initiated actions toward your bot.
  • Use actions to count bot-initiated REST API calls.
  • Use discord_events (not events) for accurate gateway event counts, since gateway events are aggregated.
  • Use unique_users for DAU/WAU/MAU-style analysis.

Metric Computation Examples

Command popularity ranking

Metric:    interactions
Dimension: command
Filter:    interaction_kind = slash
Period:    Last 7 days

Daily active users trend

Metric:    unique_users
Dimension: time (day)
Period:    Last 30 days

Error rate by command

Metric:    errors
Dimension: command
Filter:    event_type = command_error
Period:    Last 24 hours

Gateway event volume

Metric:    discord_events
Dimension: event_type
Filter:    event_type contains event_
Period:    Last 7 days

Time Bucketing

When the time dimension is selected, the dashboard automatically chooses an appropriate bucket size based on the selected period:

PeriodDefault Bucket
Today / Yesterday1 hour
Last 7 days1 day
Last 30 days1 day
Last 90 days1 week
Custom rangeAuto-selected

The Explore tool allows manual bucket size selection for custom analysis.

Dicolytics — Discord bot analytics