Track tenant metrics

Report tenant last login, user count and custom utilization metrics to Bunny with the tenantMetricsUpdate mutation via GraphQL, Ruby or Node.js.

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.

PrerequisitesLink to Prerequisites section

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

  1. Create an API client & install a Bunny SDK
  2. 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 metricsLink to Report tenant metrics section

Metrics are tracked via the tenantMetricsUpdate mutation.

TenantMetricsAttributesLink to TenantMetricsAttributes section

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

MutationLink to Mutation section

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

View metricsLink to View metrics section

You can see all the metrics on the tenant form.

Tenant form showing name, code, account and platform, with Last login, User count and utilization metrics like coursesCreated

Tenant