Sankey diagram, a specific type of flow chart, is used to describe the flow from one set of values to another, and is applicable to scenarios such as network flow data. Generally, the Sankey diagram contains three sets of values:
target describes the edge relationship between nodes, and
value describes the relationship between
The Sankey diagram has the following features:
The start flow is the same as the end flow. The overall width of all the main branches is the same as that of all the branches. Therefore, the energy balance is maintained.
Internally, different lines indicate the distribution of different flows, and the line width indicates the flow occupied by the branch proportionally.
Different node widths indicate the flows in the particular statuses.
For example, the following data can be displayed in a Sankey diagram.
The Sankey diagram visualizes the preceding data as follows.
|Start column||Describes the start node.|
|End column||Describes the end node.|
|Numeric column||The value that links the start node and the end node.|
|Padding||The distance between the coordinate axis and the graph boundary.|
On the query page, enter the query statement in the search box, select the time interval, and click Search.
Click the Graph tab and select the Sankey diagram .
Configure the graph properties.
If the log field contains
value, each log itself is the relationship between nodes and edges, and the sum of
streamValue can be obtained using Nested subquery.
* | select sourceValue, targetValue, sum(streamValue) as streamValue from (select sourceValue, targetValue, streamValue, __time__ from log group by sourceValue, targetValue, streamValue, __time__ order by __time__ desc) group by sourceValue, targetValue
Log Service supports Access logs of Layer-7 Server Load Balancer, so you can use access logs to build a Sankey diagram.
* | 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))