Skip to content

Commit ea1fe37

Browse files
authored
Merge pull request #114521 from bwren/am-cost-storage
Azure Monitor cost storage update
2 parents 7c9a714 + 90ef818 commit ea1fe37

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

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

Lines changed: 34 additions & 15 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: 05/04/2020
14+
ms.date: 05/07/2020
1515
ms.author: bwren
1616
ms.subservice:
1717
---
@@ -67,10 +67,10 @@ Log Analytics charges are added to your Azure bill. You can see details of your
6767

6868
## Viewing Log Analytics usage on your Azure bill
6969

70-
Azure provides a great deal of useful functionality in the [Azure Cost Management + Billing](https://docs.microsoft.com/azure/cost-management/quick-acm-cost-analysis?toc=/azure/billing/TOC.json) hub. For instance, the "Cost analysis" functionality enables you to view your spends for Azure resources. Adding a filter by resource type (to microsoft.operationalinsights/workspace for Log Analytics) will allow you to track your spend.
70+
Azure provides a great deal of useful functionality in the [Azure Cost Management + Billing](https://docs.microsoft.com/azure/cost-management/quick-acm-cost-analysis?toc=/azure/billing/TOC.json) hub. For instance, the "Cost analysis" functionality enables you to view your spends for Azure resources. First, add a filter by "Resource type" (to microsoft.operationalinsights/workspace for Log Analytics and microsoft.operationalinsights/workspace for Log Analytics Clusters) will allow you to track your Log Analytics spend. Then for "Group by" select "Meter category" or "Meter". Note that other services such as Azure Security Center and Azure Sentinel also bill their usage against Log Analytics workspace resources. To see the mapping to Service name, you can select the Table view instead of a chart.
7171

7272
More understanding of your usage can be gained by [downloading your usage from the Azure portal](https://docs.microsoft.com/azure/billing/billing-download-azure-invoice-daily-usage-date#download-usage-in-azure-portal).
73-
In the downloaded spreadsheet you can see usage per Azure resource (e.g. Log Analytics workspace) per day. In this Excel spreadsheet, usage from your Log Analytics workspaces can be found by first filtering on the "Meter Category" column to show "Insights and Analytics" (used by some of the legacy pricing tiers) and "Log Analytics", and then adding a filter on the "Instance ID" column which is "contains workspace". The usage is shown in the "Consumed Quantity" column and the unit for each entry is shown in the "Unit of Measure" column. More details are available to help you [understand your Microsoft Azure bill](https://docs.microsoft.com/azure/billing/billing-understand-your-bill).
73+
In the downloaded spreadsheet you can see usage per Azure resource (e.g. Log Analytics workspace) per day. In this Excel spreadsheet, usage from your Log Analytics workspaces can be found by first filtering on the "Meter Category" column to show "Log Analytics", "Insights and Analytics" (used by some of the legacy pricing tiers) and "Azure Monitor" (used by Capacity Reservation pricing tiers), and then adding a filter on the "Instance ID" column which is "contains workspace" or "contains cluster" (the latter to include Log Analytics Cluster usage). The usage is shown in the "Consumed Quantity" column and the unit for each entry is shown in the "Unit of Measure" column. More details are available to help you [understand your Microsoft Azure bill](https://docs.microsoft.com/azure/billing/billing-understand-your-bill).
7474

7575
## Changing pricing tier
7676

@@ -104,7 +104,7 @@ More details of pricing tier limitations are available [here](https://docs.micro
104104
105105
## Change the data retention period
106106

107-
The following steps describe how to configure how long log data is kept by in your workspace. Data retention can be configured from 30 to 730 days (2 years) for all workspaces unless they are using the legacy Free pricing tier.
107+
The following steps describe how to configure how long log data is kept by in your workspace. Data retention can be configured from 30 to 730 days (2 years) for all workspaces unless they are using the legacy Free pricing tier.[Learn more](https://azure.microsoft.com/pricing/details/monitor/) about pricing for longer data retention.
108108

109109
### Default retention
110110

@@ -249,7 +249,7 @@ union withsource = tt *
249249
```
250250

251251
> [!TIP]
252-
> Use these `union withsource = tt *` queries sparingly as scans across data types are [resource intensive](https://docs.microsoft.com/azure/azure-monitor/log-query/query-optimization#query-performance-pane) to execute. This query replaces the old way of querying per-computer information with the Usage data type.
252+
> Use these `union *` queries sparingly as scans across data types are [resource intensive](https://docs.microsoft.com/azure/azure-monitor/log-query/query-optimization#query-performance-pane) to execute. If you do not need results **per computer** then query on the Usage data type (see below).
253253
254254
## Understanding ingested data volume
255255

@@ -318,7 +318,7 @@ union withsource = tt *
318318
| summarize BillableDataBytes = sum(_BilledSize) by computerName | sort by Bytes nulls last
319319
```
320320

321-
The `_IsBillable` [property](log-standard-properties.md#_isbillable) specifies whether the ingested data will incur charges.
321+
The `_IsBillable` [property](log-standard-properties.md#_isbillable) specifies whether the ingested data will incur charges.
322322

323323
To see the **count** of billable events ingested per computer, use
324324

@@ -330,6 +330,10 @@ union withsource = tt *
330330
| summarize eventCount = count() by computerName | sort by eventCount nulls last
331331
```
332332

333+
> [!TIP]
334+
> Use these `union *` queries sparingly as scans across data types are [resource intensive](https://docs.microsoft.com/azure/azure-monitor/log-query/query-optimization#query-performance-pane) to execute. If you do not need results **per computer** then query on the Usage data type.
335+
336+
333337
### Data volume by Azure resource, resource group, or subscription
334338

335339
For data from nodes hosted in Azure you can get the **size** of ingested data __per computer__, use the _ResourceId [property](log-standard-properties.md#_resourceid), which provides the full path to the resource:
@@ -354,6 +358,9 @@ union withsource = tt *
354358

355359
Changing `subscriptionId` to `resourceGroup` will show the billable ingested data volume by Azure resource group.
356360

361+
> [!TIP]
362+
> Use these `union *` queries sparingly as scans across data types are [resource intensive](https://docs.microsoft.com/azure/azure-monitor/log-query/query-optimization#query-performance-pane) to execute. If you do not need results per subscription, resouce group or resource name, then query on the Usage data type.
363+
357364
> [!WARNING]
358365
> Some of the fields of the Usage data type, while still in the schema, have been deprecated and will their values are no longer populated.
359366
> These are **Computer** as well as fields related to ingestion (**TotalBatches**, **BatchesWithinSla**, **BatchesOutsideSla**, **BatchesCapped** and **AverageProcessingTimeMs**.
@@ -453,33 +460,42 @@ To see the number of distinct Automation nodes, use the query:
453460

454461
The decision of whether workspaces with access to the legacy **Per Node** pricing tier are better off in that tier or in a current **Pay-As-You-Go** or **Capacity Reservation** tier is often difficult for customers to assess. This involves understanding the trade-off between the fixed cost per monitored node in the Per Node pricing tier and its included data allocation of 500 MB/node/day and the cost of just paying for ingested data in the Pay-As-You-Go (Per GB) tier.
455462

456-
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.
463+
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
464+
465+
1. whether the workspace is using Azure Security Center by setting `workspaceHasSecurityCenter` to `true` or `false`,
466+
2. update the prices if you have specific discounts, and
467+
3. specify the number of days to look back and analyze by setting `daysToEvaluate`. This is useful if the query is taking too long trying to look at 7 days of data.
468+
469+
Here is the pricing tier recommendation query:
457470

458471
```kusto
459472
// Set these parameters before running query
460473
let workspaceHasSecurityCenter = true; // Specify if the workspace has Azure Security Center
461474
let PerNodePrice = 15.; // Enter your montly price per monitored nodes
462-
let PerGBPrice = 2.30; // Enter your price per GB
475+
let PerNodeOveragePrice = 2.30; // Enter your price per GB for data overage in the Per Node pricing tier
476+
let PerGBPrice = 2.30; // Enter your price per GB in the Pay-as-you-go pricing tier
477+
let daysToEvaluate = 7; // Enter number of previous days look at (reduce if the query is taking too long)
463478
// ---------------------------------------
464479
let SecurityDataTypes=dynamic(["SecurityAlert", "SecurityBaseline", "SecurityBaselineSummary", "SecurityDetection", "SecurityEvent", "WindowsFirewall", "MaliciousIPCommunication", "LinuxAuditLog", "SysmonEvent", "ProtectionStatus", "WindowsEvent", "Update", "UpdateSummary"]);
480+
let StartDate = startofday(datetime_add("Day",-1*daysToEvaluate,now()));
481+
let EndDate = startofday(now());
465482
union withsource = tt *
466-
| where TimeGenerated >= startofday(now(-7d)) and TimeGenerated < startofday(now())
483+
| where TimeGenerated >= StartDate and TimeGenerated < EndDate
467484
| extend computerName = tolower(tostring(split(Computer, '.')[0]))
468485
| where computerName != ""
469486
| summarize nodesPerHour = dcount(computerName) by bin(TimeGenerated, 1h)
470487
| summarize nodesPerDay = sum(nodesPerHour)/24. by day=bin(TimeGenerated, 1d)
471488
| join kind=leftouter (
472489
Heartbeat
473-
| where TimeGenerated >= startofday(now(-7d)) and TimeGenerated < startofday(now())
490+
| where TimeGenerated >= StartDate and TimeGenerated < EndDate
474491
| where Computer != ""
475492
| summarize ASCnodesPerHour = dcount(Computer) by bin(TimeGenerated, 1h)
476493
| extend ASCnodesPerHour = iff(workspaceHasSecurityCenter, ASCnodesPerHour, 0)
477494
| summarize ASCnodesPerDay = sum(ASCnodesPerHour)/24. by day=bin(TimeGenerated, 1d)
478495
) on day
479496
| join (
480497
Usage
481-
| where TimeGenerated > ago(8d)
482-
| where StartTime >= startofday(now(-7d)) and EndTime < startofday(now())
498+
| where TimeGenerated >= StartDate and TimeGenerated < EndDate
483499
| where IsBillable == true
484500
| extend NonSecurityData = iff(DataType !in (SecurityDataTypes), Quantity, 0.)
485501
| extend SecurityData = iff(DataType in (SecurityDataTypes), Quantity, 0.)
@@ -492,16 +508,19 @@ union withsource = tt *
492508
| extend OverageGB = iff(workspaceHasSecurityCenter,
493509
max_of(DataGB - 0.5*nodesPerDay - 0.5*ASCnodesPerDay, 0.),
494510
max_of(DataGB - 0.5*nodesPerDay, 0.))
495-
| extend PerNodeDailyCost = nodesPerDay * PerNodePrice / 31. + OverageGB * PerGBPrice
511+
| extend PerNodeDailyCost = nodesPerDay * PerNodePrice / 31. + OverageGB * PerNodeOveragePrice
496512
| extend Recommendation = iff(PerNodeDailyCost < PerGBDailyCost, "Per Node tier",
497513
iff(NonSecurityDataGB > 85., "Capacity Reservation tier", "Pay-as-you-go (Per GB) tier"))
498514
| project day, nodesPerDay, ASCnodesPerDay, NonSecurityDataGB, SecurityDataGB, OverageGB, AvgGbPerNode, PerGBDailyCost, PerNodeDailyCost, Recommendation | sort by day asc
499-
| project day, Recommendation // Comment this line to see details
515+
//| project day, Recommendation // Comment this line to see details
500516
| sort by day asc
501517
```
502518

503519
This query is not an exact replication of how usage is calculated, but will work for providing pricing tier recommendations in most cases.
504520

521+
> [!NOTE]
522+
> To use the entitlements that come from purchasing OMS E1 Suite, OMS E2 Suite or OMS Add-On for System Center, choose the Log Analytics *Per Node* pricing tier.
523+
505524
## Create an alert when data collection is high
506525

507526
This section describes how to create an alert if:
@@ -599,4 +618,4 @@ There are some additional Log Analytics limits, some of which depend on the Log
599618
- To configure an effective event collection policy, review [Azure Security Center filtering policy](../../security-center/security-center-enable-data-collection.md).
600619
- Change [performance counter configuration](data-sources-performance-counters.md).
601620
- To modify your event collection settings, review [event log configuration](data-sources-windows-events.md).
602-
- To modify your syslog collection settings, review [syslog configuration](data-sources-syslog.md).
621+
- To modify your syslog collection settings, review [syslog configuration](data-sources-syslog.md).

0 commit comments

Comments
 (0)