Overview
Dashboards allow you to:- Create custom graphs from any Ralph model data
- Display data as vertical bars, horizontal bars, or pie charts
- Aggregate and filter data with complex queries
- Push metrics to statsd for external monitoring
- Build multiple graphs into unified dashboards
Getting Started
This tutorial will walk through creating a dashboard showing asset quantities across data centers.Demo Data
To experiment with dashboards, generate sample data:Creating Your First Dashboard
Create Dashboard Object
Navigate to Dashboards → Dashboards and click Add new dashboard.Give your dashboard a name and description.
Create a Graph
Click Add Graph and configure it with:
- Name: “DC Capacity”
- Model: Select the model to query (e.g., DataCenterAsset)
- Chart Type: Choose Vertical Bar, Horizontal Bar, or Pie Chart
- Aggregate Type: Count, Sum, Max, etc.
Assign Graph to Dashboard
After saving the graph, edit your dashboard and select the graph from the Graphs field.
Graph Configuration
Graphs are configured using JSON in the Params field.Required Fields
labels- Field to use for string representation (x-axis labels)series- Field to aggregate byfilters- Django ORM-style filter conditions
Optional Fields
excludes- Exclude items from results (opposite of filters)aggregate_expression- Override default aggregation fieldlimit- Limit number of resultssort- Order results by field
Target Options
Change the clickable graph behavior:Advanced Aggregation
Distinct Values
Count distinct values using the|distinct modifier:
Ratio Calculations
Calculate ratios between two fields:Date-Based Grouping
Group by parts of dates:year, month, day, hour, minute, second
Special Filters
Series Filter
Filter on aggregated values:OR and AND Operators
Time-Relative Filters
Filter by relative time usingfrom_now:
y- yearsm- monthsd- days
"-1y" means one year ago to now.
Example Configurations
Assets by Data Center
Services by Environment
Asset Age Distribution
Integration with Statsd
Push graph data to statsd for external monitoring systems.
Set up a cron job to push data regularly.
REST API
Access dashboard data via the REST API:Tips and Best Practices
Troubleshooting
Graph shows no data
Graph shows no data
Check:
- Your filters might be too restrictive
- The model has data matching your criteria
- Field names are correct (use Django model field names)
- JSON syntax is valid
JSON parsing error
JSON parsing error
Common issues:
- Missing quotes around strings
- Trailing commas in JSON
- Incorrect bracket matching
- Use a JSON validator to check syntax
Distinct aggregation not working
Distinct aggregation not working
The
|distinct modifier only works with Count aggregate type. Change your aggregate type to “Count”.Related Documentation
- Custom Fields - Add custom data to visualize
- DCIM - Data center asset data