Artillery Engine for PostHog
PostHog is an open-source product analytics platform.
This Artillery engine is designed for users of self-hosted PostHog (Open-Source or PostHog Enterprise). It makes it easy to load test your PostHog deployment to:
- Make sure the deployment can handle the event volume you're expecting
- Make sure the deployment can handle bursts in event volumes
- Take guesswork out of provisioning capacity and make sure that both PostHog and its dependencies (e.g. ClickHouse) are ready to scale
Usage
Install the plugin
npm install -g artillery-engine-posthog
Configuration
- Set the address of your PostHog instance with
config.target
, and set a PostHog API key withconfig.posthog.apiKey
. - Set the
engine
property of the scenario toposthog
. - In your scenario, use:
-
capture
to send events to PostHog -
identify
andalias
to enrich users metadata
-
Example Script
config:
target: "https://posthog.acme.corp"
posthog:
apiKey: "{{ $processEnvironment.POSTHOG_API_KEY }}"
phases:
- arrivalCount: 5
duration: 10
engines:
posthog: {}
scenarios:
- name: "posthog engine test"
engine: posthog
flow:
- count: 3
loop:
- capture:
distinctId: "distinct id"
event: "movie played"
properties:
movieId: "Die Hard"
category: "Christmas"
- think: 2
(See examples folder for a couple of full examples.)
Run Your Script
POSTHOG_API_KEY=xxx artillery run example.yml