error-tracking-python

Add PostHog exception autocapture to Python applications.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill error-tracking-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-tracking-python
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/all/skills/error-tracking-python
Command: npx skills add https://github.com/PostHog/skills --skill error-tracking-python

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog error tracking for Python enables automatic capture, attribution, and management of exceptions in Python applications, reducing debugging time and improving incident response.

Core Features & Use Cases

  • Automatic exception autocapture in supported Python environments (Django, Flask, FastAPI, and plain scripts)
  • Safe handling of secrets, with environment-based configuration and no hard-coded keys
  • Guided triage with alerts, issue management, and external integration references to assist incident resolution

Quick Start

Install the PostHog Python library and initialize the client with enable_exception_autocapture to begin automatic error tracking.

Frequently Asked Questions about error-tracking-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically capture exceptions in Python with PostHog?

To automatically capture exceptions in Python, initialize the PostHog client with enable_exception_autocapture. This automatically reports errors in Django, Flask, FastAPI, and plain scripts to reduce debugging time.

Does PostHog error tracking work with Django, Flask, and FastAPI?

Yes, PostHog error tracking supports Django, Flask, FastAPI, and plain Python scripts. It applies exception autocapture across these web environments to manage exceptions and improve incident response.

What is the best way to track Python application errors without hard-coded keys?

The best way to track Python errors without hard-coded keys is using PostHog error tracking with environment-based configuration. This safely handles secrets while automatically capturing and attributing exceptions.

Why are my PostHog Python exception events missing after application shutdown?

Exception events go missing after application shutdown without proper shutdown procedures. You must trigger a proper PostHog client shutdown to ensure all captured exception events flush before the Python process exits.

How do I set up PostHog error tracking for a Python script?

To set up PostHog error tracking for a Python script, install the PostHog Python library and initialize the client with enable_exception_autocapture. This automatically captures and reports exceptions in plain scripts.

Can I manage incident triage and alerts for captured Python exceptions?

Yes, you can manage incident triage for captured Python exceptions. PostHog error tracking provides guided triage with alerts, issue management, and external integration references to assist incident resolution.