NP007
NP007

Reputation: 688

How to Setup Alert on Azure SQL MI instance for % storage space used?

We need to setup Alert if 80% of space used by Azure SQL MI instance then it should be alerted. In existing Alert metrics not provide option to use value in percentage(%). So anyone have any idea how we can setup alert on % space used by azure mi?

Upvotes: 2

Views: 982

Answers (2)

Paolo
Paolo

Reputation: 26074

If you have defined diagnostic settings such that the SQLMI sends its metrics to a log analytics workspace, you can use a log search alert:

AzureMetrics
| extend p = pack(MetricName, Average)
| summarize bag = make_bag(p) by TimeGenerated
| evaluate bag_unpack(bag)
| extend reserved_storage = reserved_storage_mb
| extend used_storage = storage_space_used_mb
| extend storage_used_percentage = round(100.0 * used_storage / reserved_storage)
| project TimeGenerated, storage_used_percentage, reserved_storage, used_storage
| where storage_used_percentage >= 80

Upvotes: 1

vijaya
vijaya

Reputation: 1721

As of now, the available options for setting alerts for managed instance are below only as mentioned in document,

  • Average CPU percentage
  • IO bytes read
  • IO bytes written
  • IO requests count
  • Storage space reserved
  • Storage space used
  • Virtual core count enter image description here Storage alerts are available as of now are in count format only. Percentage is not available by default from azure. If you want to calculate available space in sql MI refer this so thread

Upvotes: 1

Related Questions