Skip to main content
This page will show how you can create visualizations with Hubble and Google Looker Studio. By the end of the tutorial you will have created two graphs that will help visualize temporary VS persistent contract data entry distribution and expiration. Demo As you can see, persistent contract data entries account for roughly 25% of all contract data entries with the rest being temporary. There are also a lot more expired temporary contract data entries. This is expected because temporay entries cannot be bumped whereas persistent entries can be bumped/restored. For more information, you can read about State Archival and the Contract Data Lifecycle.

Prerequisites

  1. Make sure you have connected to Hubble by following the instructions in the Connecting page
  2. You have access to Google Looker Studio
  3. You have read and understand the general Best Practices for querying BigQuery data

Create a Report in Looker Studio

Attach Data Sources to Looker Studio

  1. Select Create --> Data source
New Source
  1. Find and select the BigQuery Google Connector
Add BigQuery
  1. Find the desired tables that you want to connect. For this example you will want to add a data source for:
    1. crypto-stellar.crypto_stellar.contract_data
Contract Data

Create a New Report (Dashboard)

  1. Select Create --> Report
Create Report
  1. Add your data sources from above
Get Data
  1. Insert a Pie chart
Add A Pie Chart
  1. Choose contract_data as the Data source
New Source
  1. Choose closed_at as the Date Range Dimension and contract_durability as the Dimension
Add Pie Chart
  1. You should now have a pie chart showing the percentage of Temporary VS Persistent Contract Data Durability
Results

Use Custom SQL to Create a Chart

  1. In your report, click Add Data which will be near the bottom right of your window
Click Button
  1. Select BigQuery and choose CUSTOM QUERY and select your desired Billing Project where the query will be charged
Custom Query
  1. Add the following query and click Add
  1. Insert Column chart
Column Chart
  1. Select the following:
  • BigQuery Custom SQL as your Data source
  • month_agg as the Dimension
  • contract_durability as the Breakdown Dimension
  • expired_entry_count as the Metric
Configure
  1. You should now have a column chart (bar chart) showing the expired Soroban contract entries
Chart

Applying a Global Filter

  1. Click +Add quick filter to apply a filter throughout the whole report
Quick Filter
  1. Select contract_durability to filter by contract_durability values
Durability
  1. Select only ContractDataDurabilityPersistent and click Apply
Persistent
  1. Your charts should now be filtered and show only ContractDataDurabilityPersistent data
Clean Report