Track tenant metrics

Your platform can often seem like a black box when it comes to what tenants are doing with your application. It can be very useful to see when someone has last logged in, how many users there are in the tenant and how much of the functionality has been activated.

Bunny can track some of these metics, so you have more insight into tenant activity via Bunny's user interface.

  • Last login

  • User count

  • Utilization metics

Utilization metrics is a hash of values that you deem important signals to a customer's engagement with your app. For example, if your app is a learning-management solution, you could track number of courses defined, courses attended and students.

Prerequisites

Before you can start tracking metrics from your application, you need to complete the following steps on the Bunny side first.

  1. Create an tenant in Bunny to represent a tenant in your SaaS application. If you've already enabled tenant provisioning then you wont need to do this step as Bunny will assign a tenant to each new subscription for you.

Report tenant metrics

Metrics are tracked via the tenantMetricsUpdate mutation.

TenantMetricsAttributes

{
  "code": "10012032",
  "attributes": {
    "lastLogin": "2023-10-20",
    "userCount": 10,
    "utilizationMetrics": { 
      "coursesCreated": 10, 
      "coursesAttended": 50 
    }
  }
}

Mutation

mutation tenantMetricsUpdate ($code: String!, $attributes:   TenantMetricsAttributes!){
  tenantMetricsUpdate (code: $code, attributes: $attributes) {
    errors
  }
}

View metrics

You can see all the metrics on the tenant form.

Tenant

Last updated

Was this helpful?