PostHog / PostHog/posthog-php

Background agent and flush interval support

Open
#170 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
33
Forks
34
Avg merge
2d 4h
Merged PRs (30d)
13

Description

Description

Since PHP is singlethreaded, we cannot do the same as Python, Go, etc

An idea would be:

  • Add lib/Consumer/Agent.php
  • Add "agent" => Agent::class to Client::CONSUMERS
  • Add config:
    • agent_host
    • agent_port
    • agent_timeout_ms
    • agent_fallback
  • Add a separate executable, maybe bin/posthog-agent, or document using a PostHog sidecar/daemon if one exists.
  • Agent batches events and posts to /batch/.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing consumers and Client::CONSUMERS, then inspect how configuration and event posting are handled. The issue mentions lib/Consumer/Agent.php, a possible bin/posthog-agent executable or sidecar, and the /batch/ endpoint; confirm the intended agent architecture and fallback behavior before implementation. Done means the agreed agent path, configuration, batching, and documentation are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.