Skip to content

Report per-type resource counts for every resource type and both engines - #6097

Open
radakam wants to merge 3 commits into
mainfrom
telemetry-resources-metadata-all-types
Open

Report per-type resource counts for every resource type and both engines#6097
radakam wants to merge 3 commits into
mainfrom
telemetry-resources-metadata-all-types

Conversation

@radakam

@radakam radakam commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Changes

resources_metadata only covered direct deploys, so terraform deploys emitted nothing at all. Counts now come from Resources.AllResources() and are emitted for both engines, with state_engine reporting the engine that ran. Sizes remain direct-only, since the terraform path leaves StateSizeBytes zero.

Comments in libs/telemetry/protos are updated to record the deprecation, and .agent/rules/telemetry.md documents the procedure so the next person doesn't extend the deprecated fields.

Behaviour change: for direct deploys count is now config-derived, so a declared-but-not-yet-deployed resource is counted and sub-resource state entries no longer inflate the parent type's count. Types present only in state keep their state-derived count.

Why

Dashboards fall back to the resource_*_count fields, which cover 12 of the 32 resource types, so newer types (job_runs, genie_spaces, alerts, sql_warehouses, postgres_*, …) look like zero adoption.

The obvious fix is to add the 20 missing fields, but they are deprecated = true in the universe proto, superseded by resources_metadata.resources[*].count. Extending them would recreate exactly the problem resources_metadata was introduced to solve: a hand-maintained field list that silently lags the resource types. Deriving counts from AllResources() instead means a new resource type is reported the moment it ships, with no telemetry change and no proto change — which is also what the proto already specifies ("declared in the bundle configuration").

Tests

  • TestResourceMetadataCoversAllResourceTypes puts one resource of every type in config.Resources and asserts each is reported, so a type dropping out of AllResources() fails loudly.
  • Unit tests for counts-from-config with and without state.
  • Regenerated out.resources_metadata.terraform.txt: per-type counts instead of null.

resources_metadata previously reported only what the direct engine's state
contained, so terraform deploys reported nothing at all and the dashboard had
to fall back to the resource_*_count fields. Those cover 12 of the 32 resource
types, which made newer types (job_runs, genie_spaces, alerts, sql_warehouses,
postgres_*, ...) look like zero adoption. The count fields are deprecated in
the universe proto in favour of resources_metadata, so the gap is closed here
rather than by adding 20 more deprecated fields.

Counts now come from Resources.AllResources(), which is exhaustive by
construction, so a new resource type is reported the moment it ships with no
telemetry change. resources_metadata is emitted for terraform deploys too,
carrying counts without state sizes since the terraform path leaves
StateSizeBytes zero. The engine that ran the deploy is recorded on Metrics so
state_engine reflects it.

Also adds .agent/rules/telemetry.md, which documents the procedure and the rule
not to extend the deprecated count fields.
@radakam
radakam marked this pull request as ready for review July 29, 2026 14:12
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

Files: acceptance/bundle/telemetry/deploy/out.resources_metadata.terraform.txt, acceptance/bundle/telemetry/deploy/script
Suggested: @denik
Also eligible: @shreyas-goenka, @pietern, @janniklasrose, @andrewnester, @lennartkats-db, @anton-107

/bundle/ - needs approval

4 files changed
Suggested: @denik
Also eligible: @shreyas-goenka, @pietern, @janniklasrose, @andrewnester, @lennartkats-db, @anton-107

/libs/telemetry/ - needs approval

Files: libs/telemetry/protos/bundle_deploy.go
Suggested: @simonfaltum
Also eligible: @renaudhartert-db, @hectorcast-db, @parthban-db, @tanmay-db, @Divyansh-db, @tejaskochar-db, @mihaimitrea-db, @chrisst, @rauchy

General files (require maintainer)

Files: .agent/rules/telemetry.md, .cursor/rules/telemetry.mdc
Based on git history:

  • @denik -- recent work in bundle/phases/, bundle/, .agent/rules/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 4d757ac

Run: 30461379966

Env ❌​FAIL 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
❌​ aws linux 3 1 3 4 319 1065 5:38
❌​ aws windows 3 1 3 4 321 1063 6:50
❌​ azure linux 3 1 3 4 319 1064 5:29
❌​ azure windows 3 1 3 4 321 1062 6:51
💚​ gcp linux 1 5 321 1066 5:00
💚​ gcp windows 1 5 323 1064 5:39
11 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 1 KNOWN
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 💚​R 💚​R
❌​ TestAccept/bundle/deploy/mlops-stacks ❌​F ❌​F ❌​F ❌​F ✅​p ✅​p
❌​ TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct ❌​F ❌​F ❌​F ❌​F ✅​p ✅​p
❌​ TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform ❌​F ❌​F ❌​F ❌​F ✅​p ✅​p
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 2 slowest tests (at least 2 minutes):
duration env testname
3:20 gcp windows TestAccept
2:10 gcp windows TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform

radakam added 2 commits July 29, 2026 14:26
Trim the comments added for resources_metadata to the load-bearing facts: why
counts come from the configuration, why sizes are direct-only, and why the
acceptance golden is split per engine.
Twelve of the deprecated fields are per-type; the thirteenth is the aggregate
resource_count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants