Skip to content

Chargeback reports

Chargeback reports are a JSON blob that will provide information such as

  • List of users and its UI and SDK usage counts
  • List of projects and its size consumption
  • List of workspaces, its members and size consumption

Report output example

{
  "reportDate": "2021-03",
  "workspaces": [
    {
      "name": "workspace 1",
      "numberOfMembers": 1,
      "totalSizeInMb": 0.01,
      "numberOfExperiments": 1,
      "members": [
        {
          "userName": "some user",
          "email": "[email protected]",
          "numberOfExperiments": 1,
          "totalSizeInMb": 0.01
        }
      ],
      "projects": [
        {
          "name": "some project name",
          "numberOfExperiments": 1,
          "totalSizeInMb": 0.01
        }
      ]
    }
  ],
  "users": {
    "licensedUsers": [
      {
        "username": "some user",
        "email": "[email protected]",
        "created_at": 1618908727532,
        "uiUsageCount": 0,
        "uiUsageUpdateTs": 0,
        "sdkUsageCount": 0,
        "sdkUsageUpdateTs": 0,
        "suspended": false
      }
    ],
    "numberOfUsers": 1,
    "createdAt": 1618908727587
  }
}

Who can access this report?

  • Comet organization admins can access this report by admin api
  • You can also add admins programaticly via ADMIN_USER_LIST configuration.

Instructions for All In One / Linux installs

Chargeback reports are available by default from backend version 3.7.46 and above.

For older versions you need to have CHARGEBACK_USAGE_REPORT_ENABLED set to True in your server application configuration.

If you have an all in one install, you can run cometctl aio update-config and add/append this configuration.

Here is an example of how to add that:

echo "CHARGEBACK_USAGE_REPORT_ENABLED='True'" >> /etc/default/comet-ml
# Restart the application
cometctl aio restart-services

Instructions for Kubernetes / Helm

Chargeback reports are available by default from backend version 3.7.46 and above.

For older versions update your local values.yaml enable the following variable:

backend:
  chargebackUsageReportEnabled: true
Restart your backend-react deployment with
kubectl rollout restart deploy comet-ml-backend-react

Retrieving chargeback usage reports

With the user that already have Admin permissions, you can get your API Key following this

See the following curl example on how to pull chargeback usage report. Just replace with your actual host, API key and date in the YYYY-MM format:

You can retrieve the report by running

curl 'https://comet-host/api/admin/chargeback/report?reportMonth=2023-11' -H 'Authorization: adminApiKey' -o /tmp/chargeback_reports.json
Then you can process the json file located in /tmp/chargeback_reports.json as you wish.
Dec. 19, 2023