Skip to content

Instantly share code, notes, and snippets.

@joelverhagen
Created October 1, 2023 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelverhagen/eb3b10d430646a8ae2a710392185ee0e to your computer and use it in GitHub Desktop.
Save joelverhagen/eb3b10d430646a8ae2a710392185ee0e to your computer and use it in GitHub Desktop.
Determine what telemetry is taking up the most space in Application Insights
let since = ago(1d);
let bucket = 5m;
let dt = datatable(table: string)[];
dt
| union (availabilityResults | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "availabilityResults")
| union (browserTimings | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "browserTimings")
| union (customEvents | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "customEvents")
| union (customMetrics | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "customMetrics")
| union (dependencies | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "dependencies")
| union (exceptions | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "exceptions")
| union (pageViews | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "pageViews")
| union (performanceCounters | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "performanceCounters")
| union (requests | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "requests")
| union (traces | where timestamp > since | summarize sum(estimate_data_size(*)) by bin(timestamp, bucket), cloud_RoleName | extend table = "traces")
| summarize max(sum_) by timestamp, strcat(cloud_RoleName, " ", table)
| render columnchart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment