engineering_analytics
engineering_analytics

DORA-style deploy metrics over the GitHub deployments + deployment_statuses warehouse pair, each headline with its previous-window twin: deployment frequency, merge-to-deploy lead time (with a per-bucket box-plot series), and honest proxies for change failure rate and time to restore (deploy-status based: no incident data is linked). deploy_data_available is false when the deploy tables aren't synced.

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

Request

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

environmentstring[]

Deploy environment(s) to scope to, repeatable (from the response's environments list). Omit to include all persistent environments marked production or named prod/production (including regional suffixes), falling back to the busiest persistent environment when none match. Explicit names are trimmed, deduplicated, and validated against the source, including transient environments. Blank or unknown names are rejected with a 400 response.

github_teamstring

GitHub team slug (from the response's github_teams list) to narrow the PR-scoped merge-to-deploy figures to that team's authors. Deploy counts stay repo-wide. Needs the team-membership snapshot synced; without it the merge-to-deploy figures return empty rather than silently unfiltered.

granularity'day' | 'hour' | 'week'

Bucket width for every series. Omit to pick one that fits the window: hour up to 48h, day up to 90 days, week beyond.

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

deploy_data_availableboolean required

False when the deployments/deployment_statuses tables aren't synced for the selected repo; every other field is then empty or null, never a fake zero.

environment_scopestring required

Display label for the selected environments, comma-separated, 'persistent' when no persistent environments were discovered. Use selected_environments for exact names.

environmentsstring[] required

Distinct persistent environments from the metric scan window or the 30 days before its end, whichever starts earlier, most-deployed first. Transient environments are omitted.

selected_environmentsstring[] required

Exact environment names used for these metrics. Defaults to all persistent environments marked production or named prod/production (including regional suffixes), falling back to the busiest persistent environment. Explicit filters are trimmed and deduplicated. DRF rejects blank or unknown names; real transient names are allowed.

has_membership_databoolean required

True when the optional team-membership snapshot is synced. When false, a github_team filter cannot be honored and the merge-to-deploy figures go empty rather than silently unfiltered.

github_teamsstring[] required

Distinct GitHub team slugs from the membership snapshot, sorted: the team picker's options. Empty when membership isn't synced.

deployment_countinteger required

Deployments whose first success status landed in the window, within the environment scope.

deployment_count_previnteger required

Same count over the equal-length window before date_from.

deployments_per_daynumber double nullable required

deployment_count normalized by the window length in days. Null only when the deploy tables aren't synced.

deployments_per_day_prevnumber double nullable required

Previous-window twin of deployments_per_day. Null only when the deploy tables aren't synced.

median_merge_to_deploy_secondsnumber double nullable required

Median seconds from a PR's merge to the first successful deployment containing it (bots/drafts excluded; narrowed by github_team when given). Containment is resolved through the deploy's head commit, not the deploy's success time. Keyed on deploy time. This is merge-to-deploy, not full commit-to-deploy DORA lead time. Null when nothing deployed in the window.

median_merge_to_deploy_seconds_prevnumber double nullable required

Previous-window twin of median_merge_to_deploy_seconds.

median_open_to_deploy_secondsnumber double nullable required

Median seconds from a PR's open to the first successful deployment containing it: the full open-to-deploy lead time over the same deployed-PR population as median_merge_to_deploy_seconds. Null when nothing deployed in the window.

median_open_to_deploy_seconds_prevnumber double nullable required

Previous-window twin of median_open_to_deploy_seconds.

deployed_pr_countinteger required

PRs first deployed in the window: the population behind the merge-to-deploy median and box plot.

deployed_pr_count_previnteger required

Previous-window twin of deployed_pr_count.

failed_deployment_countinteger required

Deployments with at least one failure/error status, keyed on the first failure time.

failed_deployment_count_previnteger required

Previous-window twin of failed_deployment_count.

failed_deployment_sharenumber double nullable required

Failed deployments over deployments that reached any outcome (success or failure). A change-failure proxy: no incident data is linked, so a deploy that succeeded but broke production is not counted. Null when nothing reached an outcome.

failed_deployment_share_prevnumber double nullable required

Previous-window twin of failed_deployment_share.

median_failed_deploy_to_next_success_secondsnumber double nullable required

Median seconds from a deployment's first failure status to the next successful deployment in the same environment. A time-to-restore proxy: recovery by anything other than a deploy is invisible, and failures not yet recovered are excluded. Null when no failed deploy recovered in the window.

median_failed_deploy_to_next_success_seconds_prevnumber double nullable required

Previous-window twin of median_failed_deploy_to_next_success_seconds.

merged_pr_countinteger required

PRs merged in the window (bots and drafts excluded; narrowed by github_team when given): the denominator behind unattributed_merged_pr_share.

unattributed_merged_pr_sharenumber double nullable required

Share of merged_pr_count no successful in-scope deployment attributed: recent merges still waiting for their deploy, plus merges whose deploy the scope or scan bounds miss. Null when nothing merged in the window.

latest_deploy_status_atstring date-time nullable required

The newest deployment status row synced, any environment: how fresh the deploy data is. Windows ending after this instant undercount. Null when the deploy tables are empty.

series_granularitystring required

Bucket width of every series: the granularity param when given, else chosen to fit the window: 'hour', 'day', or 'week'.

Changes

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