Note
This documentation for Azure workbooks is now located at: https://learn.microsoft.com/en-us/azure/azure-monitor/visualize/workbooks-graph-visualizations Please do not edit this file. All up-to-date information is in the new location and documentation should only be updated there.
Workbooks supports visualizing arbitrary graphs based on data from logs to show the relationships between monitoring entities.
The graph below show data flowing in/out of a computer via various port to/from external computers. It is colored by type (computer vs. port vs. external i/p) and the edge sizes correspond to the amount of data flowing in-between. The underlying data comes from KQL query targeting VM connections.
- Switch the workbook to edit mode by clicking on the Edit toolbar item.
- Use the Add query link to add a log query control to the workbook.
- Select the query type as Log, resource type (e.g. Application Insights) and the resources to target.
- Use the Query editor to enter the KQL for your analysis
let data = dependencies | summarize Calls = count() by App = appName, Request = operation_Name, Dependency = name | extend RequestId = strcat(App, '::', Request); let links = data | summarize Calls = sum(Calls) by App, RequestId | project SourceId = App, TargetId = RequestId, Calls, Kind = 'App -> Request' | union (data | project SourceId = RequestId, TargetId = Dependency, Calls, Kind = 'Request -> Dependency'); let nodes = data | summarize Calls = sum(Calls) by App | project Id = App, Name = App, Calls, Kind = 'App' | union (data | summarize Calls = sum(Calls) by RequestId, Request | project Id = RequestId, Name = Request, Calls, Kind = 'Request') | union (data | summarize Calls = sum(Calls) by Dependency | project Id = Dependency, Name = Dependency, Calls, Kind = 'Dependency'); nodes | union (links)
- Set the visualization to Graph
- Click the Graph Settings button to open the settings pane
- In Layout Fields at the bottom, set:
- Node Id:
Id
- Source Id:
SourceId
- Target Id:
TargetId
- Edge Label:
None
- Edge Size:
Calls
- Node Size:
None
- Coloring Type:
Categorical
- Node Color Field:
Kind
- Color palette:
Pastel
- Node Id:
- In Node Format Settings at the top, set:
- Top Content- Use Column:
Name
, Column Renderer:Text
- Center Content- Use Column:
Calls
, Column Renderer:Big Number
, Color Palette:None
- Bottom Content- Use Column:
Kind
, Column Renderer:Text
- Top Content- Use Column:
- Click the Save and Close button at the bottom of the pane.
This is how the graph will look like in read mode:
Setting | Explanation |
---|---|
Node Id |
Selects a column that provides the unique id of nodes on the graph. Value of the column can be string or a number |
Source Id |
Selects a column that provides the ids of source nodes for edges on the graph. Values must map to a value in the Node Id column |
Target Id |
Selects a column that provides the ids of target nodes for edges on the graph. Values must map to a value in the Node Id column |
Initial Layout |
This field allows you to specify whether your initial layout should be Force Directed, Flow Horizontal or Flow Vertical |
View graph orientation toggle |
This checkbox allows you to specify whether you want the toggle for graph orientation visible to switch between Force Directed, Flow Horizontal and Flow Vertical |
Edge Label |
Selects a column that provides edge labels on the graph |
Edge Size |
Selects a column that provides the metric on which the edge widths will be based on |
Node Size |
Selects a column that provides the metric on which the node areas will be based on |
Coloring Type |
Used to choose the node coloring scheme |
Graph authors can specify the layout setting for the graph. The purpose of this setting is to allow graph authors to specify how their graph data is visualized. There are currently three layout settings: Force Directed
, Flow Horizontal
, Flow Vertical
. Force Directed
is the most generic layout where nodes are positioned in a way that allows for few crossing edges. Flow Horizontal
and Flow Vertical
feature allows authors to better visualize a hierarchical, directed relationship between each node.
Here is a sample graph in Flow Horizontal layout
Coloring Type | Explanation |
---|---|
None |
All nodes have the same color |
Categorical |
Nodes are assigned colors based on the value or category from a column in the result set. In the example above, the coloring is based on the column Kind of the result set. Supported palettes are Default , Pastel and Cool tone |
Heatmap |
In this type, color is based on the value of the node and selected color palette, with scale determined from the column values |
Thresholds |
In this type, node colors are set by threshold rules (e.g. CPU > 90% => Red, 60% > CPU > 90% => Yellow, CPU < 60% => Green). The value property in Thresholds can refer to columns and parameters. Refer to columns with ["columnName"] . Refer to parameters with {paramName} . Both column name and parameter name are case sensitive. |
Field Based |
In this type, a column provides specific RGB values to use for the node. Provides the most flexibility but usually requires more work to enable. |
Graph authors can specify what content goes to the different parts of a node - top, left, center, right and bottom. They are free to use any of renderers workbook supports (text, big number, spark lines, icon, etc.)
- Switch the workbook to edit mode by clicking on the Edit toolbar item.
- Use the Add query link to add a log query control to the workbook.
- Select the query type as Log, resource type (e.g. Application Insights) and the resources to target.
- Use the Query editor to enter the KQL for your analysis
let data = dependencies | summarize Calls = count() by App = appName, Request = operation_Name, Dependency = name | extend RequestId = strcat(App, '::', Request); let links = data | summarize Calls = sum(Calls) by App, RequestId | project SourceId = App, TargetId = RequestId, Calls, Kind = 'App -> Request' | union (data | project SourceId = RequestId, TargetId = Dependency, Calls, Kind = 'Request -> Dependency'); let nodes = data | summarize Calls = sum(Calls) by App | project Id = App, Name = App, Calls, Color = 'FD7F23' | union (data | summarize Calls = sum(Calls) by RequestId, Request | project Id = RequestId, Name = Request, Calls, Color = 'B3DE8E') | union (data | summarize Calls = sum(Calls) by Dependency | project Id = Dependency, Name = Dependency, Calls, Color = 'C9B3D5'); nodes | union (links)
- Set the visualization to Graph
- Click the Graph Settings button to open the settings pane
- In Layout Fields at the bottom, set:
- Node Id:
Id
- Source Id:
SourceId
- Target Id:
TargetId
- Edge Label:
None
- Edge Size:
Calls
- Node Size:
None
- Coloring Type:
Field Based
- Node Color Field:
Color
- Node Id:
- In Node Format Settings at the top, set:
- Top Content- Use Column:
Name
, Column Renderer:Text
- Center Content- Use Column:
Calls
, Column Renderer:Big Number
, Color Palette:None
- Bottom Content- Use Column:
Kind
, Column Renderer:Text
- Top Content- Use Column:
- Click the Save and Close button at the bottom of the pane.
Graphs also support Composite bar renderer. Refer Composite Bar for details