Designing and Implementing Microsoft DevOps Solutions - Exam AZ-400

Capture Telemetry Data in ASP.NET Core Application

Question

You are building an ASP.NET Core application.

You plan to create an application utilization baseline by capturing telemetry data.

You need to add code to the application to capture the telemetry data. The solution must minimize the costs of storing the telemetry data.

Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

BD

Sampling is a feature in Azure Application Insights. It is the recommended way to reduce telemetry traffic, data costs, and storage costs, while preserving a statistically correct analysis of application data.

The Application Insights SDK for ASP.NET Core supports both fixed-rate and adaptive sampling. Adaptive sampling is enabled by default.

D: For adaptive sampling: The volume is adjusted automatically to keep within a specified maximum rate of traffic, and is controlled via the setting

MaxTelemetryItemsPerSecond. If the application produces a low amount of telemetry, such as when debugging or due to low usage, items won't be dropped by the sampling processor as long as volume is below MaxTelemetryItemsPerSecond.

Note: In ApplicationInsights.config, you can adjust several parameters in the AdaptiveSamplingTelemetryProcessor node. The figures shown are the default values:

<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>

https://docs.microsoft.com/en-us/azure/azure-monitor/app/sampling

To capture telemetry data from an ASP.NET Core application, you can use Azure Application Insights. To minimize the costs of storing the telemetry data, you should enable sampling, which will only send a subset of the telemetry data to the Application Insights service. This can be done in several ways, such as enabling adaptive sampling or configuring a sampling percentage.

Option A: Add the <InitialSamplingPercentage>99</InitialSamplingPercentage> parameter to the ApplicationInsights.config file.

This option enables fixed-rate sampling, which sends a fixed percentage of telemetry data to the Application Insights service. The <InitialSamplingPercentage>99</InitialSamplingPercentage> parameter specifies that 99% of the telemetry data should be sampled. This may not be the most cost-effective option if the application generates a large amount of telemetry data, as the cost of storing the data may still be high.

Option B: From the code of the application, enable adaptive sampling.

Adaptive sampling dynamically adjusts the sampling rate based on the volume of telemetry data generated by the application. It uses an algorithm to calculate the optimal sampling rate based on the number of telemetry items and the application's workload. This can be a more cost-effective option as it adjusts the sampling rate based on the application's workload, reducing the amount of telemetry data sent to the Application Insights service.

Option C: From the code of the application, add Azure Application Insights telemetry.

This option does not address the requirement to minimize the costs of storing the telemetry data. It only adds the telemetry data to the Application Insights service, without implementing any sampling or other cost-reducing measures.

Option D: Add the <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond> parameter to the ApplicationInsights.config file.

This option limits the maximum number of telemetry items sent to the Application Insights service per second. The <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond> parameter specifies that no more than 5 telemetry items per second should be sent. This can be a cost-effective option if the application generates a relatively small amount of telemetry data.

Option E: From the code of the application, disable adaptive sampling.

This option would not be recommended, as disabling sampling would result in all telemetry data being sent to the Application Insights service, increasing the cost of storing the data.