Courseiva
Monitor, troubleshoot, and optimize Azure solutionsmediumMultiple ChoiceObjective-mapped

AZ-204 Practice Question: Monitor, troubleshoot, and optimize Azure solutions

An Azure Function processes events from Event Hubs. You need to monitor the number of events that were successfully processed and those that were dropped due to processing errors. Which approach should you use?

⚠ Common exam trap

Many exam-takers confuse infrastructure-level metrics (Event Hubs metrics) with application-level custom metrics, assuming that monitoring the Event Hubs output automatically reflects function processing success, when in fact the function's own error handling must be instrumented separately.

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

Custom metrics in Application Insights.

Custom metrics in Application Insights allow you to track business-specific counters like successfully processed events and dropped events directly from your Azure Function code. By using the `TelemetryClient.TrackMetric()` API within the function's event processing logic, you can increment counters for success and failure scenarios, giving you precise, real-time monitoring of processing outcomes. This approach is more granular than built-in metrics because it reflects your application's custom error handling, not just infrastructure-level throughput.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Custom metrics in Application Insights.

    Why this is correct

    Custom metrics in Application Insights is the most appropriate solution because it allows developers to instrument their Azure Function code directly. By utilizing the Application Insights SDK, the function can explicitly send numerical data points, such as counts of successfully processed events or dropped events, to Application Insights. This provides real-time, granular visibility into the function's internal processing logic and operational health, enabling effective monitoring and alerting based on actual event outcomes.

  • Event Hubs metrics.

    Why it's wrong here

    Event Hubs metrics provide operational insights into the Event Hub service itself, such as message throughput, active connections, and throttled requests. While essential for monitoring the health and performance of the Event Hub, these metrics do not extend to the processing status within the consuming Azure Function. They cannot indicate whether an event was successfully consumed, processed, or failed after leaving the Event Hub, making them unsuitable for monitoring the function's internal event handling.

  • Stream Analytics job.

    Why it's wrong here

    An Azure Stream Analytics job is designed for real-time data processing and complex event pattern matching on streaming data. While it could theoretically process events from Event Hubs, introducing a Stream Analytics job solely for monitoring an Azure Function's event processing status is an unnecessary architectural overhead. The function's internal processing metrics can be captured more directly and efficiently using native Application Insights instrumentation without adding another costly and complex service to the data pipeline.

  • Log Analytics query on function logs.

    Why it's wrong here

    Log Analytics queries on function logs are unsuitable for directly monitoring *event counts* because they primarily analyse textual log data, not structured metrics. While you can count log entries, this approach lacks the native metric capabilities required for aggregate event processing statistics. It is tempting because Azure Functions integrate with Log Analytics for comprehensive logging. Log Analytics is ideal for detailed troubleshooting, investigating specific errors, and ad-hoc analysis of log patterns, providing granular insights into *why* events failed, rather than just their numerical totals.

About these practice questions

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.