Skip to content
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

Emit stats for the teamcity file share #63

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

matt-richardson
Copy link
Contributor

@matt-richardson matt-richardson commented Feb 13, 2024

We want to be able to track and alert on teamcity storage account exhaustion.

But, we cant get it out from azure via the standard metrics pipeline (via sumo), as it's not available :(

This PR adds a few new metrics:

  • build_storage_total_capacity
  • build_storage_used_capacity
  • build_storage_available_capacity

It should be able to use managed identity to get these values, and needs these env vars to work:

  • AZURE_FILE_SHARE_RESOURCE_GROUP_NAME
  • AZURE_FILE_SHARE_STORAGE_ACCOUNT_NAME
  • AZURE_FILE_SHARE_SUBSCRIPTION_ID
  • AZURE_FILE_SHARE_STORAGE_SHARE_NAME

[sc-46017]

@matt-richardson matt-richardson self-assigned this Feb 13, 2024
@matt-richardson matt-richardson requested a review from a team as a code owner February 13, 2024 03:26
Copy link
Contributor

@cailyoung cailyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one question


return new StorageStatistics(totalCapacityInBytes, shareUsageInBytes);
}
catch (Exception ex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should this behave if we forget to configure the environment values above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will return null, and then we'll get 0's coming out of it, which I think we could alert on.
I considered going 💥, but thought this was wiser

@matt-richardson matt-richardson merged commit b8e7679 into main Feb 13, 2024
5 checks passed
@matt-richardson matt-richardson deleted the mattr/rsb/storage-stats branch February 13, 2024 03:55
Copy link

This pull request has been linked to Shortcut Story #46017: Configure disk space alert for TeamCity Production.

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