หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Azure Application Insights is billed based on the volume of telemetry data your application sends (data ingestion) and how long you want data to be available (data retention).
Learn more in Azure Monitor pricing.
Control data ingestion cost
To control data ingestion cost, you can:
- Use ingestion sampling to ingest only a percentage of the inbound data. Learn more in Ingestion sampling in Application Insights.
- Set a daily cap as a safeguard against unexpected ingestion spikes. Data collection stops when the cap is reached, and the cap can be exceeded.
- Set alerts on cost thresholds being exceeded to get notified when it happens.
- Use data collection rules (DCR) to filter the type of data you want.
- Use a custom endpoint. Learn more in Use a custom endpoint.
Find the ingestion sampling and daily cap settings under Usage and estimated costs in Azure Application Insights. Configure data collection rules on the linked Log Analytics workspace under Tables. Learn more in Set daily cap on Log Analytics workspace.
Data ingestion cost strategies
To control data ingestion cost, consider the following practice when setting up telemetry:
- Use sampling or data collection rules to adjust data ingestion.
- Set a daily cap as a safeguard against unexpected ingestion spikes.
- Set up an alert when the daily cap is reached so that you know data collection has stopped.
Important
A daily cap isn't a precise spending limit. Ingestion can exceed the cap, and the excess is billed. When the cap stops data collection, monitoring and telemetry-based alerts can miss events.
Learn more in Cost optimization in Azure Monitor and Set daily cap on Log Analytics workspace.
Video guidance
The following video shows how to enable cost control strategies for telemetry.
Calculating the cost of data ingestion
Azure Monitor pricing depends on your region, pricing tier, and subscription. Check the current ingestion allowance and price for your linked Log Analytics workspace in Azure Monitor pricing.
One telemetry event typically consumes 2-10 KB depending on the type of event. The maximum size for one event is 64 KB.
For example, 160 MB of data corresponds to approximately 16,000 events at 10 KB per event. Actual billable volume depends on the data stored, not just the size of the transmitted event.
At 10 KB per event, 1 GB corresponds to approximately 100,000 events. Multiply the billable volume by your regional ingestion price to estimate cost. Learn more in Azure Monitor Logs cost calculations and options.
Typically, non-interactive sessions such as web service calls or background sessions are the ones that can generate a lot of data. These are the ones you could consider filtering away to reduce cost.
Examples of cost of data ingestion
One partner that uses telemetry a lot reported that they on average spend 7.3 USD per customer per month on data ingestion. For their large customers they spend up to 178 USD per month (without setting up data collection rules, sampling, or daily cap).
Their top 10 customer cost per month on telemetry is:
| Rank | Monthly Cost (in USD) |
|---|---|
| 1 | 178.68 |
| 2 | 173.68 |
| 3 | 146.03 |
| 4 | 106.32 |
| 5 | 66.47 |
| 6 | 31.91 |
| 7 | 27.06 |
| 8 | 23.53 |
| 9 | 22.79 |
| 10 | 17.65 |
Note
These numbers can vary and should only be taken as guidance. You need to measure your own telemetry cost based on data ingestion volume.
Distribution of telemetry data
The easiest way to see the data distribution of different event IDs in your Azure Application Insights resource is to use the Data in Telemetry page on the Administration report in the Power BI app on telemetry data.
You can also run the KQL queries below.
// 30 day overview of event ingestion in your Application Insights resource
let lookback = 30d ;
let traces_stats =
traces
| where timestamp > ago(lookback)
| extend eventId = tostring( customDimensions.eventId )
| summarize count() by eventId
| extend table_name = 'traces'
| project eventId, table_name, count_
;
let pageview_stats =
pageViews
| where timestamp > ago(lookback)
| extend eventId = tostring( customDimensions.eventID )
| summarize count() by eventId
| extend table_name = 'pageViews'
| project eventId, table_name, count_
;
traces_stats
| union pageview_stats
| order by count_ desc
| project eventId, table_name, event_count=count_
| order by event_count desc
Similarly, you can see the data distribution of different environments in your Azure Application Insights resource, by running the KQL queries below.
// 30 day overview of data ingestion by environment in your Application Insights resource
let lookback = 30d ;
union traces, pageViews
| where timestamp > ago(lookback)
| extend aadTenantId = tostring( customDimensions.aadTenantId )
, environmentName = tostring( customDimensions.environmentName )
| summarize count() by aadTenantId, environmentName
| project aadTenantId, environmentName, count_
| order by aadTenantId, environmentName
Use data collection rules (DCR)
Azure Log Analytics (the backend of Azure Application Insights) has a feature called Data Collection Rules (DCR). DCRs allow you to define rules on what is ingested into your telemetry resource. Use them to filter away unneeded telemetry data, which speeds up query performance and saves cost.
To use DCRs, use the Log Analytics workspace linked to your workspace-based Azure Application Insights resource. Classic Application Insights resources are retired. Learn more in Create and configure Application Insights resources.
DCRs are defined on your workspace. Business Central currently logs to two tables: AppTraces and AppPageViews. These tables are the workspace tables for traces and pageViews that you normally use in Application Insights KQL queries. Add a transformation to the workspace transformation DCR to filter data before ingestion. Learn more in Create a transformation in Azure Monitor.
To help you get started with setting up Data Collection Rules, we've added many sample KQL queries that illustrate common filter scenarios:
- How to filter out one or more events (I don't need these events, no need to pay for them)
- How to only filter part of an event (I only want to see events when something fails or I only want 10 percent of these events)
- How to filter on Microsoft Entra tenant (I'm an ISV and I want to start slowly on telemetry, so only enabling it for a few customers)
- How to filter on environment type (I'm an ISV and I only want data from production environments)
- How to filter on app dimensions (I'm a VAR and this app/publisher is too noisy)
Learn more in Data Collection Rule KQL samples.
Use a custom endpoint
Azure Application Insights supports overriding the standard data ingestion endpoint provided in the connection string (available in the Azure Application Insights portal). This capability means you can send telemetry data to your own component to do post-processing. For example, you could filter or enrich before ingesting data into your data source of choice. The data source can be an Azure SQL database, a data lake, Azure Log Analytics, Azure Application Insights, or a third-party data store.
You can override the ingestion endpoint by using the IngestionEndpoint key in the Azure Application Insights connection string. The custom endpoint must accept the Application Insights ingestion protocol and forward or transform the data. A connection string can't send telemetry directly to an arbitrary database. Learn more in Connection strings in Application Insights.
Reduce data retention cost
To reduce data retention cost, configure retention on the Log Analytics workspace and its tables. Keep analytics retention within your included allowance unless you need longer access. Use lower-cost long-term retention when you can use search jobs instead of interactive queries.
Purging data is intended for privacy requirements, not routine cost control. Learn more in Manage data retention in a Log Analytics workspace and Manage personal data in Azure Monitor Logs.
Related information
Telemetry overview
Enabling telemetry
Available telemetry
Telemetry FAQ