Scalar FunctionsDynamic / JSON Functions
summarize_graph
Collapse a canonical `{nodes, edges}` graph (from `make_graph`) by a node
Syntax
summarize_graph(g, key, aggs)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1
spans
| summarize g = make_graph(
span_id,
parent_span_id,
start_time,
"service",
resource.service.name,
"errors",
status_code == "ERROR"
)
by trace_id
| project g = summarize_graph(g, "service", "countif:errors")| g (dynamic) |
|---|
| {"edges":[],"nodes":[{"attrs":{"errors":0},"count":2,"id":"unknown","time":1704103260000000000}]} |
| {"edges":[],"nodes":[{"attrs":{"errors":0},"count":2,"id":"unknown","time":1704103320000000000}]} |
| {"edges":[],"nodes":[{"attrs":{"errors":0},"count":5,"id":"unknown","time":1704103200000000000}]} |
set_union
Return the distinct elements from all dynamic-array arguments,
treepath
Enumerate the JSON paths (in bracket notation) reachable inside a dynamic value. Each bag key contributes `['key']`; each array contributes a single `[0]` describing its shape (not every index). Returns an empty array for nulls, scalars, and empty property bags.