Stategraph is having its next demo day on the 24th...
# random
j
Stategraph is having its next demo day on the 24th. This one's a deep dive on how Stategraph actually works under the hood, plus a look at Stategraph Cost. We'll get into how the dependency graph is stored in the schema, how surgical reads let you pull individual outputs via
terraform_remote_state
instead of locking the whole state, and how blast radius uses the graph to show exactly what a change touches before you apply. Sign up here (pants optional): https://stategraph.com/demo-day
👍 1
e
Is that integrated with open infra quote?
s
Copy code
vendorName  rows     priced_rows
aws         2941832  2941803
azure       666611   666611
gcp         13175    0
current
products.csv.gz
have no gcp data, is it intended?
j
Not intended. I'll take a look right now.
Copy code
cloud_pricing=# SELECT "vendorName", COUNT(*) AS product_count
FROM products
GROUP BY "vendorName"
ORDER BY product_count DESC;
 vendorName | product_count
------------+---------------
 aws        |       2941832
 azure      |        666611
 gcp        |         13175
(3 rows)

cloud_pricing=#
Did something happen w/ your initial load? See anything in the logs?
s
I'll clean db and rerun, thanks for checking
sorry, can you check prices also:
Copy code
SELECT COUNT(*) FILTER (WHERE prices <> '{}'::jsonb) AS gcp_priced_rows
FROM products
WHERE "vendorName" = 'gcp';
j
Looking! I'll get back to you
Found the bug and fixing now
🙌 1
Fixed! Thank you so much. You'll have to download fresh data.
Copy code
cloud_pricing=# \dt
             List of relations
 Schema |    Name     | Type  |   Owner
--------+-------------+-------+------------
 public | ProductLoad | table | stategraph
(1 row)

cloud_pricing=# SELECT "vendorName",
cloud_pricing-#        COUNT(*)                                          AS total_rows,
cloud_pricing-#        COUNT(*) FILTER (WHERE prices <> '{}'::jsonb)      AS priced_rows
cloud_pricing-# FROM products
cloud_pricing-# GROUP BY "vendorName"
cloud_pricing-# ORDER BY "vendorName";

 vendorName | total_rows | priced_rows
------------+------------+-------------
 aws        |    2951722 |     2951693
 azure      |     666809 |      666809
 gcp        |     131284 |      124046
(3 rows)

cloud_pricing=#
s
I retried, but still have no calculations:
Copy code
Stategraph GCP cost estimate bug report

Environment:
Stategraph server image: <http://ghcr.io/stategraph/stategraph-server:2.3.4|ghcr.io/stategraph/stategraph-server:2.3.4>
Image digest: sha256:2f93d80d9ab19e0cbe71d35beac01a17824da46748d584a7a37ce7d2a1a7088b
Image created: 2026-06-12T15:40:15Z
Database: postgres:17-alpine
STATEGRAPH_COST_ENABLED=true
Server URL: <http://localhost:8080>

Pricing data:
Reloaded the fixed upstream product file with:
PRICING_DATA_URL=<http://127.0.0.1:18081/source-products.csv.gz> load-pricing-data

Loader result:
Loaded 3749815 products
Done! 3749815 products loaded into cloud_pricing

Price table coverage:
vendorName | product_count | priced_rows
aws        | 2951722       | 2951693
azure      | 666809        | 666809
gcp        | 131284        | 124046

Imported Terraform state:
google_compute_instance.headscale
  machine_type = e2-small
  zone         = europe-west3-b
  boot disk    = 20 GB pd-standard

google_compute_disk.headscale_data
  zone = europe-west3-b
  size = 20
  type = pd-balanced

google_compute_address.headscale[0]
  region = europe-west3

Evidence that the GCP compute price exists:
products row:
  vendorName     = gcp
  service        = Compute Engine
  region         = europe-west3
  sku            = generated-e2-small
  productFamily  = Compute Instance
  on_demand USD  = 0.02158389
  unit           = Hours
  effectiveDate  = 2026-06-11T07:00:00Z

Actual Stategraph cost result after:
POST /api/v1/states/<state-id>/costs/calculate

Server log:
COST_PARSED ... resources=11 currency=USD
COST_SNAPSHOT_WRITTEN ... resources=11 supported=11 priced=4 monthly=0.000000
COST_JOB_COMPLETED

Cost API summary:
monthly_cost     = 0.000000
hourly_cost      = 0.000000
priced_count     = 4
resource_count   = 11
supported_count  = 11
coverage_percent = 36.36363636363637

Returned components:
google_compute_instance.headscale
  Instance usage (Linux/UNIX, on-demand, e2-small)
    price = 0.0000000000
    monthly_quantity = 730
  Standard provisioned storage (pd-standard)
    price = 0.0000000000
    monthly_quantity = 20

google_compute_disk.headscale_data
  Balanced provisioned storage (pd-balanced)
    price = 0.0000000000
    monthly_quantity = 20

Important clue:
Cost response has:
  google_compute_instance.headscale provider=gcp region=null
  google_compute_disk.headscale_data provider=gcp region=null

But Terraform state has:
  zone = europe-west3-b

Estimator probably needs to derive:
  region = europe-west3

Expected:
For google_compute_instance.headscale, Stategraph should match:
  generated-e2-small / Compute Engine / europe-west3
  USD 0.02158389 per hour

Expected monthly compute cost:
  0.02158389 * 730 = 15.7562397 USD/month

Actual:
Stategraph marks resources as supported/priced but assigns zero prices:
  e2-small    = 0.0000000000
  pd-standard = 0.0000000000
  pd-balanced = 0.0000000000

Conclusion:
The previous upstream product file issue appears fixed: GCP now has 124046 priced rows.
Remaining bug: stategraph-server:2.3.4 has priced GCP rows available in cloud_pricing.products, but the estimator still does not apply them to GCP Compute Engine VM/disk resources imported from Terraform state.