engineering_analytics
engineering_analytics

The thinned CI failure logs for a pull request, grouped by failed job. Resolves the PR to its workflow runs via the pull_requests association (all of the PR's pushes, not just the latest commit), then reads the Logs product joined on run_id. Returns failed jobs only (the worker fetches logs for failures); logs_available is false when CI hasn't failed, the logs aged out of the short Logs retention, or a fork PR has no run association. Each line carries its original 1-based line number in the full pre-thinning log; lines are the failure region (errors plus surrounding context, with omission markers), capped per job and overall.

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

Request

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

pr_numberinteger required

Pull request number whose CI failure logs to fetch.

repostring required

'owner/name' repository the pull request belongs to.

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

pr_numberinteger required

Pull request number the failure logs are for.

runs_attributedinteger required

Workflow runs attributed to the PR (across all its pushes) that were searched for logs.

logs_availableboolean required

False when no failure logs were found: CI hasn't failed, the logs aged out of the short Logs retention, or a fork PR carries no run association to resolve.

truncatedboolean required

True when the overall line cap across all jobs was hit.

Changes

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