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
| Metric | Computation | Description |
|---|---|---|
events | COUNT(*) | Total number of event rows. For gateway events, each row represents one 60-second aggregation window. |
interactions | COUNT(*) WHERE type LIKE 'interaction_%' | Total interaction events (all 6 types). |
actions | COUNT(*) WHERE type LIKE 'action_%' | Total action events (all 22 types). |
discord_events | SUM(data.count) WHERE type LIKE 'event_%' | Total gateway event occurrences (the real count, not the row count). |
errors | COUNT(*) WHERE type IN ('error', 'command_error') | Total error events. |
unique_users | HLL_DISTINCT(userId) | Approximate count of distinct users. |
unique_servers | HLL_DISTINCT(guildId) | Approximate count of distinct servers. |
avg_latency | AVG(data.latencyMs) | Average interaction response latency in milliseconds. |
p95_latency | PERCENTILE_CONT(0.95, data.latencyMs) | 95th percentile response latency. |
success_rate | COUNT(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
| Dimension | Source | Description |
|---|---|---|
time | ts | Event timestamp. Supports bucketing by minute, hour, day, week, month. |
event_type | type | The event type string (e.g., interaction_slash, action_message_send). |
guild_id | guildId | Server snowflake ID. |
channel_id | channelId | Channel snowflake ID. |
user_id | userId | User snowflake ID. |
command | data.commandName | Command name or normalized customId. |
interaction_kind | data.interactionKind | Interaction type: slash, button, select, modal, context_menu, autocomplete. |
shard_id | data.shardId | Shard ID (0--32767). |
cluster_id | data.clusterId | Cluster ID (0--32767). |
success | data.success | Whether the interaction response succeeded. |
error_name | data.name | Error class name (for error and command_error types). |
custom_event_name | data.name | Custom 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 = proOnly 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:
- One metric -- what to measure (e.g.,
events,unique_users,avg_latency) - One dimension -- how to group results (e.g.,
time,command,guild_id) - Zero or more filters -- conditions to narrow the data
Note
- Use
interactionsto count user-initiated actions toward your bot. - Use
actionsto count bot-initiated REST API calls. - Use
discord_events(notevents) for accurate gateway event counts, since gateway events are aggregated. - Use
unique_usersfor DAU/WAU/MAU-style analysis.
Metric Computation Examples
Command popularity ranking
Metric: interactions
Dimension: command
Filter: interaction_kind = slash
Period: Last 7 daysDaily active users trend
Metric: unique_users
Dimension: time (day)
Period: Last 30 daysError rate by command
Metric: errors
Dimension: command
Filter: event_type = command_error
Period: Last 24 hoursGateway event volume
Metric: discord_events
Dimension: event_type
Filter: event_type contains event_
Period: Last 7 daysTime Bucketing
When the time dimension is selected, the dashboard automatically chooses an appropriate bucket size based on the selected period:
| Period | Default Bucket |
|---|---|
| Today / Yesterday | 1 hour |
| Last 7 days | 1 day |
| Last 30 days | 1 day |
| Last 90 days | 1 week |
| Custom range | Auto-selected |
The Explore tool allows manual bucket size selection for custom analysis.