Skip to content

Commit c3e1574

Browse files
committed
Adding example queries
1 parent 288cec6 commit c3e1574

File tree

391 files changed

+3525
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+3525
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Put alerts in this folder
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Author: Microsoft Azure
2+
// Display name: Cache hit ratio
3+
// Description: Statistics of Cache hit/miss ratio.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Diagnostics
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| summarize Cache_Miss=countif(Cache == "miss"), Cache_Hit=countif(Cache == "hit") by bin(TimeGenerated, 15m)
10+
| extend Ratio=Cache_Hit / (Cache_Hit + Cache_Miss)
11+
| project-away Cache_Hit , Cache_Miss
12+
| render timechart
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Author: Microsoft Azure
2+
// Display name: Client TLS versions
3+
// Description: Breakdown of client TLS versions in the last 24 hours.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Diagnostics
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| summarize count(CorrelationId) by ClientTlsVersion, _ResourceId
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Error reasons breakdown
3+
// Description: Breakdown of all error reasons in the last 24 hours.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Errors
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| where IsRequestSuccess == false
10+
| summarize count(CorrelationId) by LastErrorReason, _ResourceId
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Author: Microsoft Azure
2+
// Display name: Get failed requests due to issues not related to the backend
3+
// Description: Get the logs of failed requests due to issues not related to the backend (e.g., API Mangement policies configuration, rate limit exceeded, client disconnection).
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Errors
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| where IsRequestSuccess == false
10+
| where isnull(BackendResponseCode) or BackendResponseCode < 400
11+
| where ResponseCode >= 400
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Get failed requests due to issues related to the backend
3+
// Description: Get the logs of failed requests due to backend issues.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Errors
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| where IsRequestSuccess == false
10+
| where BackendResponseCode >= 400
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Last 100 failed requests
3+
// Description: Get the logs of the last 100 failed requests.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Errors
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| where IsRequestSuccess == false
10+
| top 100 by TimeGenerated desc| where ResponseCode >= 400
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Backend latency
3+
// Description: Statistics of time (in miliseconds) spent in backend IO.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Latency
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| summarize Average=avg(BackendTime), Median=percentile(BackendTime, 50), 90th_Percentile=percentile(BackendTime, 90) by bin(TimeGenerated, 15m)
10+
| render timechart
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Client latency
3+
// Description: Statistics of time (in miliseconds) spent in client IO.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Latency
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| summarize Average=avg(ClientTime), Median=percentile(ClientTime, 50), 90th_Percentile=percentile(ClientTime, 90) by bin(TimeGenerated, 15m)
10+
| render timechart
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Author: Microsoft Azure
2+
// Display name: Overall latency
3+
// Description: Statistics of overall latency (in miliseconds) between the time API Mangement starts receiving a request and the time API Management finishes sending the response back to the client.
4+
// Categories: ['resources']
5+
// Resource types: ['API Management services']
6+
// Topic: Latency
7+
ApiManagementGatewayLogs
8+
| where TimeGenerated > ago(1d)
9+
| summarize Average=avg(TotalTime), Median=percentile(TotalTime, 50), 90th_Percentile=percentile(TotalTime, 90) by bin(TimeGenerated, 15m)
10+
| render timechart

0 commit comments

Comments
 (0)