provider engineering_analyticsengineering_analytics GET
/api/projects/{project_id}/engineering_analytics/ci_failure_logs/ @utdk/posthog
/api/projects/{project_id}/engineering_analytics/ci_failure_logs/ engineering_analytics_ci_failure_logs
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.
- pr_number query required
- Pull request number whose CI failure logs to fetch.
- integer
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
- repo query required
- 'owner/name' repository the pull request belongs to.
- string
- source_id query
- Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.engineeringAnalyticsCiFailureLogs()