Create waterfall

Returns a trace's waterfall: every span when the trace is small enough, a capped window around the selected span when it is not, with the uncollapsed subtrees the caller asked to keep open.

POST /v1/o11y/traces/{traceId}/waterfall

Addresshttps://api.hanzo.ai/v1/o11y/traces/{traceId}/waterfall
MethodPOST
OperationGetWaterfallV4
AuthAuthorization: Bearer $HANZO_API_KEY

Returns a trace's waterfall: every span when the trace is small enough, a capped window around the selected span when it is not, with the uncollapsed subtrees the caller asked to keep open.

Callers need the viewer role; the runtime's own gate enforces it.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
traceIdpathstringyes
selectedSpanIdbodystring—
uncollapsedSpansbodystring[]—

Response

StatusBodyMeaning
200o11y.O11yTraceWaterfallOutok
202Approvalheld for approval
defaultproblem-detailsrefused

200 body — 51 fields.

FieldInTypeAlwaysDescription
databodyo11y.GettableWaterfallTrace—
data.endTimestampMillisbodyinteger (uint64)—
data.hasMissingSpansbodyboolean—
data.hasMorebodyboolean—
data.rootServiceEntryPointbodystring—
data.rootServiceNamebodystring—
data.spansbodyo11y.WaterfallSpan[]—
data.spans[].attributesbodyobject—
data.spans[].attributes.*bodyany—
data.spans[].db_namebodystring—Calculated fields, derived from the span's attributes.
data.spans[].db_operationbodystring—
data.spans[].duration_nanobodyinteger (uint64)—
data.spans[].eventsbodyo11y.Event[]—
data.spans[].events[].attributeMapbodyobject—
data.spans[].events[].attributeMap.*bodyany—
data.spans[].events[].isErrorbodyboolean—
data.spans[].events[].namebodystring—
data.spans[].events[].timeUnixNanobodyinteger (uint64)—
data.spans[].external_http_methodbodystring—
data.spans[].external_http_urlbodystring—
data.spans[].flagsbodyinteger (uint32)—
data.spans[].has_childrenbodyboolean—
data.spans[].has_errorbodyboolean—
data.spans[].http_hostbodystring—
data.spans[].http_methodbodystring—
data.spans[].http_urlbodystring—
data.spans[].is_remotebodystring—
data.spans[].kind_stringbodystring—
data.spans[].levelbodyinteger (uint64)—
data.spans[].namebodystring—
data.spans[].parent_span_idbodystring—
data.spans[].referencesbodyo11y.OtelSpanRef[]—
data.spans[].references[].refTypebodystring—
data.spans[].references[].spanIdbodystring—
data.spans[].references[].traceIdbodystring—
data.spans[].resourcebodyobject—
data.spans[].resource.*bodystring—
data.spans[].response_status_codebodystring—
data.spans[].span_idbodystring—
data.spans[].status_codebodyinteger (int16)—
data.spans[].status_code_stringbodystring—
data.spans[].status_messagebodystring—
data.spans[].sub_tree_node_countbodyinteger (uint64)—
data.spans[].time_unixbodyinteger (uint64)—
data.spans[].trace_idbodystring—
data.spans[].trace_statebodystring—
data.startTimestampMillisbodyinteger (uint64)—
data.totalErrorSpansCountbodyinteger (uint64)—
data.totalSpansCountbodyinteger (uint64)—
data.uncollapsedSpansbodystring[]—
statusbodystring—Status is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y traces waterfall <traceId>
import { Configuration, O11yApi } from 'hanzoai';

const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getWaterfallV4({ traceId: 'traceId', selectedSpanId: "<selectedSpanId>", uncollapsedSpans: ["<uncollapsedSpans>"] });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import O11yApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = O11yApi(client).get_waterfall_v4(trace_id='traceId', selected_span_id="<selectedSpanId>", uncollapsed_spans=["<uncollapsedSpans>"])
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.O11yAPI.GetWaterfallV4(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, o11y_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = o11y_api::get_waterfall_v4(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.O11yApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new O11yApi(client).getWaterfallV4();
curl -X POST https://api.hanzo.ai/v1/o11y/traces/<traceId>/waterfall \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "selectedSpanId": "<selectedSpanId>",
       "uncollapsedSpans": [
         "<uncollapsedSpans>"
       ]
     }'

Tool o11y, op GetWaterfallV4 — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "o11y",
         "arguments": {
           "op": "GetWaterfallV4",
           "input": {
             "traceId": "<traceId>",
             "selectedSpanId": "<selectedSpanId>",
             "uncollapsedSpans": [
               "<uncollapsedSpans>"
             ]
           }
         }
       }
     }'

O11y API · All Hanzo APIs · Interactive reference

Was this page useful?