KQL · dependencies
Outbound HTTP calls by target host
Call volume, p95 duration and failures for every host your app calls over HTTP in the last 24 hours, busiest first, sampling-adjusted.
dependencies dependencies
let lookback = 24h;
dependencies
| where timestamp > ago(lookback)
| where type startswith "http"
| summarize
calls = sum(itemCount),
p95_ms = percentilew(duration, itemCount, 95),
failed = sumif(itemCount, tostring(success) =~ "false"),
callers = dcount(cloud_RoleName)
by target
| extend failed_pct = round(100.0 * failed / calls, 2)
| order by calls desc Returns: One row per outbound HTTP target with its call count, p95 duration in milliseconds, failed calls and percentage, and how many of your services call it, busiest first.
Pitfalls
- startswith is case-insensitive, so the filter catches HTTP, Http and similar type names. Check your own type values first with dependencies | summarize sum(itemCount) by type.
- target is the host as recorded, sometimes with a port. The same service reached as api.example.net and api.example.net:443 shows up twice.
- Browser AJAX calls recorded by the JavaScript SDK are dependencies too, with their own type name. Filter on cloud_RoleName if you only want server-side calls.
- Calls and failures use sum(itemCount); a raw row count understates them under sampling.
How it works
Every service has a list of other services it can’t live without, and it is rarely written down. This query writes it down: every host your app calls over HTTP, how often, how fast for the slowest 5% of calls, and how often those calls fail. Run it before a migration, a firewall change or a vendor review, and whenever you want to know what a slow request was waiting on.
Line by line
where type startswith "http"keeps HTTP dependency calls. The data model gives HTTP as an example of the low-cardinality dependency type;startswithignores case, so it matches the variants different SDKs write.calls = sum(itemCount)counts calls the sampling-aware way.p95_ms = percentilew(duration, itemCount, 95)is the duration one call in twenty exceeds, in milliseconds, weighted for sampling.failedandfailed_pctcount failed calls and their share.callers = dcount(cloud_RoleName)counts how many of your services call the host. A host with five callers is shared infrastructure; an outage there is felt everywhere.by targetgroups by destination. The data model describestargetas the target site of the call, such as a server name or host address. For calls between your own services,targeton the caller’s side andsourceon the callee’s request are the fields Microsoft documents for stitching components together.
Reading the result
The busiest hosts are your critical path. Look for a high p95 on a busy host (worth a cache or a timeout review), failures concentrated on one host, and hosts you didn’t expect, such as a third-party script endpoint called from the server or a test environment’s URL left in production configuration.
For the slowest destinations across all dependency types, use slowest dependencies by target. The correlation and Application Map guide shows how these targets become edges on the map.
Variations
- One host by route: add
| where target == "api.example.net"and group byoperation_Nameinstead oftarget. - Over time: group by
bin(timestamp, 15m), targetfor the top hosts and add| render timechart. - Workspace tables: use
AppDependencies,TimeGenerated,DependencyType,Target,DurationMs,Success,AppRoleNameandItemCount.
Sources, checked
- Application Insights telemetry data model (dependency target and type)
- percentilew(), percentilesw() (Kusto)
- dcount() (Kusto)
- Migrate an Application Insights classic resource to a workspace-based resource (table schemas)
- Application Insights Classic API 2.x (correlation, request source and dependency target)