"use strict";(self.webpackChunkelementary_public_docs=self.webpackChunkelementary_public_docs||[]).push([[60490],{15680:(e,t,n)=>{n.d(t,{xA:()=>y,yg:()=>s});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),m=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},y=function(e){var t=m(e.components);return a.createElement(i.Provider,{value:t},e.children)},o="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,i=e.parentName,y=g(e,["components","mdxType","originalType","parentName"]),o=m(n),d=r,s=o["".concat(i,".").concat(d)]||o[d]||u[d]||l;return n?a.createElement(s,p(p({ref:t},y),{},{components:n})):a.createElement(s,p({ref:t},y))}));function s(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,p=new Array(l);p[0]=d;var g={};for(var i in t)hasOwnProperty.call(t,i)&&(g[i]=t[i]);g.originalType=e,g[o]="string"==typeof e?e:r,p[1]=g;for(var m=2;m{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>g,default:()=>N,frontMatter:()=>p,metadata:()=>i,toc:()=>y});var a=n(58168),r=(n(96540),n(15680)),l=n(96763);const p={sidebar_position:7},g="\u67e5\u8be2\u6307\u6807",i={unversionedId:"developer-tools/cms/openapi/query-metrics",id:"developer-tools/cms/openapi/query-metrics",title:"\u67e5\u8be2\u6307\u6807",description:"\u63a5\u53e3\u63cf\u8ff0",source:"@site/docs/developer-tools/cms/openapi/query-metrics.md",sourceDirName:"developer-tools/cms/openapi",slug:"/developer-tools/cms/openapi/query-metrics",permalink:"/help/docs/developer-tools/cms/openapi/query-metrics",draft:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/developer-tools/cms/openapi/query-metrics.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\u83b7\u53d6\u9762\u677f\u5217\u8868",permalink:"/help/docs/developer-tools/cms/openapi/list-panel"},next:{title:"\u521b\u5efa\u65e5\u5fd7\u5bfc\u51fa\u4efb\u52a1",permalink:"/help/docs/developer-tools/cms/openapi/create-log-export-job"}},m={},y=[{value:"\u63a5\u53e3\u63cf\u8ff0",id:"\u63a5\u53e3\u63cf\u8ff0",level:2},{value:"\u8bf7\u6c42\u5934\uff08Request Header\uff09",id:"\u8bf7\u6c42\u5934request-header",level:2},{value:"\u8bf7\u6c42\u53c2\u6570\uff08Request Parameters\uff09",id:"\u8bf7\u6c42\u53c2\u6570request-parameters",level:2},{value:"\u8bf7\u6c42\u4f53\uff08Request Body\uff09",id:"\u8bf7\u6c42\u4f53request-body",level:2},{value:"\u8bf7\u6c42\u793a\u4f8b\uff08Request Example\uff09",id:"\u8bf7\u6c42\u793a\u4f8brequest-example",level:2},{value:"\u54cd\u5e94\uff08Response\uff09",id:"\u54cd\u5e94response",level:2},{value:"\u54cd\u5e94\u793a\u4f8b\uff08Response Example\uff09",id:"\u54cd\u5e94\u793a\u4f8bresponse-example",level:2}],o=(u="ApiLinkRegion",function(e){return l.warn("Component "+u+" was not imported, exported, or provided by MDXProvider as global scope"),(0,r.yg)("div",e)});var u;const d={toc:y},s="wrapper";function N(e){let{components:t,...n}=e;return(0,r.yg)(s,(0,a.A)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"\u67e5\u8be2\u6307\u6807"},"\u67e5\u8be2\u6307\u6807"),(0,r.yg)("h2",{id:"\u63a5\u53e3\u63cf\u8ff0"},"\u63a5\u53e3\u63cf\u8ff0"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"POST")),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"/monitor/ts/data/v1/subscriptions/:subscription_name/resourceGroups/:resource_group_name/zones/:zone/telemetryStations/:telemetry_station_name/dashboards/:dashboard_name/panels/:panel_name/metrics")),(0,r.yg)("p",null,"\u67e5\u8be2\u6307\u6807"),(0,r.yg)(o,{apiType:"cms",mdxType:"ApiLinkRegion"},(0,r.yg)("a",{href:"/docs/API/cms/workspace-service-query-metrics",className:"but_to_APi"},"\u8c03\u8bd5\u63a5\u53e3")),(0,r.yg)("h2",{id:"\u8bf7\u6c42\u5934request-header"},"\u8bf7\u6c42\u5934\uff08Request Header\uff09"),(0,r.yg)("p",null,"\u53c2\u8003",(0,r.yg)("a",{parentName:"p",href:"/help/docs/developer-tools/cms/openapi/authentication"},"\u8ba4\u8bc1\uff08authentication\uff09")),(0,r.yg)("h2",{id:"\u8bf7\u6c42\u53c2\u6570request-parameters"},"\u8bf7\u6c42\u53c2\u6570\uff08Request Parameters\uff09"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u5fc5\u987b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u4f4d\u7f6e"),(0,r.yg)("th",{parentName:"tr",align:null},"\u9ed8\u8ba4\u503c"),(0,r.yg)("th",{parentName:"tr",align:null},"\u53d6\u503c\u8303\u56f4"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"subscription_name"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"path"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u8ba2\u9605")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"resource_group_name"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"path"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u8d44\u6e90\u7ec4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"zone"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"path"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u53ef\u7528\u533a")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"telemetry_station_name"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"path"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u76d1\u63a7\u7a7a\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"dashboard_name"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u5426"),(0,r.yg)("td",{parentName:"tr",align:null},"query"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u4eea\u8868\u677f\u540d\u79f0")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"panel_name"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u5426"),(0,r.yg)("td",{parentName:"tr",align:null},"query"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u4eea\u8868\u677f\u540d\u79f0")))),(0,r.yg)("h2",{id:"\u8bf7\u6c42\u4f53request-body"},"\u8bf7\u6c42\u4f53\uff08Request Body\uff09"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"start"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u5f00\u59cb\u65f6\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"end"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u7ed3\u675f\u65f6\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"step"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6307\u6807\u95f4\u9694\u6b65\u957f\uff0c\u79d2\uff08\u598260=1min\uff0c300=5min\uff09\u3002\u5f53\u83b7\u53d6\u7684panel\u4e3a\u5373\u65f6\u503c\u65f6\uff0c\u8be5\u53c2\u6570\u65e0\u7528\uff1b\u9700\u6ee1\u8db3(end-start)/step<11000")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"range_align"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u65f6\u95f4\u6821\u51c6\u5bf9\u9f50\uff0c\u6839\u636estep\uff0c\u8c03\u6574\u6821\u51c6start\uff0cend time\u53d6\u6574\uff0c\u9ed8\u8ba4false")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"query_filter"),(0,r.yg)("td",{parentName:"tr",align:null},"QueryFilter"),(0,r.yg)("td",{parentName:"tr",align:null},"\u67e5\u8be2\u8fc7\u6ee4\u5668")))),(0,r.yg)("p",null,"\u5176\u4e2d",(0,r.yg)("inlineCode",{parentName:"p"},"QueryFilter"),"\u5982\u4e0b:"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"resource_id"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u8d44\u6e90\u7684\u8d44\u6e90\u7ba1\u7406\u5668\u6807\u8bc6\u7b26")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"filters"),(0,r.yg)("td",{parentName:"tr",align:null},"map"),(0,r.yg)("td",{parentName:"tr",align:null},"\u7b5b\u9009\u6761\u4ef6")))),(0,r.yg)("h2",{id:"\u8bf7\u6c42\u793a\u4f8brequest-example"},"\u8bf7\u6c42\u793a\u4f8b\uff08Request Example\uff09"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-shell"},'curl -XPOST \'https://monitor.sensecoreapi.tech/monitor/ts/data/v1/subscriptions/224bae0c-a98f-41f5-b5d3-9f54aa98455f/resourceGroups/default/zones/cn-sh-01z/telemetryStations/ts-user-a95a77a3-961f-43fa-9577-d5c8a2cb0149/dashboards/aec2_summery/panels/Aec2InfinibandTotal/metrics\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "query_filter":\n {\n "resource_id":\n [\n "11043a95-f658-11ee-bb04-428fd376ea51"\n ],\n "filters":\n {}\n },\n "range_align": true,\n "start": 1712632270,\n "end": 1712661070,\n "step": 300\n}\'\n')),(0,r.yg)("h2",{id:"\u54cd\u5e94response"},"\u54cd\u5e94\uff08Response\uff09"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"metrics"),(0,r.yg)("td",{parentName:"tr",align:null},"[]MetricsResult"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6307\u6807\u7ed3\u679c")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"start"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u5f00\u59cb\u65f6\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"end"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u7ed3\u675f\u65f6\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"step"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6307\u6807\u95f4\u9694\u6b65\u957f\uff0c\u79d2\uff08\u598260=1min\uff0c300=5min\uff09\u3002\u5f53\u83b7\u53d6\u7684panel\u4e3a\u5373\u65f6\u503c\u65f6\uff0c\u8be5\u53c2\u6570\u65e0\u7528\uff1b\u9700\u6ee1\u8db3(end-start)/step<11000")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"range_align"),(0,r.yg)("td",{parentName:"tr",align:null},"int"),(0,r.yg)("td",{parentName:"tr",align:null},"\u65f6\u95f4\u6821\u51c6\u5bf9\u9f50\uff0c\u6839\u636estep\uff0c\u8c03\u6574\u6821\u51c6start\uff0cend time\u53d6\u6574\uff0c\u9ed8\u8ba4false")))),(0,r.yg)("p",null,"\u5176\u4e2d\uff0c",(0,r.yg)("inlineCode",{parentName:"p"},"MetricsResult"),"\u5982\u4e0b\uff1a"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"metrics_attrs"),(0,r.yg)("td",{parentName:"tr",align:null},"map"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6307\u6807\u5c5e\u6027")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"values"),(0,r.yg)("td",{parentName:"tr",align:null},"[]Values"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6307\u6807\u503c")))),(0,r.yg)("p",null,"\u5176\u4e2d\uff0c",(0,r.yg)("inlineCode",{parentName:"p"},"Values"),"\u5982\u4e0b\uff1a"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"metric_time"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u65f6\u95f4")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"values"),(0,r.yg)("td",{parentName:"tr",align:null},"float"),(0,r.yg)("td",{parentName:"tr",align:null},"\u503c")))),(0,r.yg)("h2",{id:"\u54cd\u5e94\u793a\u4f8bresponse-example"},"\u54cd\u5e94\u793a\u4f8b\uff08Response Example\uff09"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "metrics_result": [\n {\n "metrics_attrs": {\n "__name__": "lepton__aec2_node_infiniband_port_data_transmitted_total__byte_per_s"\n },\n "values": [\n {\n "metric_time": "2024-04-09T10:05:00Z",\n "values": 5817.241\n },\n {\n "metric_time": "2024-04-09T10:10:00Z",\n "values": 5876.0566\n }\n ]\n },\n {\n "metrics_attrs": {\n "__name__": "lepton__aec2_node_infiniband_port_data_received_total__byte_per_s"\n },\n "values": [\n {\n "metric_time": "2024-04-09T10:05:00Z",\n "values": 5784.532\n },\n {\n "metric_time": "2024-04-09T10:10:00Z",\n "values": 5870.8257\n }\n ]\n },\n {\n "metrics_attrs": {\n "__name__": "lepton__aec2_node_infiniband_port_data_total__byte_per_s"\n },\n "values": [\n {\n "metric_time": "2024-04-09T10:05:00Z",\n "values": 11601.773\n },\n {\n "metric_time": "2024-04-09T10:10:00Z",\n "values": 11746.882\n }\n ]\n }\n ],\n "start": "1712632500",\n "end": "1712661000",\n "step": 300,\n "range_align": true\n}\n')))}N.isMDXComponent=!0}}]);