|
| 1 | +--- |
| 2 | +title: "Metrics dashboards" |
| 3 | +description: "Create custom dashboards with real-time metrics powered by TRQL queries." |
| 4 | +--- |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +In the Trigger.dev dashboard we have built-in dashboards and you can create your own. |
| 9 | + |
| 10 | +Metrics dashboards are powered by [TRQL queries](/insights/query) with widgets that can be displayed as charts, tables, or single values. They automatically refresh to show the latest data. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +### Visualization types |
| 15 | + |
| 16 | +- **Line chart** - Show trends over time |
| 17 | +- **Bar chart** - Compare values across categories |
| 18 | +- **Area chart** - Display cumulative trends |
| 19 | +- **Table** - Show detailed data in rows |
| 20 | +- **Single value** - Display a single metric (count, sum, average, etc.) |
| 21 | + |
| 22 | +You can also add Titles to your dashboard. |
| 23 | + |
| 24 | +## Filtering and time ranges |
| 25 | + |
| 26 | +All widgets on a dashboard use the time range filter applied to the dashboard. |
| 27 | + |
| 28 | +You can also filter the data by: |
| 29 | + |
| 30 | +- Scope: Environment, Project, Organization |
| 31 | +- Tasks |
| 32 | +- Queues |
| 33 | + |
| 34 | +## Creating custom metrics dashboards |
| 35 | + |
| 36 | +1. In the sidebar click the + icon next to "Metrics". |
| 37 | +2. Name your custom dashboard. |
| 38 | +3. From the top-right you can "Add chart" or "Add title". |
| 39 | +4. For charts you write [TRQL queries](/insights/query) and choose a visualization type. |
| 40 | +5. You can resize and reposition widgets on your dashboards. |
| 41 | + |
| 42 | +## Performance considerations |
| 43 | + |
| 44 | +### Optimize queries for metrics |
| 45 | + |
| 46 | +1. **Use time bucketing** - `timeBucket()` automatically groups by appropriate intervals |
| 47 | +2. **Limit result size** - Add `LIMIT` clauses, especially for table widgets |
| 48 | +3. **Use approximate functions** - `uniq()` instead of `uniqExact()` for faster approximate counts |
| 49 | + |
| 50 | +## Exporting metric data |
| 51 | + |
| 52 | +Export data from any metric widget: |
| 53 | + |
| 54 | +1. Click the widget menu (three dots) |
| 55 | +2. Select "Copy JSON" or "Copy CSV" |
| 56 | + |
| 57 | +## Best practices |
| 58 | + |
| 59 | +1. **Start simple** - Begin with basic metrics and iterate based on insights |
| 60 | +2. **Use meaningful names** - Give widgets clear, descriptive titles |
| 61 | +3. **Group related metrics** - Organize dashboards by theme (performance, costs, errors) |
| 62 | +4. **Test queries first** - Use the Query page to develop and test before adding to dashboards |
| 63 | + |
| 64 | +## Troubleshooting |
| 65 | + |
| 66 | +### Widget shows "No data" |
| 67 | + |
| 68 | +- Check that your query returns results in the Query page |
| 69 | +- Verify time filters include the period with data |
| 70 | +- Ensure task/queue filters match existing runs |
| 71 | + |
| 72 | +### Widget is slow to load |
| 73 | + |
| 74 | +- Add time range filters to your query |
| 75 | +- Use `LIMIT` clauses |
| 76 | +- Simplify aggregations |
| 77 | +- Check query execution time in Query page |
| 78 | + |
| 79 | +### Chart displays incorrectly |
| 80 | + |
| 81 | +- Verify column names match visualization config |
| 82 | +- Check data types (numbers for charts, dates for time series) |
| 83 | +- Ensure `timeBucket()` is used for time-series charts |
| 84 | +- Review that series columns exist in query results |
| 85 | + |
| 86 | +## Limits |
| 87 | + |
| 88 | +Metrics is powered by Query so have [the same limits](/insights/query#limits) as Query. |
| 89 | + |
| 90 | +There is a separate concurrency limits for metric widgets. |
| 91 | + |
| 92 | +| Limit | Details | |
| 93 | +| :------------------------ | :------------- | |
| 94 | +| Concurrent widget queries | 30 per project | |
| 95 | + |
| 96 | +See [Limits](/limits) for details. |
0 commit comments