Query per la tabella ApiManagementGatewayLogs
Numero di richieste
Contare il numero totale di chiamate in tutte le API nelle ultime 24 ore.
//Total number of call per resource
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by _ResourceId
Log delle ultime 100 chiamate
Ottenere i log delle 100 chiamate più recenti nelle ultime 24 ore.
ApiManagementGatewayLogs
| top 100 by TimeGenerated desc
Numero di chiamate per API
Visualizzare il numero di chiamate per API nelle ultime 24 ore.
//Calls by API ID
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by ApiId
Larghezza di banda utilizzata
Larghezza di banda totale utilizzata nelle ultime 24 ore.
// 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
Dimensioni delle richieste
Statistiche delle dimensioni delle richieste nelle ultime 24 ore.
// 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
Dimensioni della risposta
Statistiche delle dimensioni delle risposte nelle ultime 24 ore.
// 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
Versioni di TLS client
Suddivisione delle versioni TLS del client nelle ultime 24 ore.
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| summarize count(CorrelationId) by ClientTlsVersion, _ResourceId
Scomposizione dei motivi degli errori
Scomposizione di tutti i motivi di errore nelle ultime 24 ore.
// 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
Ultime 100 richieste non riuscite
Ottenere i log delle ultime 100 richieste non riuscite.
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| top 100 by TimeGenerated desc| where ResponseCode >= 400
Ottenere richieste non riuscite a causa di problemi relativi al back-end
Ottenere i log delle richieste non riuscite a causa di problemi back-end.
// To create an alert for this query, click '+ New alert rule'
ApiManagementGatewayLogs
| where TimeGenerated > ago(1d)
| where IsRequestSuccess == false
| where BackendResponseCode >= 400
Ottenere le richieste non riuscite a causa di problemi non correlati al back-end
Ottenere i log delle richieste non riuscite a causa di problemi non correlati al back-end, ad esempio la configurazione dei criteri di gestione API, il limite di velocità superato, la disconnessione del client.
// 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
Latenza complessiva
Statistiche della latenza complessiva (in milisecondi) tra il tempo in cui l'API Mangement inizia a ricevere una richiesta e il tempo Gestione API termina l'invio della risposta al client.
// 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
Latenza back-end
Statistiche del tempo (in milisecondi) trascorse nell'I/O back-end.
// 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
Latenza client
Statistiche del tempo (in milisecondi) trascorse nell'I/O del client.
// 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
Percentuale riscontri cache
Statistiche del rapporto riscontri/mancati riscontri nella cache.
// 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
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per