OpenapiO11y
Returns one metric's raw time series over a window of at most thirty minutes —…
Returns one metric's raw time series over a window of at most thirty minutes — each series with its labels and timestamp/value pairs.
POST /v1/o11y/metrics/inspect
| Address | https://api.hanzo.ai/v1/o11y/metrics/inspect |
| Method | POST |
| Operation | InspectMetrics |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns one metric's raw time series over a window of at most thirty minutes — each series with its labels and timestamp/value pairs.
Request
5 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
end | body | integer | yes | End is the end of the window as a Unix timestamp in milliseconds, at most thirty minutes after start. |
filter | body | o11y.O11yMetricFilter | — | |
filter.expression | body | string | — | Expression is the filter, in the query-builder filter syntax. |
metricName | body | string | yes | MetricName is the metric to inspect. |
start | body | integer | yes | Start is the start of the window as a Unix timestamp in milliseconds. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | o11y.O11yMetricInspectOut | ok |
200 body — 17 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
data | body | o11y.O11yMetricSeriesSet | — | |
data.series | body | o11y.O11yMetricSeries[] | — | Series are the time series. |
data.series[].labels | body | o11y.O11yMetricLabel[] | — | Labels identify the series. |
data.series[].labels[].key | body | o11y.O11yMetricField | — | |
data.series[].labels[].key.description | body | string | — | Description describes the field. |
data.series[].labels[].key.fieldContext | body | string | — | FieldContext is the context the field lives in, e.g. |
data.series[].labels[].key.fieldDataType | body | string | — | FieldDataType is the field's data type. |
data.series[].labels[].key.name | body | string | — | Name is the field's name. |
data.series[].labels[].key.signal | body | string | — | Signal is the telemetry signal the field belongs to. |
data.series[].labels[].key.unit | body | string | — | Unit is the field's unit. |
data.series[].labels[].value | body | object | — | Value is the label's value. |
data.series[].values | body | o11y.O11yMetricPoint[] | — | Values are the series' points, in time order. |
data.series[].values[].partial | body | boolean | — | Partial marks a point whose bucket the window only partly covers. |
data.series[].values[].timestamp | body | integer | — | Timestamp is the point's time as a Unix timestamp in milliseconds. |
data.series[].values[].value | body | number | — | Value is the point's value. |
data.series[].values[].values | body | number[] | — | Values carries the bucket values of a heatmap point. |
status | body | string | — | Status is "success". |
Failure carries the platform error shape — see Errors.
Examples
hanzo o11y metrics inspect \
--end 0 \
--metric-name <metricName> \
--start 0import { Configuration, O11yApi } from 'hanzoai';
const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.inspectMetrics({ metricName: "<metricName>", start: 0, end: 0 });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).inspect_metrics(metric_name="<metricName>", start=0, end=0)cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.O11yAPI.InspectMetrics(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::inspect_metrics(&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).inspectMetrics();curl -X POST https://api.hanzo.ai/v1/o11y/metrics/inspect \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metricName": "<metricName>",
"start": 0,
"end": 0
}'Tool o11y, op InspectMetrics — 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": "InspectMetrics",
"input": {
"metricName": "<metricName>",
"start": 0,
"end": 0
}
}
}
}'How is this guide?