Skip to main content
Ralph’s dashboard system provides a flexible mechanism for displaying data via bar charts and pie charts, helping you visualize key metrics about your infrastructure.

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

1

Create Dashboard Object

Navigate to Dashboards → Dashboards and click Add new dashboard.Give your dashboard a name and description.
2

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.
3

Configure Graph Parameters

Add the JSON configuration in the Params field (see below).
4

Assign Graph to Dashboard

After saving the graph, edit your dashboard and select the graph from the Graphs field.
5

View Your Dashboard

Go to Dashboards → Dashboards list view and click the Link icon to view your dashboard.

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 by
  • filters - Django ORM-style filter conditions

Optional Fields

  • excludes - Exclude items from results (opposite of filters)
  • aggregate_expression - Override default aggregation field
  • limit - Limit number of results
  • sort - 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:
Set Aggregate Type to “Ratio” for this to work.

Date-Based Grouping

Group by parts of dates:
Available modifiers: year, month, day, hour, minute, second

Special Filters

Series Filter

Filter on aggregated values:
This shows only labels where the count is less than 5.

OR and AND Operators

Accepts a list of values to match.

Time-Relative Filters

Filter by relative time using from_now:
Time units:
  • y - years
  • m - months
  • d - days
Example: "-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.
1

Configure Settings

Add to your Ralph settings:
2

Enable on Graph

Check Push to statsd on your graph configuration.
3

Push Data

Run the management command:
Set up a cron job to push data regularly.

REST API

Access dashboard data via the REST API:
All endpoints are read-only.

Tips and Best Practices

Start Simple: Begin with basic label/series configurations before adding complex filters.
Test Filters: Use Django’s ORM query syntax. Test complex queries in the Django shell first.
Performance: Use limit to restrict large result sets and improve rendering speed.
Complex aggregations with multiple joins can be slow. Test performance with production data volumes.

Troubleshooting

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
Common issues:
  • Missing quotes around strings
  • Trailing commas in JSON
  • Incorrect bracket matching
  • Use a JSON validator to check syntax
The |distinct modifier only works with Count aggregate type. Change your aggregate type to “Count”.