engineering_analytics
engineering_analytics

Per-job aggregates for one workflow over a window (default -30d), one row per de-sharded job name (matrix shards aggregate together), busiest first: queue p50, duration p50/p95, failure rate, retry pressure, run share (below 1.0 = conditional job), and billable cost. Optionally scope to a single git branch via branch or one run group via run_scope. Jobs always need their run as context: this is the aggregate view; use workflow_jobs for one run's jobs. Empty when the job-level source isn't synced.

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

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/job_aggregates/
  • 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

branchstring

Optional exact git branch (head_branch) to scope results to, e.g. 'main'. Omit or leave blank to aggregate across all branches.

date_fromstring

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

date_tostring

Window end: relative or ISO8601. Defaults to now.

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.

run_scope'all' | 'default_branch' | 'merge_queue' | 'pull_request'

Which group of runs to report on: 'all' (default) is every run; 'default_branch' is runs on master or main; 'pull_request' is runs on PR branches, excluding default-branch and merge-queue runs; 'merge_queue' is the gate runs the merge queue fired before a merge landed. Fork PRs carry no PR attribution (a GitHub limitation), so they appear only under 'all'. Any other value is a 400.

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.

workflow_namestring required

Workflow name to aggregate jobs for.

Response

job_namestring required

De-sharded job name: the matrix '(G/N)' suffix is stripped and unexpanded '${{ matrix.* }}' templates are collapsed, so shards of one matrix aggregate together.

job_countinteger required

Job instances observed in the window (all shards, all attempts).

shard_countinteger required

Distinct raw job names inside the group - the observed matrix width.

runs_ininteger required

Distinct workflow runs the job appeared in.

run_sharenumber double nullable required

runs_in divided by the workflow's total runs in the window; below 1.0 means the job is conditional and skips some runs. Null when the workflow had no runs.

queue_p50_secondsnumber double nullable required

Median queue wait (created to started) in seconds - where runner-capacity problems hide. Null when nothing started.

p50_secondsnumber double nullable required

Median duration of successful job instances, in seconds: cancelled and failed instances end early and would bias the percentile. Null if none succeeded.

p95_secondsnumber double nullable required

95th-percentile duration of successful job instances, in seconds: cancelled and failed instances end early and would bias the percentile. Null if none succeeded.

failure_ratenumber double nullable required

Decisive failures over job instances with a pass-or-fail verdict (0-1). Skipped, cancelled, neutral, and action-required instances are excluded. Null if none reached a verdict.

retry_job_countinteger required

Job instances that ran on a 2nd+ run attempt - retry pressure.

billable_minutesnumber double nullable required

Billable (self-hosted) minutes across the group's instances; null when every instance ran on an unknown tier.

estimated_cost_usdnumber double nullable required

Estimated cost in USD via the runner-tier rate ladder; null when every instance ran on an unknown tier.

Changes

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