Integrate PostHog into any python application.
89
{
"context": "This criteria evaluates how well the engineer uses PostHog's synchronous mode capabilities to handle event tracking in serverless/short-lived execution environments. The focus is specifically on proper client configuration for synchronous operation and lifecycle management.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Client initialization",
"description": "Initializes a PostHog client using posthog.Client() or similar initialization method. The client should be initialized at module level or in a way that persists across invocations (not recreated on each handler call).",
"max_score": 15
},
{
"name": "Synchronous mode enabled",
"description": "Configures the PostHog client with sync_mode=True to ensure events are sent immediately in the calling thread rather than queued for background processing.",
"max_score": 35
},
{
"name": "Event capture",
"description": "Uses posthog.capture() or client.capture() to track events with the user_id (as distinct_id), action (as event name), and metadata (as properties).",
"max_score": 20
},
{
"name": "Proper cleanup",
"description": "Calls posthog.shutdown() or client.shutdown() after capturing events to flush any queued events and properly close connections before the function returns.",
"max_score": 25
},
{
"name": "API key configuration",
"description": "Provides the project_api_key parameter when initializing the client (even if using a placeholder or environment variable).",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-posthogdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10