Search code examples
google-cloud-platformgoogle-cloud-vertex-aigcp-ai-platform-notebook

Is there a way to check the cost of individual managed notebook instances in GCP?


We have decided to use higher-spec managed notebooks in our company and would like to set up cost alerts to manage our charges.

We attempted to perform a cost analysis by assigning labels, but we were unable to find a way to label the managed instances.

Here's what we tried:

  • We confirmed that the label settings don't exist when creating the instances in the GUI.
  • We also verified that label settings in virtual_machine_config.label and virtual_machine_config.data_disk.initialize_params.label don't reflect in the filters of cost alerts. It is possible that the Managed Notebook doesn't support labels in its specifications.

Our goal is to understand the cost of a specific Managed Notebook. Please let us know if there's any way to meet this requirement, even if it involves a workaround.


Solution

  • You are correct, 3 issues:

    1. we currently do not expose Label option at creation time in UI.

    2. The following labels do not apply to Billing.

    • virtual_machine_config.label
    • virtual_machine_config.data_disk.initialize_params.label
    1. Labels are not supported via SDK (gcloud notebooks).

    The good news is that you can assign labels at Runtime level. This should work using API via create and update(patch) methods.

    https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v1/projects.locations.runtimes#Runtime

    {
      "name": string,
      "state": enum (State),
      "healthState": enum (HealthState),
      "accessConfig": {
        object (RuntimeAccessConfig)
      },
      "softwareConfig": {
        object (RuntimeSoftwareConfig)
      },
      "metrics": {
        object (RuntimeMetrics)
      },
      "createTime": string,
      "updateTime": string,
      "labels": {
        string: string,
        ...
      },