AZ-204 Practice Question: Monitor, troubleshoot, and optimize Azure solutions
You need to emit a custom metric in Application Insights that tracks the number of page views per browser. You expect high volume (millions of events per day). Which API should you use to ensure efficient pre-aggregation and avoid performance issues?
⚠ Common exam trap
A common mix-up: candidates confuse TrackEvent (for custom events) with metric tracking, or assume TrackMetric is the correct choice because of its name, not realizing it is deprecated and lacks client-side pre-aggregation.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
GetMetric
C is correct because the GetMetric API (previously known as Pre-Aggregated Metric API) is designed for high-volume telemetry scenarios. It pre-aggregates metrics on the client side before sending them to Application Insights, significantly reducing network traffic and storage costs while avoiding performance bottlenecks from millions of individual events.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
TrackEvent
Why it's wrong here
TrackEvent is designed for discrete occurrences, like user clicks or specific actions, where each instance is unique and valuable for individual analysis. However, for high-volume, repetitive metrics (e.g., page views per second), sending each as a separate TrackEvent creates excessive telemetry, leading to prohibitive ingestion costs and potential data sampling or throttling by Application Insights, making it unsuitable for aggregated metric tracking.
- ✗
TrackMetric
Why it's wrong here
TrackMetric allows sending a single metric value at a specific point in time, optionally with a count, sum, and standard deviation. While it supports basic metric reporting, it lacks native support for multiple custom dimensions, which are crucial for segmenting and analyzing metrics by attributes like browser type, region, or user ID. Furthermore, it doesn't perform client-side pre-aggregation, sending each data point individually, which can be inefficient for high-frequency metrics.
- ✓
GetMetric
Why this is correct
GetMetric (specifically, GetMetric().TrackValue()) is the recommended approach for high-volume custom metrics that require multiple dimensions. It provides an in-memory metric object that intelligently aggregates data points client-side over a configurable interval (typically 1 minute) before sending a single, summarized data point to Application Insights. This client-side pre-aggregation significantly reduces telemetry volume, optimizes ingestion costs, and supports rich dimensional analysis without incurring high overhead.
- ✗
TrackDependency
Why it's wrong here
TrackDependency is specifically designed to monitor calls to external components, such as databases, HTTP services, or message queues, capturing their duration, success/failure, and target. Its purpose is to provide insights into the performance and availability of application dependencies. It is entirely inappropriate for emitting general custom metrics like page views or business-specific counters, as it would misrepresent the data's nature and pollute dependency monitoring telemetry.
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.