Skip to content

Commit 351907b

Browse files
updated pages
1 parent ef4d44c commit 351907b

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
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.
13

24
### Where to Find This Feature
35
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
1113
- Stacked
1214
- Horizontal Stacked
1315

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
1717

18-
If you select the time range of 15 minutes, OpenObserve runs:
18+
| Step | Without Comparison Against | With Comparison Against |
19+
|------|------------------------|---------------------|
20+
| **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. |
1925

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).
2226

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**.
2329

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:
2536

2637
1. Go to **Dashboards** > **New Dashboard**.
2738
![dashboards](../../images/dashboards-comparison-against-1.png)
2839
2. Click **Add Panel.**
2940
![add panel](../../images/dashboards-comparison-against-2.png)
30-
3. Select a chart [where the **Comparison Against** feature is available](#where-to-find-this-feature).
41+
3. Select a chart [where the **Comparison Against** feature is available](#where-to-find-this-feature).<br>
3142
![chart selection](../../images/dashboards-comparison-against-3.png)
3243
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>
3344
![stream selection](../../images/dashboards-comparison-against-4.png)
3445
<br>**Note**: You may use the Query editor to further customize your query.
3546
![query editor](../../images/dashboards-comparison-against-5.png)
36-
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>
3748
![time range selection](../../images/dashboards-comparison-against-6.png)
3849
6. Open the **Config** menu and scroll to **Comparison Against**.<br>
3950
![config menu](../../images/dashboards-comparison-against-7.png)
40-
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>
4253
![add past time](../../images/dashboards-comparison-against-8.png)
4354
9. (Optional) Select a **Color Palette** to differentiate charts.
4455
10. Click **Apply** to run the query and update the chart.
4556
**Note**: You must click **Apply** after adding or changing any comparison values.
4657

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.
4860
![result of comparison against](../../images/dashboards-comparison-against-9.png)
4961

0 commit comments

Comments
 (0)