How it works
PR deploy lead time measures the elapsed time between when a pull request is merged and when its change is first confirmed in production. The clock includes time waiting in a deployment queue, release window, or batch; it does not start when a workflow begins. This metric is also known as “deployment lead time” and is one of the four key DORA metrics. Lower lead times indicate:- Fast CI/CD pipelines
- Automated deployment processes
- Minimal manual release processes
- Continuous deployment practices
Calculation
The metric measures the elapsed time from PR merge to production deployment. Formula:How deployments are linked to PRs
Weave connects PRs to deployments by:- Commit tracking: Identifying the commit each deployment run deployed (or, for verified batch releases, the full deployed commit range)
- PR mapping: Linking commits back to their source PRs
- Time calculation: Measuring the time from PR merge to deployment completion
Multiple PRs in one deployment
When a deployment includes multiple PRs:- Each PR’s individual deploy lead time is calculated
- The metric shows the median across all eligible PRs
- Individual PR lead times are available in drill-down views
Industry benchmarks
Based on DORA research:Why it matters
Deploy lead time reflects:- Pipeline efficiency: How fast your CI/CD pipeline runs
- Release process: Whether you batch changes or deploy continuously
- Time to value: How quickly users benefit from new code
- Feedback loops: How soon developers learn if their changes work in production
- Manual approval gates
- Scheduled release windows
- Slow CI/CD pipelines
- Large batch sizes
Common patterns
Continuous deployment (CD)
- PRs deploy to production automatically after merge
- Lead time: Minutes to hours
- Best for: SaaS products, web applications
Scheduled releases
- PRs accumulate and deploy in batches
- Lead time: Days to weeks
- Best for: Mobile apps, embedded systems
Hybrid approach
- High-priority fixes deploy immediately
- Features deploy on schedule
- Lead time: Mixed (minutes for hotfixes, days for features)
Improving deploy lead time
To reduce PR deploy lead time:-
Optimize CI/CD pipeline:
- Parallelize test execution
- Cache dependencies
- Optimize build times
- Remove unnecessary steps
-
Automate deployments:
- Enable automatic deployment on merge
- Remove manual approval gates (where safe)
- Use trunk-based development
-
Reduce batch size:
- Deploy PRs individually or in small batches
- Avoid accumulating PRs for weekly releases
- Use feature flags for incomplete features
-
Improve testing confidence:
- Expand automated test coverage
- Add smoke tests and health checks
- Monitor deployment success rates
-
Remove process bottlenecks:
- Eliminate manual release approval steps
- Automate release notes generation
- Use GitOps for infrastructure changes
Fast deploy lead times require confidence in your testing and monitoring. Don’t sacrifice quality for speed - invest in automated testing and observability first.
Technical details
How are PRs linked to deployments?
How are PRs linked to deployments?
Weave links PRs to deployments through each deployment run’s commit:
- Deployment commit: Read the commit SHA (and the PR number, when the CI/CD platform reports it) of each production run
- PR mapping: Find the PRs that contain that commit, using your Git provider’s data
- First deployment: Use the earliest successful production run linked to each PR
- Lead time calculation: Measure time from PR merge to deployment completion
Which branches are tracked?
Which branches are tracked?
Weave doesn’t filter this metric by branch. Every merged PR that’s linked to a successful run of a production-classified workflow counts:
- Tracked: PRs on any branch, unless you set up Settings → Branch whitelists, which apply to all PR metrics
- Excluded: Runs of workflows that aren’t classified as production, such as preview or staging workflows. The classification considers the branches each workflow runs on
- GitLab: If you turn on the default-branch rule, pipelines on each project’s default branch count as production deployments
What if a PR is deployed multiple times?
What if a PR is deployed multiple times?
Only the first production deployment is counted:
- First deployment: Used for lead time calculation
- Subsequent deployments: Ignored (not a “new” deployment)
- Rollbacks: Not counted as deployments
What data sources are used?
What data sources are used?
PR deploy lead time requires:
- Git repository data: PR merge times and commit history
- CI/CD platform data: Deployment timestamps and commit ranges
- Supported platforms:
- Git: GitHub, GitLab, Bitbucket, Azure DevOps
- CI/CD: GitHub Actions, GitLab CI/CD, Azure DevOps (build pipelines), CircleCI, Jenkins, Argo CD
How is the metric aggregated?
How is the metric aggregated?
Lead time is calculated as the median (not mean) of all PR deploy times:
- Daily: Median lead time for PRs merged that day
- Weekly: Median lead time for PRs merged that week
- Monthly: Median lead time for PRs merged that month
- Selected period: Median lead time across all eligible PRs merged in the selected period
Public API
Available fromGET /metrics as pr_deploy_lead_time: median time in seconds from PR merge (or treat-closed-as-merged) to the first successful production deploy of that PR. Queue time is included. PRs without confirmed deployment evidence are omitted from the numeric metric and remain unresolved in deployment coverage; they are not assigned a guessed completion time. Requires a CI/CD connection and production-classified workflows. Supports group_by of team, account, project, and pr_type.
Related metrics
- CI deploy frequency: How often you deploy
- PR cycle time: Time from first commit to merge
- PR merge time: Time from PR open to merge
- CI deploy success rate: Deployment reliability
