-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inputs.sqlserver): adding data and log used space metrics for Azure SQL DB #12126
Conversation
Queried updated according to comments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of minor naming suggestions, looks good otherwise.
) | ||
END AS [available_storage_mb] | ||
END AS [available_storage_mb] | ||
,(SELECT SUM(max_size) * 8 / (1024 * 1024) FROM sys.database_files WHERE type_desc = 'LOG') AS total_log_mb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
,(SELECT SUM(max_size) * 8 / (1024 * 1024) FROM sys.database_files WHERE type_desc = 'LOG') AS total_log_mb | |
,(SELECT SUM(max_size) * 8 / (1024 * 1024) FROM sys.database_files WHERE type_desc = 'LOG') AS max_log_storage_mb |
total_log_mb
might be a bit ambiguous as a name. It's unclear if it refers to total log used size, total log allocated size, or maximum possible log size. Suggested name attempts to be more explicit. It is also consistent with the naming convention used with other columns (availaible_storage_mb
, used_storage_mb
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. So to keep consistent, here my proposal:
max_storage_mb (to replace total_storage_mb) = maximum capacity for data
max_log_mb (to replace max_log_storage_mb) = maximum capacity for transaction log for the database tier
used_space_data_mb = space used within data files
available_storage_mb (keep this name to avoid breaking change) = Remaining free space that can be allocated regarding the maximum space provisioned for the database tier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total_storage_mb
is an existing column, right? If we are keeping available_storage_mb
for backward compatibility reasons, shouldn't we do that for total_storage_mb
too?
The naming convention for all storage-related columns in this query could be improved for consistency and clarity, but in my view, we should prioritize compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, yes total_storage_mb already exists so we can't change it.
Last commit contains change for total_log_mb -> max_log_mb
Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you! |
@dimitri-furman can you give the current state a review? @Trovalo if you have any thoughts on this I would be interested as well. |
I've got nothing to say on the technical side, as Microsoft gave guidance on this one. Honestly, I like more the current one, as it's more precise even if a little out of naming convention |
Co-authored-by: Dimitri Furman <dfurman@microsoft.com>
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Required for all PRs
resolves #11406
Currently, available_storage_mb value doesn't include all available space (only space available in database file). Azure SQL DB available / used space takes into account allocated space as well. 3 new additional metrics related to data and log space usage for each Azure SQL DB including used_space_data_mb / total_log_mb / used_space_log_mb. They allow to compute database real space used and available space for both data and log.