OpenObserve Docs
User GuideAnalyticsDashboards

Comparison Against in Dashboards

Updated View MarkdownOpen in ChatGPTOpen in Claude

The Comparison Against feature in OpenObserve Dashboards allows you to visually compare your current data with data from a selected point in time in the past. It is useful for trend analysis and identifying patterns over time.

Where to Find This Feature

The Comparison Against feature is available for the following chart types in Dashboards:

  • Area
  • Area Stacked
  • Bar
  • Horizontal Bar
  • Line
  • Scatter
  • Stacked
  • Horizontal Stacked

It is also available for PromQL panels of these types that run a range query. It is not shown for PromQL instant queries, which have no time range to shift.

How it Works

StepWithout Comparison AgainstWith Comparison Against
SQL QueryYou write SQL query for the current time frame (default).Same SQL query is used for both current and past time frames.
Period (Time Range)You select a time range (e.g., last 30 mins).Same time range is applied to both current and past queries.
Query ExecutionQuery runs at the current time for the selected time range.If you select one time frame in the past, the same query runs twice:
• Query 1: Runs at the current time for the selected time range.
• Query 2: Runs at the past time for the selected time range.
Query ResultsSingle result: current data only.Two result sets:
• Query 1: Current data
• Query 2: Past data
VisualizationChart shows current data only.Chart shows both current and past data side by side for comparison.

How to Use the Compare Against Feature

For example, you want to compare the error trends for the last 15 mins today with the error trends for the same 15 minutes, 1 hour earlier.

Let's say,

  • You want to view the error trend for the past 15 mins today (for example, from 3
    PM - 4
    PM, today).
  • Now, you want to compare it with the error trend for the same 15 minutes one hour earlier (from 2
    PM - 3
    PM).

The following steps explain how to use the Comparison Against feature for this scenario:

  1. Go to Dashboards > New dashboard.
    Dashboards
  2. Click Add Panel.
    Add panel
  3. Select a chart where the Comparison Against feature is available.

    Chart selection
  4. Under Fields, add Stream Type and Stream. These define the data source for your SQL query. Select fields that you want to set as x-axis (for example, timestamp) and y-axis (for example, error) of the chart.
    Stream selection
    Note: You may use the Query editor to further customize your query. Query editor
  5. Choose a time range. For instance, Past 15 Minutes. This becomes the period, the time range the system will use for both your current data and comparison data.
    Time range selection
  6. Open the Config sidebar and expand the Comparison Against section.
    Config menu
  7. By default, 0 Minutes ago is selected. This represents your current time.
  8. Click + Add to choose one or more past times to compare against the current time. For example, 1 Hour ago. Use the dropdown menu to select the desired time. The system runs your SQL query for the same time range (period) at this past point.

    Add past time
  9. (Optional) Select a Color Palette to differentiate charts.
  10. Click Apply to run the query and update the chart.
    Note: Time shift changes do not trigger the live preview. Click Apply after adding or changing any comparison values.

Result:
The results of both queries are shown side by side on your chart, making it easy to visually compare your current data with historical data. Result of comparison against

Was this page helpful?

On this page