Save cost on your telemetry

Save cost on your telemetry

As you maybe know is that you can get allot of telemetry from Business Central into your Applications Insights. And maybe you don’t need all the data in there.
Because you pay Application Insights by data ingestion it doesn’t help if you prune your data. The data is still getting in.

This week Kennie Nybo Pontoppidan | LinkedIn twittered that you now can have control about the data that is ingest in Application Insights via “Data Collection Rules” (Data Collection Rules in Azure Monitor – Azure Monitor | Microsoft Docs).
So this will save you costs!

But how do you set it up?

Well first your Application Insights must be converted to a Workspace-based Application Insights. If you don’t have that you can easily convert it.

If you go to your workspace you can find “Tables (preview)” on the left side:

Then all the tables are shown.
Business Central uses two tables. AppTraces and AppPageViews:

Click with the right button in the table and go to “Edit transformation”:

Here you can define a new or an excisting “Data collection Rule”:

In the tab “Schema and transformation” you see all your entries as an example. With the button “Transformation Editor” you can build a KQL query to exclude some events or anything else just like this:

source
| where Properties.eventId <> "RT0006"
and Properties.eventId <> "RT0007"

or 

source
| where tostring(Properties.eventId) !in~("RT0006","RT0007")

Run your query an click on Apply and Next.
Now you are done and you never get those events anymore 😊.

Other

If you want to know which eventId’s you have got in your telemetry just run this query:

traces
| where timestamp > ago(30d)
| extend eventId = tostring( customDimensions.eventId )
| extend signalIdentifier = case(
  eventId <> "", eventId,
  operation_Name <> "", operation_Name, 
  "Unknown signal type"
) 
| distinct signalIdentifier
| order by signalIdentifier asc

If you want to store your Application Insights data after the default retention period you can read this blog:
Two ways of exporting BC telemetry – Discover Microsoft Business Central (bertverbeek.nl)

Leave a Reply

Your email address will not be published.