You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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**.
2
+
It is useful for trend analysis and identifying patterns over time.
1
3
2
4
### Where to Find This Feature
3
5
The **Comparison Against** feature is available for the following chart types in **Dashboards**:
@@ -11,39 +13,49 @@ The **Comparison Against** feature is available for the following chart types in
11
13
- Stacked
12
14
- Horizontal Stacked
13
15
14
-
### How it Works?
15
-
After you write your SQL query and select the time range (such as 15 minutes) for your current data, **Compare Against** lets you select past points in time (like 1 day ago) to run the same query for the same time range.
16
-
OpenObserve runs the query for both the current time and each past time, and shows the results side by side on your selected chart.
16
+
### How it Works
17
17
18
-
If you select the time range of 15 minutes, OpenObserve runs:
18
+
| Step | Without Comparison Against | With Comparison Against |
|**SQL Query**| You write SQL query for the current time frame (default). | Same SQL query is used for both current and past time frames. |
21
+
|**Period (Time Range)**| You select a time range (e.g., last 30 mins). | Same time range is applied to both current and past queries. |
22
+
|**Query Execution**| Query runs at the current time for the selected time range. | If you select one time frame in the past, the same query runs twice:<br>• Query 1: Runs at the current time for the selected time range.<br>• Query 2: Runs at the past time for the selected time range. |
23
+
|**Query Results**| Single result: current data only. | Two result sets:<br>• Query 1: Current data<br>• Query 2: Past data |
24
+
|**Visualization**| Chart shows current data only. | Chart shows both current and past data side by side for comparison. |
19
25
20
-
- Your query for the selected time range at the current time (e.g., 3:00 PM → 3:15 PM).
21
-
- The same query for the same time range at the past time you selected (e.g., 1 day ago -> yesterday, 3:00 PM → 3:15 PM).
22
26
27
+
### How to Use the Compare Against Feature
28
+
For example, you want to compare **the error trends for the last 15 mins today** with **the error trends for the same time period, 2 days ago**.
23
29
24
-
#### To access the feature
30
+
Let's say,
31
+
32
+
- You want to view the error trend for the past 15 mins today (for example, from 3:45 PM - 4:00 PM, today).
33
+
- Now, you want to compare the error trend for the same time period (from 3:45 PM - 4:00 PM), 2 days ago.
34
+
35
+
The following steps provides step-by-step instructions on how to use the **Comparison Against** for this scenario:
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.<br>
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.
47
+
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.<br>
37
48

38
49
6. Open the **Config** menu and scroll to **Comparison Against**.<br>
7. By default, **0 Minutes ago** is selected. This represents your current data time.
41
-
8. Click **+ Add** to choose one or more past times to compare against the current time. For example, **1 day 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.
51
+
7. By default, **0 Minutes ago** is selected. This represents your current time.
52
+
8. Click **+ Add** to choose one or more past times to compare against the current time. For example, **2 days 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.<br>
42
53

43
54
9. (Optional) Select a **Color Palette** to differentiate charts.
44
55
10. Click **Apply** to run the query and update the chart.
45
56
**Note**: You must click **Apply** after adding or changing any comparison values.
46
57
47
-
**Result:**
58
+
**Result:** <br>
59
+
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.
48
60

0 commit comments