Fix FinOps CPU right-sizing for Azure SQL Database (#735)#736
Merged
erikdarlingdata merged 1 commit intoerikdarlingdata:devfrom Mar 27, 2026
Merged
Conversation
Owner
|
Thanks for the fix — the approach looks good and we're ready to merge once you rebase onto current dev. There's a merge conflict in
Everything else is clean — no other conflicts expected. |
erikdarlingdata#735) - Query sys.database_service_objectives for per-database vCore count when engine_edition = 5 (Azure SQL Database) - Parse vCore count from service_objective name (e.g. HS_PRMS_14 = 14) - Add vcore_count column to server_properties DuckDB schema - Use COALESCE(vcore_count, cpu_count) in FinOps queries so Azure SQL DB uses correct per-database vCores while on-prem is unchanged - Add schema migration for existing databases - Add Azure SQL DB test data seeder scenario Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ade2064 to
7e7ce6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sys.dm_os_sys_info.cpu_countreports the compute node's total CPU count, not the per-database vCore allocation. This causes FinOps CPU right-sizing to show incorrect "overprovisioned" recommendations when multiple databases share a logical server.sys.database_service_objectivesfor Azure SQL DB (engine_edition = 5), while preserving existingcpu_countbehavior for on-prem and Azure Managed Instance.Changes
RemoteCollectorService.ServerProperties.cssys.database_service_objectiveson Azure SQL DB, parse vCore count from service objective nameSchema.csvcore_countcolumn toserver_propertiestable definitionDuckDbInitializer.csvcore_countto existing databasesLocalDataService.FinOps.csCOALESCE(vcore_count, cpu_count)in CPU right-sizing queriesDuckDbFactCollector.csvcore_countfor fact collectionTestDataSeeder.csFixes #735
Test plan
vcore_countper database via CLI query🤖 Generated with Claude Code