استعلامات لجدول AzureMetrics
للحصول على معلومات حول استخدام هذه الاستعلامات في مدخل Microsoft Azure، راجع البرنامج التعليمي Log Analytics. للحصول على واجهة برمجة تطبيقات REST، راجع الاستعلام.
مخطط دائري برموز استجابة HTTP
توزيع رموز الاستجابة لكل مقياس، على مدى آخر 12 ساعة.
AzureMetrics
| where TimeGenerated > ago(12h)
| where MetricName in ("Http2xx", "Http3xx", "Http4xx", "Http5xx")
| summarize sum(Total) by MetricName
| render piechart
مخطط خطي أوقات الاستجابة
سلسلة زمنية من متوسط وقت الاستجابة (أكثر من 5 دقائق).
AzureMetrics
| extend timeBin = bin(TimeGenerated, 5m)
| summarize ResponseTime = sumif(Average, MetricName=="AverageResponseTime") by timeBin, bin(TimeGenerated, 1h)
| sort by TimeGenerated desc
| render timechart
[كلاسيكي] البحث في AzureMetrics
[كلاسيكي] ابحث في AzureMetrics للبحث عن قيمة معينة في جدول AzureMetrics./nNote أن هذا الاستعلام يتطلب تحديث معلمة <SeachValue> للحصول على نتائج
// This query requires a parameter to run. Enter value in SearchValue to find in table.
let SearchValue = "<SearchValue>";//Please update term you would like to find in the table.
AzureMetrics
| where * contains tostring(SearchValue)
| take 1000
أحدث المقاييس
إظهار أحدث تقارير المقاييس لكل مقياس تم الإبلاغ عنه.
AzureMetrics
| summarize arg_max(TimeGenerated, UnitName, Total, Count, Maximum, Minimum, Average) by MetricName
البحث في AzureMetrics
ابحث في AzureMetrics للبحث عن قيمة معينة في جدول AzureMetrics./nNote أن هذا الاستعلام يتطلب تحديث معلمة <SeachValue> للحصول على نتائج
// This query requires a parameter to run. Enter value in SearchValue to find in table.
let SearchValue = "<SearchValue>";//Please update term you would like to find in the table.
AzureMetrics
| where * contains tostring(SearchValue)
| take 1000
رسم بياني لنسبة استخدام الشبكة لدائرة ExpressRoute BitsInPerSecond
رسم بياني لنسبة استخدام الشبكة BitsInPerSecond (آخر ساعة).
AzureMetrics
| where MetricName == "BitsInPerSecond"
| summarize by Average, bin(TimeGenerated, 1h), Resource
| render timechart
رسم بياني لنسبة استخدام الشبكة لدائرة ExpressRoute BitsOutPerSecond
رسم بياني لنسبة استخدام الشبكة BitsOutPerSecond (آخر ساعة).
AzureMetrics
| where MetricName == "BitsOutPerSecond"
| summarize by Average, bin(TimeGenerated, 1h), Resource
| render timechart
رسم بياني لدائرة ExpressRoute ArpAvailablility
رسم بياني لنسبة استخدام الشبكة ل ArpAvailability (5 دقائق).
AzureMetrics
| where MetricName == "ArpAvailability"
| summarize by Average, bin(TimeGenerated, 5m), Resource
| render timechart
توفر ExpressRoute Circuit BGP
رسم بياني لنسبة استخدام الشبكة ل BgpAvailability (5 دقائق).
AzureMetrics
| where MetricName == "BgpAvailability"
| summarize by Average, bin(TimeGenerated, 5m), Resource
| render timechart
متوسط استخدام وحدة المعالجة المركزية
متوسط استخدام وحدة المعالجة المركزية في الساعة الأخيرة حسب اسم المورد.
//consistently high averages could indicate a customer needs to move to a larger SKU
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL" // /DATABASES
| where TimeGenerated >= ago(60min)
| where MetricName in ('cpu_percent')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource // subtract Resource name for _ResourceId
| summarize CPU_Maximum_last15mins = max(Maximum), CPU_Minimum_last15mins = min(Minimum), CPU_Average_last15mins = avg(Average) by Resource , MetricName
استكشاف أخطاء الأداء وإصلاحها
من المحتمل أن يكون الاستعلام أو التوقف التام على النظام الذي قد يؤدي إلى ضعف الأداء.
//potentially a query or deadlock on the system that could lead to poor performance
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >=ago(60min)
| where MetricName in ('deadlock')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource // subtract Resource name for _ResourceId
| summarize Deadlock_max_60Mins = max(Maximum) by Resource, MetricName
تحميل بيانات
مراقبة تحميل البيانات في الساعة الأخيرة.
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| where MetricName in ('log_write_percent')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource// subtract Resource name for _ResourceId
| summarize Log_Maximum_last60mins = max(Maximum), Log_Minimum_last60mins = min(Minimum), Log_Average_last60mins = avg(Average) by Resource, MetricName
عدد اتصالات P2S
عدد اتصالات P2S النشطة لآخر 30 يوما.
AzureMetrics
| where TimeGenerated > ago(30d)
| where MetricName == "P2SConnectionCount"
| summarize by Maximum, bin(TimeGenerated,1h), Resource
| render timechart
استخدام عرض النطاق الترددي P2S
متوسط استخدام عرض النطاق الترددي P2S خلال آخر 12 ساعة بت/ثانية.
AzureMetrics
| where TimeGenerated > ago(24h)
| where MetricName == "P2SBandwidth"
| summarize by Average, bin(TimeGenerated, 1h), Resource
| render timechart
معدل نقل البوابة
إجمالي معدل نقل البوابة بالبايت/ثانية.
AzureMetrics
| where TimeGenerated > ago(24h)
| where MetricName == "AverageBandwidth"
| summarize by Average, bin(TimeGenerated, 1h), Resource
| render timechart
إظهار السجلات من جدول AzureMetrics
يسرد أحدث السجلات في جدول AzureMetrics، الذي تم فرزه حسب الوقت (الأول الأخير).
AzureMetrics
| top 10 by TimeGenerated
إظهار السجلات من جدول AzureMetrics
يسرد أحدث السجلات في جدول AzureMetrics، الذي تم فرزه حسب الوقت (الأول الأخير).
AzureMetrics
| top 10 by TimeGenerated
توفر نظام المجموعة (KeepAlive)
عرض توفر نظام المجموعة خلال الساعة الأخيرة.
// To create an alert for this query, click '+ New alert rule'
AzureMetrics
| where ResourceProvider == "MICROSOFT.KUSTO"
| where TimeGenerated > ago(1d)
| where MetricName == "KeepAlive"
| parse _ResourceId with * "providers/microsoft.kusto/clusters/" cluster_name // Get the cluster name from the ResourceId string
| summarize heartbeat_count = count() by bin(TimeGenerated, 30m), cluster_name // bin is used to set the time grain to 30 minutes
| extend alive=iff(heartbeat_count > 0, true, false)
| sort by TimeGenerated asc // sort the results by time (ascending order)