OpenapiO11y
Returns a trace's waterfall: every span when the trace is small enough, a…
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…
POST /v1/o11y/traces/{traceId}/waterfall
| Address | https://api.hanzo.ai/v1/o11y/traces/{traceId}/waterfall |
| Method | POST |
| Operation | GetWaterfallV4 |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
traceId | path | string | yes | |
selectedSpanId | body | string | — | |
uncollapsedSpans | body | string[] | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | o11y.O11yTraceWaterfallOut | ok |
200 body — 51 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
data | body | o11y.GettableWaterfallTrace | — | |
data.endTimestampMillis | body | integer | — | |
data.hasMissingSpans | body | boolean | — | |
data.hasMore | body | boolean | — | |
data.rootServiceEntryPoint | body | string | — | |
data.rootServiceName | body | string | — | |
data.spans | body | o11y.WaterfallSpan[] | — | |
data.spans[].attributes | body | object | — | |
data.spans[].attributes.* | body | object | — | |
data.spans[].db_name | body | string | — | Calculated fields https://o11y.io/docs/traces-management/guides/derived-fields-spans |
data.spans[].db_operation | body | string | — | |
data.spans[].duration_nano | body | integer | — | |
data.spans[].events | body | o11y.Event[] | — | |
data.spans[].events[].attributeMap | body | object | — | |
data.spans[].events[].attributeMap.* | body | object | — | |
data.spans[].events[].isError | body | boolean | — | |
data.spans[].events[].name | body | string | — | |
data.spans[].events[].timeUnixNano | body | integer | — | |
data.spans[].external_http_method | body | string | — | |
data.spans[].external_http_url | body | string | — | |
data.spans[].flags | body | integer | — | |
data.spans[].has_children | body | boolean | — | |
data.spans[].has_error | body | boolean | — | |
data.spans[].http_host | body | string | — | |
data.spans[].http_method | body | string | — | |
data.spans[].http_url | body | string | — | |
data.spans[].is_remote | body | string | — | |
data.spans[].kind_string | body | string | — | |
data.spans[].level | body | integer | — | |
data.spans[].name | body | string | — | |
data.spans[].parent_span_id | body | string | — | |
data.spans[].references | body | o11y.OtelSpanRef[] | — | |
data.spans[].references[].refType | body | string | — | |
data.spans[].references[].spanId | body | string | — | |
data.spans[].references[].traceId | body | string | — | |
data.spans[].resource | body | object | — | |
data.spans[].resource.* | body | string | — | |
data.spans[].response_status_code | body | string | — | |
data.spans[].span_id | body | string | — | |
data.spans[].status_code | body | integer | — | |
data.spans[].status_code_string | body | string | — | |
data.spans[].status_message | body | string | — | |
data.spans[].sub_tree_node_count | body | integer | — | |
data.spans[].time_unix | body | integer | — | |
data.spans[].trace_id | body | string | — | |
data.spans[].trace_state | body | string | — | |
data.startTimestampMillis | body | integer | — | |
data.totalErrorSpansCount | body | integer | — | |
data.totalSpansCount | body | integer | — | |
data.uncollapsedSpans | body | string[] | — | |
status | body | string | — | 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.O11yAPI.GetWaterfallV4(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + 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>"
]
}
}
}
}'How is this guide?