engineering_analytics
engineering_analytics

Repo-level headline aggregates over a window (default -30d): run count, conclusive-run success rate, re-run cycles, merged-PR count (bots included), median PR open-to-merge (bots and drafts excluded; coarse: draft and ready time fused), median time-to-green, billable minutes + estimated cost (with the merge-queue slice of billable minutes broken out), and merge-queue landing stats (queue-landed merges, first-gate-to-merge median and p90, gate attempts, failed-gate share): each with its equal-length previous-window twin so a caller can render honest deltas. Also carries the detected default branch and its completed-run history series (skippable via include_series=false). Cost figures are null until the job-level source is synced.

get/api/projects/{project_id}/engineering_analytics/repo_overview/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/repo_overview/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

date_fromstring

Window start: relative ('-30d', '-8w') or ISO8601. Defaults to -30d.

date_tostring

Window end: relative or ISO8601. Defaults to now.

include_seriesboolean

Set false to skip the chart series (cost_series, time_to_green_series, success_rate_series, open_to_merge_series return empty) and their query cost: for headline-only consumers like the weekly digest. Defaults to true.

repostring

'owner/name' repository to scope to when the selected source syncs several repositories (from the sources list). Defaults to the source's first repository.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

Response

run_countinteger required

Workflow runs started in the window, all branches and workflows.

run_count_previnteger required

Same count over the equal-length window immediately before date_from: the delta baseline.

success_ratenumber double nullable required

Fraction of conclusive runs that succeeded (0-1) in the window. Skipped, cancelled, neutral, and action_required runs are excluded. Null if no run reached a verdict.

success_rate_prevnumber double nullable required

Conclusive-run success rate over the previous window. Null if no run reached a verdict.

rerun_cyclesinteger required

Runs in the window that were a 2nd+ attempt (attempt > 1).

rerun_cycles_previnteger required

Re-run cycles over the previous window.

merged_pr_countinteger required

PRs merged in the window, all authors and bots included. billable_minutes and estimated_cost_usd cover every run in the window, including default-branch and unmerged PR runs, so dividing them by this count spreads all CI spend over the merges.

merged_pr_count_previnteger required

Merged-PR count over the previous window.

median_open_to_merge_secondsnumber double nullable required

Median merged_at - created_at over PRs merged in the window, bots and drafts excluded. Coarse by design: draft and ready-for-review time are fused. Null when nothing merged.

median_open_to_merge_seconds_prevnumber double nullable required

The same median over the previous window. Null when nothing merged.

median_ready_to_merge_secondsnumber double nullable required

Median per-PR ready_to_merge_seconds (the true cycle time: merged_at minus the last observed ready-for-review transition) over PRs merged in the window, bots and drafts excluded. Null when the issue-events table isn't synced or no merged PR has an observed value; fall back to median_open_to_merge_seconds and label it open-to-merge.

median_ready_to_merge_seconds_prevnumber double nullable required

The same median over the previous window. Null when not observed.

billable_minutesnumber double nullable required

Billable (self-hosted) job minutes in the window; null when the job-level source isn't synced.

billable_minutes_prevnumber double nullable required

Billable minutes over the previous window; null when the job-level source isn't synced.

estimated_cost_usdnumber double nullable required

Estimated CI cost in USD (billable minutes x runner-tier rate); null when the job-level source isn't synced.

estimated_cost_usd_prevnumber double nullable required

Estimated cost over the previous window; null when the job-level source isn't synced.

cost_per_merge_usdnumber double nullable required

estimated_cost_usd divided by merged_pr_count: the window's CI cost per merged PR. Null when the job-level source isn't synced or nothing merged.

cost_per_merge_usd_prevnumber double nullable required

The same ratio over the previous window. Null when the job-level source isn't synced or nothing merged.

merge_queue_billable_minutesnumber double nullable required

