Share via


Lekérdezések az ApiManagementGatewayLogs táblához

Kérelmek száma

Az elmúlt 24 órában az összes API-ra irányuló hívások teljes számának megszámlálása.

//Total number of call per resource
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by _ResourceId 

Az elmúlt 100 hívás naplói

Kérje le az elmúlt 24 órában a legutóbbi 100 hívás naplóit.

ApiManagementGatewayLogs
| top 100 by TimeGenerated desc 

Hívások száma API-k szerint

Megtekintheti az API-nkénti hívások számát az elmúlt 24 órában.

//Calls by API ID
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by ApiId

Felhasznált sávszélesség

Az elmúlt 24 órában felhasznált teljes sávszélesség.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| extend bandwidth = RequestSize + ResponseSize 
| summarize sum(bandwidth) by bin(TimeGenerated, 15m), _ResourceId 
| render timechart 

Kérelmek méretei

A kérésméretek statisztikái az elmúlt 24 órában.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Average=avg(RequestSize), Median=percentile(RequestSize, 50), 90th_Percentile=percentile(RequestSize, 90) by bin(TimeGenerated, 5m) 
| render timechart 

Válaszméretek

A válaszméretek statisztikái az elmúlt 24 órában.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Average=avg(ResponseSize), Median=percentile(ResponseSize, 50), 90th_Percentile=percentile(ResponseSize, 90) by bin(TimeGenerated, 5m) 
| render timechart 

Ügyfél TLS-verziói

Az ügyfél TLS-verzióinak lebontása az elmúlt 24 órában.

ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by ClientTlsVersion, _ResourceId 

Hiba okainak lebontása

Az elmúlt 24 óra összes hiba okának részletezése.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| summarize count(CorrelationId) by LastErrorReason, _ResourceId

Az elmúlt 100 sikertelen kérés

Kérje le az utolsó 100 sikertelen kérés naplóit.

ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| top 100 by TimeGenerated desc| where ResponseCode >= 400

Kérje le a háttérbeli problémák miatt meghiúsult kérések naplóit.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| where BackendResponseCode >= 400

Kérje le a nem a háttérrendszerrel kapcsolatos problémák miatt meghiúsult kérések naplóit (pl. API Mangement-szabályzatok konfigurálása, sebességkorlát túllépése, ügyfél leválasztása).

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| where isnull(BackendResponseCode) or BackendResponseCode < 400
| where ResponseCode >= 400

Teljes késés

Az API Mangement kérés fogadásának kezdete és a válasz ügyfélnek való visszaküldésének API Management befejeződése közötti teljes késés (miliseconds) statisztikája.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Average=avg(TotalTime), Median=percentile(TotalTime, 50), 90th_Percentile=percentile(TotalTime, 90) by bin(TimeGenerated, 15m) 
| render timechart 

Háttérbeli késés

A háttérbeli I/O-ban töltött idő statisztikája (miliseconds).

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Average=avg(BackendTime), Median=percentile(BackendTime, 50), 90th_Percentile=percentile(BackendTime, 90) by bin(TimeGenerated, 15m) 
| render timechart 

Ügyfélkésés

Az ügyfél I/O-jában töltött idő statisztikája (miliseconds).

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Average=avg(ClientTime), Median=percentile(ClientTime, 50), 90th_Percentile=percentile(ClientTime, 90) by bin(TimeGenerated, 15m) 
| render timechart 

Gyorsítótár találati aránya

A gyorsítótár találati/kihagyási arányának statisztikája.

// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize Cache_Miss=countif(Cache  == "miss"), Cache_Hit=countif(Cache == "hit") by bin(TimeGenerated, 15m)
| extend Ratio=Cache_Hit / (Cache_Hit + Cache_Miss)
| project-away Cache_Hit , Cache_Miss 
| render timechart