Deployment
Creating New Tenants
PostHog
PostHog is used to track user interaction with the platform.
We have separate projects for "Development" and "Production" environments. All customer ESPROFILER tenants published data into the "Production" project. When a new tenant is spun up, data tracking will automatically be enabled.
Classifying Tenant
In PostHog it is possible to define a "Transformation". These parse incoming events and can modify or append the data before being committed to the PostHog data set. We use this to add a new esp_tenant field, which makes it easier us to to then filter the analytics by a particular tenant.
To view Transformations in PostHog you can navigate to Data Management > Transformations. You will then find the Classify Tenant transformation, which you can click to view the details of.
Adding New Tenants
To add your new tenant to the classification, click "Edit Source Code", then add a new if statement for your new tenant:
if (event.properties.$session_entry_host == '<tenant>.own.esprofiler.com') {
returnEvent.properties.esp_tenant := 'Company Name'
}

