cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Linking Workspace IDs to Names in Billing Schema

TravisBrowne
New Contributor II

Hi everyone,

We recently enabled UC and the Billing system table to monitor our usage and costs. We've successfully set up a dashboard to track these metrics for each workspace. The usage table includes the workspace_id, but I'm having trouble finding a way to map these IDs to their corresponding workspace names. compassmobiletree

Since the System Tables feature is still in preview and not all tables are available yet, I'm curious if there's any plan to include workspace names in the "usage" table in the near future. If not, what would be the best approach to create a table that links workspace_id with workspace_name, considering I don't have access to the Databricks account level?

1 REPLY 1

andreji
New Contributor II

I got this from their older version of the dashboard. 

dbdemos uc-04-system-tables


When everything is executed, go to your graph in the dashboard, click three dots in the top right, select in my case "View dataset:usage_overview" then paste/modify sql code as below. This will hardcode the workspace name into your dashboard.

 

-- parse workspaces json
workspace as (
  select explode(
    map_entries(from_json('{"2049501200185xyz":"namexyz","1944008075660xyz":"name2nyz","8293066424636xyz":"name3nyz"}', 'map<string,string>'))
  ) as kvp,
  kvp['key'] as workspace_id,
  kvp['value'] as workspace_name
),
-- apply date filter

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now