Creating a IBM Cloud Logs line chart widget
You can create a line chart widget that can be included in custom IBM® Cloud Logs dashboards.
The line chart displays values as a series of data points.
Step 1: Enter name and description
Complete the following steps:
-
In a custom dashboard, click Add Widget
and drag and drop the Line Chart widget from your side bar.
-
Replace New line chart with the Name for the widget.
-
Enter a description.
Click Action icon
. Then, select Add description. -
Define where legend values are displayed. Valid values are:
Side,Bottom,Auto, andHide.Click Action icon
. Then, select Legend Settings.
Step 2: Configure the query to define the data set
Complete the following steps:
-
Click Action icon
. Then, select Edit mode. -
For
Query 1, complete the following steps:Select the data type. Valid values are:
Logs,Metrics, andDataPrime.Select the source. Valid options are:
Priority InsightsandAnalyze and Alert.You can rename the query. Select the
and then click Rename query.
-
Enter the query.
When the data type is
DataPrime, enter a Dataprime query in the Query field.When the data type is
Logs, enter a Lucene query in the Query field. You can apply filters and aggregations.When the data type is
Metrics, specify the metric or desired PromQL in the Query field. You can apply filters and aggregations.When creating a bar chart with metrics as the data type, the categories specified in the PromQL query appear in the Group By field automatically. You can reorder categories in the Group By field by dragging and dropping. Drag and drop categories from the Category field into the Stacking field, to stack by a particular category.
-
[Optional] Add one or more filters specific to the widget to narrow down the data that is displayed.
Select a label and its corresponding value.
Filters are applied at the widget level and work alongside dashboard filters. If there is a conflict, the dashboard filters take precedence over widget filters.
-
Add a function.
For a query where the data type is
Logs, you can show an aggregated value using one of the following functions:Aggregation option when building a query when the data type is Logs Aggregation Description Count The total number of logs within the selected time range. Count Distinct The number of unique logs within the selected time range. Sum The sum of all logs within the selected time range. Min The smallest value among the logs within the selected time range. Max The largest value among the logs within the selected time range. Average The average value of all logs within the selected time range. Percentile XX Represents the value below which XX% of the logs fall. For example, Percentile 95 is the value below which 95% of logs fall. For a query where the data type is
Metrics, you can show a calculated value using one of the following functions:Calculations option when building a query when the data type is Metrics Calculation Description Instant The value at the current point in time. Last The most recent value within the selected time range. Min The smallest value within the selected time range. Max The largest value within the selected time range. Avg The average value of all data points within the selected time range. Sum The total sum of all data points within the selected time range. None No calculation is applied. Raw data is used.
Step 3: Configure the widget
Complete the following steps:
-
Click Action icon
. Then, select Edit mode. -
Choose a Tooltip option. Valid values are:
Show all seriesandSingle View.Select whether to see all time series when hovering over them, or to see only the single time series you hover over.
-
In the Visual management section, choose how you want to visualize tha data. Options are Absolute and Relative.
Absolutedisplays specific numbers as the value whereasRelativevalues that are relative to the minimum or maximum value. -
In the Time Bucket section, choose how you want to group data points. You can decide to group data automatically or choose the exact time interval, manually.
You can enter a value that should be shown as data points inside each time bucket.
-
In the Series Management section, configure the
Scaleoption.A scale refers to how values are displayed along the x-axis and y-axis.
Valid options are:
linearthat defines how values increases proportionally andlogarithmicwherein value is defined by logarithms instead of equal linear intervals.By default, setting is linear. If however you have large differences between the different values, it can be helful to show the logarithmic scale instead. For example, if the majority of your values are under 1k and one value is 10k, using the logarithmic scale will show you an easier to read bar chart than linear scale.
Step 4: Save the widget
Complete the following steps:
-
[Optional] Set the widget's dashboard time if you want to use a time range that is different from the Dashboard selected one.
-
Click Save to save your widget.
-
[Optional] Share a direct link to the widget. Click Action icon
. Then, select Share Widget URL, and copy the URL.Anyone with access to the dashboard can open the shared link to view the widget in context.
Shared widget URLs always reflect the dashboard’s last saved version. If you’ve made changes to the widget or layout, save your dashboard before sharing.
-
[Optional] Add a custom action. For more information, see Using actions to integrate with third-party services.