Notice: We've updated our Privacy Policy, effective November 14, 2024.

Step 3: Install the Collector

In this step we'll install the collector which sends statistics information to pganalyze.

Set up Managed Identity

To start, we need to create a new user-assigned Managed Identity through the Azure Portal.

After the Managed Identity is created, assign it to your virtual machine by going to "Security", "Identity", "User assigned" and clicking "Add user assigned managed identity":

Screenshot of Virtual Machine Identity configuration in Azure Portal

Now the pganalyze collector running inside the virtual machine will be able to call Azure REST APIs using the Managed Identity.

Grant Access to Database

Next, grant access to the DB instance by assigning the role with the created Managed Identity. Go to the DB instance's page in the Azure Portal and select Access Control (IAM). Click "Add role assignment", then choose the "Monitoring Reader" role. Next, assign access to the created Managed Identity.

Screenshot of adding role assignment to the DB instance in Azure Portal 1Screenshot of adding role assignment to the DB instance in Azure Portal 2

This allows the collector to view the DB instance information, as well as obtain the metrics like CPU usage.

If you are using Azure Cosmos DB for PostgreSQL Cluster, note that cluster-level access control is not supported. As a workaround, grant access at the resource group level instead.

Downloading the collector container

On a VM of your choice, download the Docker image:

docker pull quay.io/pganalyze/collector:stable

As the collector needs to always be running in the background, avoid using Azure Container Instances.

Continue to Step 4: Configure the Collector

Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →