Monitoring Pipeline Health
This lesson explains which signals show pipeline health, and how to handle flaky tests.
Learning outcomes
After completing this lesson, you will be able to:
- Identify signals of pipeline health.
- Use pipeline analytics reports.
- Describe Actions metrics.
- Explain how to detect and handle flaky tests.
Signals of pipeline health
A healthy pipeline is reliable, fast and trusted. Three signals describe this. The failure rate, or its opposite, the pass rate, shows how often runs succeed. Duration shows how long feedback takes. Flakiness shows whether results can be believed. Queue time is a useful fourth signal, as it reveals a shortage of capacity, which duration alone hides.
Failures should be classified, since the response depends on the cause. A failure caused by a code defect means that the pipeline is doing its job. A failure due to a flaky test, or a network problem, or an expired credential, is a defect in the pipeline itself.
The following diagram follows the investigation of a pipeline whose pass rate falls to 70%.

Is the pipeline doing its job?
Pipeline analytics in Azure Pipelines
Each pipeline has an Analytics tab with three reports. These reports default to the last 14 days, and they can be filtered by date range and branch.
- Pipeline pass rate shows a summary, a failure trend and the top failing tasks, each with the failed runs it caused. This shows where to begin.
- Pipeline duration shows how long runs take, and the trend over time. Comparing durations by step reveals the slowest ones.
- Test failures shows the top failing tests, and it links to test analytics.
Dashboards can present the same data through widgets, and the Analytics OData endpoint supports custom reports, for instance across all pipelines in a project.
Pipeline analytics reports
Actions metrics in GitHub
GitHub provides Actions metrics at organization and repository level. Usage metrics show the minutes that workflows and jobs consume. Performance metrics show run times, queue times and failure rates. Data can be broken down by workflow, job, repository, operating system and runner type. Access at organization level needs a suitable permission, and a custom organization role can include viewing Actions metrics.
Queue time deserves attention for self-hosted runners, because a long queue means that there are too few runners. The usage data shows which workflows consume the most minutes, and so where optimization pays off.
GitHub Actions metrics
Flaky tests
A flaky test gives different results with no change to the code or environment. Common causes include timing assumptions, shared test data, dependence on test order, and unreliable external services. Flaky tests cost time directly, and they also damage trust: once people expect random failures, they re-run instead of investigating, and a real regression can slip through.
Detection in Azure Pipelines
Azure Pipelines has built-in flaky test management, available in Azure DevOps Services and configured under Project settings > Test management. With system detection, a test that fails and then passes when re-run in the same execution is marked as flaky. This relies on the VSTest task's rerun capability, and it also applies when a failed job is rerun manually. A custom detection method can set the flag through an API.
Teams can choose how flaky tests affect a run. By default, they are used for troubleshooting only, but a project can exclude them from the Test Summary so they do not fail the pipeline. This setting buys time, and it is not a fix.
Handling flaky tests
-
Identify
Use analytics, or detection, to list tests with inconsistent results.
-
Quarantine
Stop the test from blocking, without deleting it, and create a work item.
-
Fix
Remove the cause, such as a fixed wait or shared state.
-
Restore
Return the test to the blocking suite.
Automatic retries of whole test suites should be used with caution, as they hide flakiness and hide intermittent product defects as well.
Detecting and handling flaky tests
Finding where to start
A pipeline's pass rate has dropped to 70% over two weeks, and the team does not know why. Which report should it look at first?
Open the Pipeline pass rate report and look at the top failing tasks. This shows whether failures cluster in one step, such as a deployment task or a test step. If a test step dominates, the Test failures report then identifies the tests. Rebuilding the agent image or raising the parallel job count assumes a cause before there is any evidence.
What does a long queue time show that duration does not?
Show answer
A shortage of capacity. Duration measures run time, and it excludes the wait for an agent or runner.
Exam Tips
Remember for the exam
- Watch failure rate, duration, flakiness and queue time.
- Pipeline pass rate shows the top failing tasks.
- Pipeline analytics defaults to the last 14 days.
- Actions metrics show usage minutes, and run time, queue time and failure rate.
- Quarantine a flaky test and fix it; do not just retry.