Note
This documentation for Azure workbooks is now located at: https://learn.microsoft.com/en-us/azure/azure-monitor/visualize/workbooks-commonly-used-components#traffic-light-icons Please do not edit this file. All up-to-date information is in the new location and documentation should only be updated there.
It is often desirable to summarize status using a simpler domain instead presenting the full range of values. For example, you may want to categorize your computers by CPU utilization as Cold/Warm/Hot OR user by the performance experienced as Satisfied/Tolerating/Frustrated. This can be as simple as showing an indicator or icon which represents the status next to the underlying metric.
The example below shows how do setup a traffic light icon per computer based on the CPU utilization metric.
- Create a new empty workbook.
- Add a time range parameter called TimeRange
- Use the Add query link to add a log query control to the workbook.
- Select the query type as Log, resource type as Log Analytics and the resources as an Log Analytics workspace in your subscription that has VM performance data.
- Use the Query editor, enter:
Perf | where ObjectName == 'Processor' and CounterName == '% Processor Time' | summarize Cpu = percentile(CounterValue, 95) by Computer | join kind = inner (Perf | where ObjectName == 'Processor' and CounterName == '% Processor Time' | make-series Trend = percentile(CounterValue, 95) default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain} by Computer ) on Computer | project-away Computer1, TimeGenerated | order by Cpu desc
- Set the visualization to Grid
- Click on Column Settings
- In the Columns section:
- Cpu - Column renderer:
Thresholds
, Custom number formatting:checked
, Units:Percentage
, Threshold settings (last two need to be in order):- Icon:
Success
, Operator:Default
- Icon:
Critical
, Operator:>
, Value:80
- Icon:
Warning
, Operator:>
, Value:60
- Icon:
- Trend - Column renderer:
Spark line
, Color paletter:Green to Red
, Minimum value:60
, Maximum value:80
- Cpu - Column renderer:
- Click Save and Close to commit changes.
The grid looks like this in read-mode:
You can also pin this grid to a dashboard using the Pin to dashboard button in toolbar. Note that the pinned grid automatically binds to the time range in the dashboard.