A Sankey diagram visually represents metric values such as the traffic and weight between different nodes by using the width of arrows or flows. This topic describes how to configure a Sankey diagram. This topic also provides examples of Sankey diagrams.
Overview
A Sankey diagram is a specific type of flow chart. A Sankey diagram shows the flow from one set of values to another set of values. Sankey diagrams are suitable for scenarios such as scenarios in which network traffic flows need to be displayed. A Sankey diagram contains three sets of values: source
, target
, and value
. source
and target
describe the relationships between nodes, and value
describes the edge relationships between source
and target
.
A Sankey diagram consists of the following elements:
Node
Edge
The following table describes the data that can be displayed in a Sankey diagram.
source | target | value |
node1 | node2 | 14 |
node1 | node3 | 12 |
node3 | node4 | 5 |
... | .. | ... |
The following figure shows a Sankey diagram that is generated based on the preceding data.
Configuration example
Log on to the Simple Log Service console. In the Projects section, click the project you want.
In the left-side navigation pane, choose Dashboard > Dashboards. In the dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, click Add > Add Chart.
On the right side of the Edit Chart page, select Sankey Diagram in the Chart Types section and configure parameters in the Query and Analysis Configurations and Chart Configurations sections based on the following figure. On the left side of the Edit Chart page, configure the query time range, Logstore, and query statement for the Sankey diagram. After you complete the configuration, click Apply in the upper part of the Edit Chart page to view the configuration effects of the Sankey diagram.
The following query statement is used to query the data of network requests:
* | select COALESCE(client_ip, slbid, host) as source, COALESCE(host, slbid, client_ip) as dest, sum(request_length) as inflow group by grouping sets( (client_ip, slbid), (slbid, host))
Simple Log Service and Classic Load Balancer (CLB) jointly launch the Layer 7 access log management feature to record the details of all requests that are sent to CLB. The details include the request time, client IP address, latency, request path, and server response. You can add a Sankey diagram based on Layer 7 access logs. For more information, see Enable the access log management feature.
Configuration on the General Configurations tab
You can configure global settings for a Sankey diagram on the General Configurations tab.
Basic Configurations
Parameter
Description
Title
The title of the chart.
Display Title
If you turn on Display Title, the title of the chart is displayed.
Display Border
If you turn on Display Border, the borders of the chart are displayed.
Display Background
If you turn on Display Background, the background color of the chart is displayed.
Display Time
If you turn on Display Time, the query time range of the chart is displayed.
Fixed Time
If you turn on Fixed Time, the query time range of the chart is independent of the global time range of the dashboard.
Standard Configurations
Parameter
Description
Format
The display format of numeric values.
Unit
The unit of numeric values.
Number of Digits after Decimal Point
The decimal places of numeric values.
Display Name
The name of the display field.
If you specify a value for Display Name, the value is used as the names for all display fields in the chart. If you want to change the name of a display field, you must configure parameters on the Field Configuration tab.
Color Scheme
The color scheme of the chart.
Built-in: uses the built-in color scheme.
Solid: uses the color that you select.
Threshold: uses different colors for different values based on the specified thresholds for the values.
Parameters in the Query and Analysis Configurations section
Parameter
Description
Start Column
The start node.
End Column
The end node.
Value Column
The value of traffic between the start node and end node.
Parameters in the Chart Configurations section
Parameter
Description
Connection Line Color
The connection line color.
Alignment Mode
The alignment of graphics.
Parameters in the Threshold section
Parameter
Description
Threshold
The thresholds of numeric values.
If you set the Color Scheme parameter to Threshold and specify thresholds in the Threshold section, the background of the Sankey diagram is displayed in different colors based on the specified thresholds.
Parameters in the Variable Replacement section
Parameter
Description
Variable Replacement
The settings for variable replacement. You can click AddVariable Replacement to add a filter of the Variable Replacement type to the table. After you configure the settings for variable replacement on the General Configurations tab, Simple Log Service adds a filter in the upper-left corner of the table. You can select a value from the filter drop-down list. Then, Simple Log Service automatically replaces the variable in the query statement of the table with the variable value indicated by the value that you select, and performs a query and analysis operation. For more information, see Example 2: Configure variable replacement.
Parameters in the Documentation section
Parameter
Description
Add Documentation Link
The button that allows you to specify custom document links and descriptions. After you configure the settings, the specified information is displayed in the upper right corner of the Sankey diagram.
Configuration on the Field Configuration tab
You can configure personalized display settings for the results of a single query statement or for a single column of data in the results. For more information, see Configuration on the General Configurations tab.
For example, you can select A > source to configure settings for the source field in the results of Query Statement A. In the following figure, the Color Scheme parameter is set to Solid.
Configuration on the Interaction Occurrences tab
You can configure an interaction occurrence for the results of a single query statement or for a single column of data in the results to analyze data in a finer-grained manner. Supported types of interaction occurrences include Open Logstore, Open Saved Search, Open Dashboard, Open Trace Analysis, Open Trace Details, and Create Custom HTTP URL. For more information, see Interaction occurrences.
For example, in the A section, you can configure an Open Logstore interaction occurrence for the results of Query Statement A. After you configure the interaction occurrence, you can click a point in the Sankey diagram and click Open Logstore. Then, you are navigated to the Logstore that you specify.