Create inspect

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

Addresshttps://api.hanzo.ai/v1/o11y/metrics/inspect
MethodPOST
OperationInspectMetrics
AuthAuthorization: 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).

FieldInTypeRequiredDescription
endbodyinteger (int64)yesEnd is the end of the window as a Unix timestamp in milliseconds, at most thirty minutes after start.
filterbodyo11y.O11yMetricFilter—
filter.expressionbodystring—Expression is the filter, in the query-builder filter syntax.
metricNamebodystringyesMetricName is the metric to inspect.
startbodyinteger (int64)yesStart is the start of the window as a Unix timestamp in milliseconds.

Response

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

200 body — 17 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yMetricSeriesSet—
data.seriesbodyo11y.O11yMetricSeries[]—Series are the time series.
data.series[].labelsbodyo11y.O11yMetricLabel[]—Labels identify the series.
data.series[].labels[].keybodyo11y.O11yMetricField—
data.series[].labels[].key.descriptionbodystring—Description describes the field.
data.series[].labels[].key.fieldContextbodystring—FieldContext is the context the field lives in, e.g. resource, attribute.
data.series[].labels[].key.fieldDataTypebodystring—FieldDataType is the field's data type.
data.series[].labels[].key.namebodystring—Name is the field's name.
data.series[].labels[].key.signalbodystring—Signal is the telemetry signal the field belongs to.
data.series[].labels[].key.unitbodystring—Unit is the field's unit.
data.series[].labels[].valuebodyany—Value is the label's value.
data.series[].valuesbodyo11y.O11yMetricPoint[]—Values are the series' points, in time order.
data.series[].values[].partialbodyboolean—Partial marks a point whose bucket the window only partly covers.
data.series[].values[].timestampbodyinteger (int64)—Timestamp is the point's time as a Unix timestamp in milliseconds.
data.series[].values[].valuebodynumber (double)—Value is the point's value.
data.series[].values[].valuesbodynumber (double)[]—Values carries the bucket values of a heatmap point.
statusbodystring—Status is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y metrics inspect \
  --end 0 \
  --metric-name <metricName> \
  --start 0
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.O11yAPI.InspectMetrics(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::inspect_metrics(&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).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
           }
         }
       }
     }'

O11y API · All Hanzo APIs · Interactive reference

Was this page useful?