View tag-level billing costs

This document provides instructions for viewing cost for user defined tags in GDC. This allows user to track billing of all the projects under the same tag and total cost for each tag per SKU.

Before you begin

To get the permissions that you need to view tag-level costs, you must ask your Organization IAM Admin to grant you the Organization Grafana Viewer (organization-grafana-viewer) role.

Access Tag costs

To access costs at tag level, do the following:

  1. Open the following URL to access the Grafana home page:

    https://GDC_URL/platform-obs/grafana/
    

    Replace GDC_URL with the URL of your Distributed Cloud organization.

  2. In the navigation menu, click Explore and select Billing from drop-down.

  3. Open the code view and query the public.costs table to fetch costs per tag.

  4. These are sample SQL queries to fetch total cost data at tags level-

    To get total cost across all SKUs at tag level -:

    SELECT user_tags, sum(cost) FROM public.costs, UNNEST(tags) AS user_tags 
    where start_time > '2026-01-01 10:00:00' GROUP BY unnested_tags;
    

    To get total cost for a specific SKU at tag level-:

    SELECT user_tags, sum(cost) FROM public.costs, UNNEST(tags) AS user_tags 
    where start_time > '2026-01-01 10:00:00' and sku = 'sku_id' GROUP BY unnested_tags;