Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

485 B
Raw Blame
import { AsyncLocalStorage } from 'node:async_hooks'

// Caller attribution (e.g. teamId, hogFunctionId) for URL-validation check logs. The DNS
// check runs inside undici's connect flow, which has no caller context — callers that want
// attributed logs wrap their fetch in `fetchAttribution.run({...}, ...)`.
// Lives in its own module so tests that mock `./request` don't replace it with undefined.
export const fetchAttribution = new AsyncLocalStorage<Record<string, unknown>>()