Skip to content

Commit 298de58

Browse files
authored
Merge pull request #112004 from bwren/am-cost-manage
Azure Monitor manage cost storage update
2 parents 73d2722 + 40a2647 commit 298de58

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

articles/azure-monitor/platform/manage-cost-storage.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.service: azure-monitor
1111
ms.workload: na
1212
ms.tgt_pltfrm: na
1313
ms.topic: conceptual
14-
ms.date: 04/08/2020
14+
ms.date: 04/20/2020
1515
ms.author: bwren
1616
ms.subservice:
1717
---
@@ -33,8 +33,7 @@ The default pricing for Log Analytics is a **Pay-As-You-Go** model based on data
3333
- Number of VMs monitored
3434
- Type of data collected from each monitored VM
3535

36-
In addition to the Pay-As-You-Go model, Log Analytics has **Capacity Reservation** tiers which enable you to save as much as 25% compared to the Pay-As-You-Go price. The capacity reservation pricing enables you to buy a reservation starting at 100 GB/day. Any usage above the reservation level will be billed at the Pay-As-You-Go rate. The Capacity Reservation tiers have a 31-day commitment period. During the commitment period, you can change to a higher level Capacity Reservation tier (which will restart the 31-day commitment period), but you cannot move back to Pay-As-You-Go or to a lower Capacity Reservation tier until after the commitment period is finished.
37-
[Learn more](https://azure.microsoft.com/pricing/details/monitor/) about Log Analytics Pay-As-You-Go and Capacity Reservation pricing.
36+
In addition to the Pay-As-You-Go model, Log Analytics has **Capacity Reservation** tiers which enable you to save as much as 25% compared to the Pay-As-You-Go price. The capacity reservation pricing enables you to buy a reservation starting at 100 GB/day. Any usage above the reservation level will be billed at the Pay-As-You-Go rate. The Capacity Reservation tiers have a 31-day commitment period. During the commitment period, you can change to a higher level Capacity Reservation tier (which will restart the 31-day commitment period), but you cannot move back to Pay-As-You-Go or to a lower Capacity Reservation tier until after the commitment period is finished. Billing for the Capacity Reservation tiers is done on a daily basis. [Learn more](https://azure.microsoft.com/pricing/details/monitor/) about Log Analytics Pay-As-You-Go and Capacity Reservation pricing.
3837

3938
In all pricing tiers, the data volume is calculated from a string representation of the data as it is prepared to be stored. Several [properties common to all data types](https://docs.microsoft.com/azure/azure-monitor/platform/log-standard-properties) are not included in the calculation of the event size, including `_ResourceId`, `_ItemId`, `_IsBillable` and `_BilledSize`.
4039

@@ -109,11 +108,15 @@ To set the default retention for your workspace,
109108
3. On the pane, move the slider to increase or decrease the number of days and then click **OK**. If you are on the *free* tier, you will not be able to modify the data retention period and you need to upgrade to the paid tier in order to control this setting.
110109

111110
![Change workspace data retention setting](media/manage-cost-storage/manage-cost-change-retention-01.png)
111+
112+
When the retention is lowered, there is a several day grace period before the oldest data is removed.
112113

113114
The retention can also be [set via Azure Resource Manager](https://docs.microsoft.com/azure/azure-monitor/platform/template-workspace-configuration#configure-a-log-analytics-workspace) using the `retentionInDays` parameter. Additionally, if you set the data retention to 30 days, you can trigger an immediate purge of older data using the `immediatePurgeDataOn30Days` parameter, which may be useful for compliance-related scenarios. This functionality is only exposed via Azure Resource Manager.
114115

115116
Two data types -- `Usage` and `AzureActivity` -- are retained for 90 days by default, and there is no charge for for this 90 day retention. These data types are also free from data ingestion charges.
116117

118+
119+
117120
### Retention by data type
118121

119122
It is also possible to specify different retention settings for individual data types from 30 to 730 days (except for workspaces in the legacy Free pricing tier). Each data type is a sub-resource of the workspace. For instance the SecurityEvent table can be addressed in [Azure Resource Manager](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-overview) as:
@@ -446,7 +449,7 @@ The decision of whether workspaces with access to the legacy **Per Node** pricin
446449
To facilitate this assessment, the following query can be used to make a recommendation for the optimal pricing tier based on a workspace's usage patterns. This query looks at the monitored nodes and data ingested into a workspace in the last 7 days, and for each day evaluates which pricing tier would have been optimal. To use the query, you need to specify whether the workspace is using Azure Security Center by setting `workspaceHasSecurityCenter` to `true` or `false`, and then (optionally) updating the Per Node and Per GB prices that your organizaiton receives.
447450

448451
```kusto
449-
// Set these paramaters before running query
452+
// Set these parameters before running query
450453
let workspaceHasSecurityCenter = true; // Specify if the workspace has Azure Security Center
451454
let PerNodePrice = 15.; // Enter your price per node / month
452455
let PerGBPrice = 2.30; // Enter your price per GB
@@ -458,6 +461,14 @@ union withsource = tt *
458461
| where computerName != ""
459462
| summarize nodesPerHour = dcount(computerName) by bin(TimeGenerated, 1h)
460463
| summarize nodesPerDay = sum(nodesPerHour)/24. by day=bin(TimeGenerated, 1d)
464+
| join (
465+
Heartbeat
466+
| where TimeGenerated >= startofday(now(-7d)) and TimeGenerated < startofday(now())
467+
| where Computer != ""
468+
| summarize ASCnodesPerHour = dcount(Computer) by bin(TimeGenerated, 1h)
469+
| extend ASCnodesPerHour = iff(workspaceHasSecurityCenter, ASCnodesPerHour, 0)
470+
| summarize ASCnodesPerDay = sum(ASCnodesPerHour)/24. by day=bin(TimeGenerated, 1d)
471+
) on day
461472
| join (
462473
Usage
463474
| where TimeGenerated > ago(8d)
@@ -469,19 +480,21 @@ union withsource = tt *
469480
) on day
470481
| extend AvgGbPerNode = NonSecurityDataGB / nodesPerDay
471482
| extend PerGBDailyCost = iff(workspaceHasSecurityCenter,
472-
(NonSecurityDataGB + max_of(SecurityDataGB - 0.5*nodesPerDay, 0.)) * PerGBPrice,
483+
(NonSecurityDataGB + max_of(SecurityDataGB - 0.5*ASCnodesPerDay, 0.)) * PerGBPrice,
473484
DataGB * PerGBPrice)
474485
| extend OverageGB = iff(workspaceHasSecurityCenter,
475-
max_of(DataGB - 1.0*nodesPerDay, 0.),
486+
max_of(DataGB - 0.5*nodesPerDay - 0.5*ASCnodesPerDay, 0.),
476487
max_of(DataGB - 0.5*nodesPerDay, 0.))
477488
| extend PerNodeDailyCost = nodesPerDay * PerNodePrice / 31. + OverageGB * PerGBPrice
478489
| extend Recommendation = iff(PerNodeDailyCost < PerGBDailyCost, "Per Node tier",
479490
iff(NonSecurityDataGB > 85., "Capacity Reservation tier", "Pay-as-you-go (Per GB) tier"))
480-
| project day, nodesPerDay, NonSecurityDataGB, SecurityDataGB, OverageGB, AvgGbPerNode, PerGBDailyCost, PerNodeDailyCost, Recommendation | sort by day asc
491+
| project day, nodesPerDay, ASCnodesPerDay, NonSecurityDataGB, SecurityDataGB, OverageGB, AvgGbPerNode, PerGBDailyCost, PerNodeDailyCost, Recommendation | sort by day asc
481492
| project day, Recommendation // Comment this line to see details
482493
| sort by day asc
483494
```
484495

496+
This query is not an exact replication of how usage is calculated, but will work for providing pricing tier recommendations in most cases.
497+
485498
## Create an alert when data collection is high
486499

487500
This section describes how to create an alert if:

0 commit comments

Comments
 (0)