Setting up account-based analytics
This is a preview feature. It may be subject to change or removal with no further notice.
To enable preview features, set com.unblu.platform.enablePreview to true.
For more information on preview features, refer to the Unblu release policy.
To use Unblu’s account-based analytics feature, work through the following steps:
-
Deploy the analytics database backend (BigQuery or PostgreSQL).
-
Configure the Collaboration Server to point at the backend you deployed.
| Analytics data collection starts only after the database backend is deployed and configured. Historical data isn’t backfilled. |
Step 1: Deploy the analytics database backend
The Collaboration Server supports two database backends for account-based analytics: BigQuery and PostgreSQL. BigQuery is the default for deployments on Google Cloud, including the Unblu Cloud. PostgreSQL is the default for any deployment that isn’t on Google Cloud, including Unblu Cloud deployments hosted elsewhere.
BigQuery
In Google Cloud deployments, the Collaboration Server requires a BigQuery dataset as the backend. Before configuring the Collaboration Server, ensure the following:
-
A BigQuery dataset exists in your Google Cloud project.
For Unblu Cloud installations, the Unblu Site Reliability Engineering (SRE) team provisions the dataset. Self-managed deployments on Google Cloud provision the dataset themselves.
-
The Collaboration Server can authenticate to Google Cloud using Application Default Credentials (ADC) with the following IAM roles:
-
roles/bigquery.dataEditoron the dataset. -
roles/bigquery.jobUserandroles/serviceusage.serviceUsageConsumerat the project level.
-
The Collaboration Server creates the analytics schema — a raw event table and a set of views — on startup.
PostgreSQL
For self-managed deployments outside Google Cloud, the Collaboration Server requires a PostgreSQL database as the backend. Before configuring the Collaboration Server, ensure the following:
-
A reachable PostgreSQL instance, version 14 or later, with an existing database.
-
A database user with
CREATEpermissions on the target schema.The Collaboration Server creates a raw event table, views, and stored procedures on startup, so the user must be permitted to create these objects.
The following example script creates a database and a user that satisfy these requirements:
CREATE USER unblu_analytics WITH PASSWORD 'your_analytics_password'; (1)
CREATE DATABASE unblu_analytics;
\connect unblu_analytics
GRANT CREATE ON SCHEMA public TO unblu_analytics;
| 1 | Replace 'your_analytics_password' with a password of your choice. The username unblu_analytics is an example; Unblu doesn’t require a specific username. |
Step 2: Configure the Collaboration Server
The analytics properties described here are in the IMMUTABLE scope. Set them in the Collaboration Server’s configuration file.
Set com.unblu.analytics.database to either BIGQUERY or POSTGRES. The default value, DISABLED, turns analytics off entirely. For your changes to take effect, restart the Collaboration Server.
To write data to multiple backends concurrently — for example, while migrating from BigQuery to PostgreSQL — list the extra ingestion backends in com.unblu.analytics.additionalIngestionDatabases. The Collaboration Server then mirrors raw event data to the listed databases alongside the primary backend.
BigQuery
Set com.unblu.analytics.bigquery.dataset to the ID of the BigQuery dataset you want to use. The Google Cloud project ID is derived from the Collaboration Server’s Google Cloud credentials.
PostgreSQL
Set the following properties:
-
com.unblu.analytics.postgres.host: The hostname of the PostgreSQL instance.
-
com.unblu.analytics.postgres.port: The port the PostgreSQL instance listens on.
-
com.unblu.analytics.postgres.databaseName: The name of the database to use.
-
com.unblu.analytics.postgres.username: The database user.
-
com.unblu.analytics.postgres.password: The database user’s password.
-
If your schema isn’t called
public(the default), specify its name in com.unblu.analytics.postgres.schema.
Step 3: Restart and verify
Restart the Collaboration Server. On startup, the Collaboration Server creates or updates the analytics schema for each configured backend.
Analytics is enabled provided com.unblu.analytics.database is set to BIGQUERY or POSTGRES and the database backend is configured correctly. To confirm that data is being collected, configure a dashboard and check that it displays KPI data once events have been recorded. Events are ingested in 30-second batches, so they appear in dashboards once the next batch is written.
See also
-
For an overview of Unblu’s analytics offering, refer to Introduction to Unblu analytics.