Slice of billable_minutes spent on merge-queue batch branches (trunk-merge/**); null when the job-level source isn't synced.

merge_queue_billable_minutes_prevnumber double nullable required

Merge-queue billable minutes over the previous window; null when the job-level source isn't synced.

merge_queue_merged_pr_countinteger required

PRs merged in the window with at least one corroborated merge-queue gate run: the population behind every merge_queue_* landing stat. All authors, bots included.

merge_queue_merged_pr_count_previnteger required

Queue-landed merges over the previous window.

merge_queue_median_first_gate_to_merge_secondsnumber double nullable required

Median seconds from a PR's first observed merge-queue gate run starting to the PR merging. Pending time before gate testing starts is not included. Null when no queue-landed merges.

merge_queue_median_first_gate_to_merge_seconds_prevnumber double nullable required

The same median over the previous window. Null when no queue-landed merges.

merge_queue_p90_first_gate_to_merge_secondsnumber double nullable required

p90 of the same first-gate-run-to-merge measure: the tail, where queue pain concentrates. Null when no queue-landed merges.

merge_queue_p90_first_gate_to_merge_seconds_prevnumber double nullable required

The same p90 over the previous window. Null when no queue-landed merges.

merge_queue_p95_first_gate_to_merge_secondsnumber double nullable required

p95 of the same first-gate-run-to-merge measure. Null when no queue-landed merges.

merge_queue_p95_first_gate_to_merge_seconds_prevnumber double nullable required

The same p95 over the previous window. Null when no queue-landed merges.

merge_queue_p99_first_gate_to_merge_secondsnumber double nullable required

p99 of the same first-gate-run-to-merge measure. Null when no queue-landed merges.

merge_queue_p99_first_gate_to_merge_seconds_prevnumber double nullable required

The same p99 over the previous window. Null when no queue-landed merges.

merge_queue_avg_attempts_per_mergenumber double nullable required

Mean distinct gate attempts (distinct gate branches, flake-bisection branches collapsed) per queue-landed merge. Null when no queue-landed merges.

merge_queue_avg_attempts_per_merge_prevnumber double nullable required

The same mean over the previous window. Null when no queue-landed merges.

merge_queue_multi_attempt_merge_sharenumber double nullable required

Fraction (0-1) of queue-landed merges that needed more than one gate attempt. Null when no queue-landed merges.

merge_queue_multi_attempt_merge_share_prevnumber double nullable required

The same fraction over the previous window. Null when no queue-landed merges.

merge_queue_failed_gate_merge_sharenumber double nullable required

Fraction (0-1) of queue-landed merges with at least one failed gate run before merging. Derived from CI run conclusions, not the queue's own eviction records. Null when no queue-landed merges.

merge_queue_failed_gate_merge_share_prevnumber double nullable required

The same fraction over the previous window. Null when no queue-landed merges.

merge_queue_trunk_availableboolean required

Whether the team's TrunkIo warehouse source has the opt-in merge-queue endpoint synced and readable by the requesting user. When false, every merge_queue_failed_or_cancelled_* and merge_queue_skip_the_line_* field is null; fall back to merge_queue_failed_gate_merge_share.

merge_queue_failed_or_cancelled_sharenumber double nullable required

Fraction (0-1) of concluded queue entries (merged, failed, or cancelled) that ended failed or cancelled, from the queue's own records. Windowed on each entry's last state change. Null when the Trunk source isn't synced or nothing concluded.

merge_queue_failed_or_cancelled_share_prevnumber double nullable required

The same fraction over the previous window. Null when the Trunk source isn't synced or nothing concluded.

merge_queue_skip_the_line_countinteger nullable required

Queue entries flagged skip-the-line (prioritized past the queue order) in the window, whatever state they reached. Null when the Trunk source isn't synced.

merge_queue_skip_the_line_count_previnteger nullable required

Skip-the-line entries over the previous window. Null when the Trunk source isn't synced.

median_time_to_green_secondsnumber double nullable required

Median wall clock for a PR push round to settle fully green over the window: the window-level twin of time_to_green_series, same population and exclusions. Null when no fully green rounds.

median_time_to_green_seconds_prevnumber double nullable required

The same median over the previous window. Null when no fully green rounds.

jobs_availableboolean required

Whether the job-level source is synced (cost and queue figures exist).

default_branchstring required

'master' or 'main', picked by observed run volume in the window.

cost_series_granularitystring required

Bucket width of the cost_series trend, chosen to fit the window: 'hour', 'day', or 'week'.

time_to_green_series_granularitystring required

Bucket width of the time_to_green_series trend: 'hour', 'day', or 'week'.

success_rate_series_granularitystring required

Bucket width of the success_rate_series trend: 'hour', 'day', or 'week'.

open_to_merge_series_granularitystring required

Bucket width of the open_to_merge_series trend: 'hour', 'day', or 'week'.

ready_to_merge_series_granularitystring required

Bucket width of the ready_to_merge_series trend: 'hour', 'day', or 'week'.

Changes

No recorded changes to this operation across all 1 revision of this API.