IBM Cloud Private metering service

You can use the metering service to view and download detailed usage metrics for your applications and cluster. Fine grained measurements are visible through the metering console and the data is kept for up to three months. Monthly summary reports are also available for you to download and are kept for up to 24 months.

The metering service is automatically installed as part of the IBM Cloud Private environment.

Note: The metering service does not meter workloads or storage in the kube-system namespace since these items are considered system services.

Viewing metering reports

Metering reports for IBM Cloud Private

  1. From the IBM Cloud Private management console, open the navigation menu and click Platform > Metering.
  2. View and download metering data.

    • To view metering data for applications, click Workloads and navigate to the wanted application.

      • You can view metrics for Available Processors and Capped Processors.
      • You can update the displayed time range to show a period of interest.
      • You can download the displayed data for a specific application as a .csv file.
    • To view metering data for storage, click Storage and navigate to the wanted persistent volume claim (PVC).

      • You can view the storage metric to see the amount of storage allocated for this PVC.
      • You can update the displayed time range to show a period of interest.
      • You can download the displayed storage data as a .csv file.
      • PVCs are grouped by namespace. The Storage group indicates the amount of storage that is used by the cluster across all namespaces.
    • To download a .csv file that contains a monthly report of application metrics data, click Download Report and then select to download either the Workload Report or the Full Report.
      • The Workload Report contains a simplified summary of usage data at the product and namespace levels, and is easiest to use for chargebacks.
      • The Full Report contains a detailed summary of usage data for both the product and each container instance, and can be used for detailed auditing and analysis.
      • Your Virtual Processing Core (VPC) usage is the number of Ccores that is listed in the report.
    • To view metering data for nodes in your cluster, click Platform.
  3. Read the report .csv file.

    • The report is in CSV format, which can be loaded by any modern spreadsheet software. However, as CSV files do not include formatting details, it might be necessary to expand columns of interest to see all the data.
    • The report is organized into sections by month. The oldest tracked month appears at the beginning of the section and the newer months appear at the end of the section. The Period column displays the year and month of the section on each row.
    • The Status column displays whether the section is FINAL or PENDING. The two most recent months are marked as PENDING. More metering data might still be processed and these report sections updated. When a section is marked FINAL, it is no longer being updated.
    • Within each monthly section, the data is further separated into the following categories:
      • Overall summary
      • Summary by group (for example, namespace) and product
      • Summary for individual workloads.

Some workloads, especially workloads external to IBM Cloud Private, can include extra metrics beyond the default Available Processors (Acores) and Capped Processors (Ccores) automatically collected for containers by the metering service. In the Full Report download, these extra metrics are represented by two columns, the metric itself and an extra column titled breakdown. The breakdown column provides detailed technical information that can assist support staff or auditors, but does not normally need to be inspected.

To download the metering reports from the command line instead of from the management console, use the metering command that is part of IBM Cloud Private CLI. For more information, see IBM CLI metering commands (metering).

Metering reports for IBM Cloud Private with IBM Multicloud Manager configured

If IBM Multicloud Manager is installed, the metering service on the IBM Multicloud Manager hub cluster includes more IBM Multicloud Manager metrics. To view IBM Multicloud Manager data in the metering UI, or to be able to download the Multi-Cluster Report, you must have the Cluster Administrator role.

Using the metering service to manage chargebacks

You can track IBM Cloud Private usage by a subset of the cluster users, such as teams, department, individuals, or specific clients. Use strategic namespace assignments to track the data. You can use the data that the metering service gathers about core usage to manage billing for the cluster users. This practice is commonly known as chargeback.

To use namespaces to manage chargebacks, you determine the subset of users that you want to track. Then, you create a namespace for each group of users, and assign each user access to only the namespace for the users' group. When you need to manage chargebacks for the groups, review the usage for each namespace. You can use the usage information for each namespace to assign billing for the group.

Tracking usage of IBM products that are running outside of your IBM Cloud Private cluster

If you want to send data from products that run outside of the IBM platform to the metering service, the following parameters must be configured:

To create the API key, complete the following steps:

  1. Create a serviceid that binds to the namespace that the IBM Cloud Private user has access to. For example:

    cloudctl login -a https://<icp-cluster-ip>:8443 -n default --skip-ssl-validation
    cloudctl iam service-id-create my-serviceid-for-metering -d "Metering access serviceid in the default namespace"
    
  2. Create a service policy, that grants the serviceid either operator or a higher role access to the metering-service. For example:

    cloudctl iam service-policy-create my-serviceid-for-metering -r Operator --service-name metering-service
    
  3. Create an API key that binds to the serviceid. For example:

    cloudctl iam service-api-key-create my-apikey my-serviceid-for-metering
    

For more information about creating serviceids, service policies, and API keys from the CLI, see Creating a service ID by using IBM Cloud Private CLI.

Users with Cluster Administrator or Administrator roles can view any API key that binds to the namespace to which these roles have access to.

  1. From the IBM Cloud Private management console, open the navigation menu and click Platform > Metering.
  2. From the metering dashboard, select Manage API Keys. From this form, you can retrieve the API keys for your platform. You can also retrieve the metering API endpoint for products that are running outside of the platform.

If an IBM product is enabled for metering, you can set up communication between the product and IBM Cloud Private. Review the external product documentation for information about how to configure communication by using API keys.

External products that send data to the IBM Cloud Private metering service might provide product-specific metrics. These metrics are available from the metering dashboard and in the downloadable report. In some cases, the value in the report might be capped. In these cases, more details are provided in the report that explains how the value is determined. Review the external product documentation for details on the measurement approach for each metric.