import{s as jt,n as Gt,o as Ot}from"../chunks/scheduler.a045fce0.js";import{S as Bt,i as Dt,e as a,s,c as u,h as Nt,a as r,d as n,b as l,f as St,g as p,j as o,k as Yt,l as Wt,m as i,n as m,t as h,o as f,p as c}from"../chunks/index.c7f31426.js";import{H as g,E as Kt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.16774317.js";function Vt(st){let d,pe,oe,me,v,he,y,lt=`The Analytics page is like the control center for your deployed models. It tells you in real-time what’s going on, how many users are
calling your models, about hardware usage, latencies, and much more. In this documentation we’ll dive into what each metric means and
how to analyze the graphs.`,fe,w,at='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/1-intro.png" alt="intro"/>',ce,$,rt="In the top bar, you can configure the high level view:",ge,b,ot=`<li>Which replica to view metrics from: either an individual replica or all.</li> <li>If you want to view metrics related to requests, hardware, or timeline of replicas.</li> <li>Which time frame you’ll inspect the metrics, and this setting affects all graphs on the page. You can choose between any of the existing settings from the dropdown, or click-and-drag over any graph for a custom timeframe. You can also enable/disable
auto refresh or view the metrics per replica or all.</li>`,de,T,ut='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/2-config.png" alt="config"/>',ve,x,ye,C,we,M,pt=`The first graph at the top left shows you how many requests your Inference Endpoint has received. By default they are grouped by HTTP response
classes, but by switching the toggle you can view them by individual status. As a reminder the HTTP response classes are:`,$e,H,mt="<li><strong>Informational responses (100-199)</strong>: The server has received your request and is working on it. For example, <code>102 Processing</code> means the server is still handling your request.</li> <li><strong>Successful responses (200-299)</strong>: Your request was received and completed successfully. For example, <code>200 OK</code> means everything worked as expected.</li> <li><strong>Redirection messages (300-399)</strong>: The server is telling your client to look somewhere else for the information or to take another action. For example, <code>301 Moved Permanently</code> means the resource has a new address.</li> <li><strong>Client error responses (400-499)</strong>: There was a problem with the request sent by your client (like a typo in the URL or missing data). For example, <code>404 Not Found</code> means the server couldn’t find what you asked for.</li> <li><strong>Server error responses (500-599)</strong>: The server ran into an issue while trying to process your request. For example, <code>502 Bad Gateway</code> means the server got an invalid response from another server it tried to contact.</li>",be,P,ht=`We recommend checking the <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status" rel="nofollow">MDN web docs</a> for more information on individual
status codes.`,Te,L,ft="The boxes above the graph also show the % of requests in the respective response class.",xe,_,ct='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/3-http-reqs.png" alt="http"/>',Ce,q,Me,k,gt=`Pending requests are requests that have not yet received an HTTP status, meaning they include in-flight requests and requests currently
being processed. If this metric increases too much, it means that your requests are queuing up, and your users have to wait for requests
to finish. In this case you should consider increasing your number of replicas or alternatively use autoscaling, you can read more about
it in the <a href="./autoscaling#scalingbasedonpendingrequests(betafeature)">autoscaling guide</a>`,He,E,dt='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/4-pending-reqs.png" alt="pending"/>',Pe,U,Le,I,vt="From this graph you’ll be able to see how long it takes for your Inference Endpoint to generate a response. Latency is reported as:",_e,R,yt="<li><strong>p99</strong>: meaning that 99% of all requests were faster than this value</li> <li><strong>p95</strong>: meaning that 95% of all requests were faster than this value</li> <li><strong>p90</strong>: meaning that 90% of all requests were faster than this value</li> <li><strong>median</strong>: meaning that 50% of all requests were faster than this value</li>",qe,z,wt=`Usually a good metric is also to look at how big the difference is between the median and p99. The closer the values are to each other, the more
uniform the latency is, whereas if the difference is large, it means that the users of your Inference Endpoint have in general a fast response but
the worst case latencies can be long.`,ke,F,$t='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/5-latency.png" alt="latency"/>',Ee,A,Ue,S,bt=`In the running replica graph, you’ll see how many running replicas you have during a point in time. The red line shows
your current maximum replicas setting.`,Ie,Y,Tt='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/6-running.png" alt="status"/>',Re,j,xt=`For a more advanced view of different statuses for individual replicas, going from <em>pending</em> all the way
to <em>running</em>, you can toggle to the Timeline section. This is very useful to get a sense of how long it takes an Endpoint to become ready to serve requests.`,ze,G,Ct='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/7-timeline.png" alt="advanced"/>',Fe,O,Ae,B,Mt="These four graphs are dedicated to hardware usage. You’ll find:",Se,D,Ht="<li>CPU usage: How much processing power is being used.</li> <li>Memory usage: How much RAM is being used.</li> <li>GPU usage: How much of the GPU’s processing power is being used.</li> <li>GPU Memory (VRAM) usage: How much GPU memory is being used.</li>",Ye,N,Pt='<img src="https://raw.githubusercontent.com/huggingface/hf-endpoints-documentation/main/assets/analytics/8-usage.png" alt="usage"/>',je,W,Lt="By toggling “details” you can either view the average or per replica value for the metric in question.",Ge,K,_t=`If you have autoscaling based on hardware utilization enabled, these are the metrics that determine your autoscaling behaviour. You can
read more about autoscaling <a href="./autoscaling#scalingbasedonhardwareutilization">here</a>`,Oe,V,Be,J,qt='<strong>This feature is currently in Beta. You will need to be subscribed to <a href="https://huggingface.co/pricing" rel="nofollow">Team or Enterprise</a> to take advantage of this feature.</strong>',De,Q,kt="You have the ability to integrate the metrics of your Inference Endpoint(s) to your internal tool.",Ne,X,Et=`Utilizing OpenMetrics, you can create an integration to allow for a more granular view of your Endpoint’s metrics in almost-real-time,
showing for example:`,We,Z,Ut="<li>requests grouped by replica</li> <li>latency distribution of requests</li> <li>hardware metrics for all accelerator types</li>",Ke,ee,It=`OpenMetrics is a standardized format for representing and transmitting time series data, making it easier for systems to consume and
process metrics, ensuring that the data is structured optimally for storage and transport.`,Ve,te,Rt="Further configurations and notifications can be set up for your Endpoints based on these metrics in your internal tool.",Je,ne,Qe,ie,zt="There are a variety of tools that work with OpenMetrics. You’ll need to set up an agent. Here’s some example docs to help get you started:",Xe,se,Ft='<li><a href="https://docs.datadoghq.com/integrations/openmetrics/" rel="nofollow">Datadog</a></li> <li><a href="https://tinyurl.com/e4fypk5m" rel="nofollow">Grafana</a></li>',Ze,le,et,ae,At=`Your organization can sign up for the Team or Enterprise plan <a href="https://huggingface.co/enterprise?subscribe=true" rel="nofollow">here</a> 🚀
For any questions or feature requests, please email us at <a href="mailto:api-enterprise@huggingface.co">api-enterprise@huggingface.co</a>`,tt,re,nt,ue,it;return v=new g({props:{title:"Analytics and Metrics",local:"analytics-and-metrics",headingTag:"h1"}}),x=new g({props:{title:"Understanding the graphs",local:"understanding-the-graphs",headingTag:"h2"}}),C=new g({props:{title:"Number of (HTTP) Requests",local:"number-of-http-requests",headingTag:"h3"}}),q=new g({props:{title:"Pending Requests",local:"pending-requests",headingTag:"h3"}}),U=new g({props:{title:"Latency Distribution",local:"latency-distribution",headingTag:"h3"}}),A=new g({props:{title:"Running Replicas",local:"running-replicas",headingTag:"h3"}}),O=new g({props:{title:"Compute",local:"compute",headingTag:"h3"}}),V=new g({props:{title:"Create an integration with the Inference Endpoints Metrics API",local:"create-an-integration-with-the-inference-endpoints-metrics-api",headingTag:"h2"}}),ne=new g({props:{title:"Connect with your internal tool",local:"connect-with-your-internal-tool",headingTag:"h3"}}),le=new g({props:{title:"Subscribe to Team or Enterprise",local:"subscribe-to-team-or-enterprise",headingTag:"h3"}}),re=new Kt({props:{source:"https://github.com/huggingface/hf-endpoints-documentation/blob/main/docs/source/guides/analytics.md"}}),{c(){d=a("meta"),pe=s(),oe=a("p"),me=s(),u(v.$$.fragment),he=s(),y=a("p"),y.textContent=lt,fe=s(),w=a("p"),w.innerHTML=at,ce=s(),$=a("p"),$.textContent=rt,ge=s(),b=a("ul"),b.innerHTML=ot,de=s(),T=a("p"),T.innerHTML=ut,ve=s(),u(x.$$.fragment),ye=s(),u(C.$$.fragment),we=s(),M=a("p"),M.textContent=pt,$e=s(),H=a("ul"),H.innerHTML=mt,be=s(),P=a("p"),P.innerHTML=ht,Te=s(),L=a("p"),L.textContent=ft,xe=s(),_=a("p"),_.innerHTML=ct,Ce=s(),u(q.$$.fragment),Me=s(),k=a("p"),k.innerHTML=gt,He=s(),E=a("p"),E.innerHTML=dt,Pe=s(),u(U.$$.fragment),Le=s(),I=a("p"),I.textContent=vt,_e=s(),R=a("ul"),R.innerHTML=yt,qe=s(),z=a("p"),z.textContent=wt,ke=s(),F=a("p"),F.innerHTML=$t,Ee=s(),u(A.$$.fragment),Ue=s(),S=a("p"),S.textContent=bt,Ie=s(),Y=a("p"),Y.innerHTML=Tt,Re=s(),j=a("p"),j.innerHTML=xt,ze=s(),G=a("p"),G.innerHTML=Ct,Fe=s(),u(O.$$.fragment),Ae=s(),B=a("p"),B.textContent=Mt,Se=s(),D=a("ul"),D.innerHTML=Ht,Ye=s(),N=a("p"),N.innerHTML=Pt,je=s(),W=a("p"),W.textContent=Lt,Ge=s(),K=a("p"),K.innerHTML=_t,Oe=s(),u(V.$$.fragment),Be=s(),J=a("p"),J.innerHTML=qt,De=s(),Q=a("p"),Q.textContent=kt,Ne=s(),X=a("p"),X.textContent=Et,We=s(),Z=a("ul"),Z.innerHTML=Ut,Ke=s(),ee=a("p"),ee.textContent=It,Ve=s(),te=a("p"),te.textContent=Rt,Je=s(),u(ne.$$.fragment),Qe=s(),ie=a("p"),ie.textContent=zt,Xe=s(),se=a("ul"),se.innerHTML=Ft,Ze=s(),u(le.$$.fragment),et=s(),ae=a("p"),ae.innerHTML=At,tt=s(),u(re.$$.fragment),nt=s(),ue=a("p"),this.h()},l(e){const t=Nt("svelte-u9bgzb",document.head);d=r(t,"META",{name:!0,content:!0}),t.forEach(n),pe=l(e),oe=r(e,"P",{}),St(oe).forEach(n),me=l(e),p(v.$$.fragment,e),he=l(e),y=r(e,"P",{"data-svelte-h":!0}),o(y)!=="svelte-1qwdd7g"&&(y.textContent=lt),fe=l(e),w=r(e,"P",{"data-svelte-h":!0}),o(w)!=="svelte-1lzx4cg"&&(w.innerHTML=at),ce=l(e),$=r(e,"P",{"data-svelte-h":!0}),o($)!=="svelte-2q1i31"&&($.textContent=rt),ge=l(e),b=r(e,"UL",{"data-svelte-h":!0}),o(b)!=="svelte-1tmrvm6"&&(b.innerHTML=ot),de=l(e),T=r(e,"P",{"data-svelte-h":!0}),o(T)!=="svelte-s7g9t9"&&(T.innerHTML=ut),ve=l(e),p(x.$$.fragment,e),ye=l(e),p(C.$$.fragment,e),we=l(e),M=r(e,"P",{"data-svelte-h":!0}),o(M)!=="svelte-15jqzd1"&&(M.textContent=pt),$e=l(e),H=r(e,"UL",{"data-svelte-h":!0}),o(H)!=="svelte-18dtmml"&&(H.innerHTML=mt),be=l(e),P=r(e,"P",{"data-svelte-h":!0}),o(P)!=="svelte-1kwgrsz"&&(P.innerHTML=ht),Te=l(e),L=r(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-1ibhate"&&(L.textContent=ft),xe=l(e),_=r(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-1xw4r5k"&&(_.innerHTML=ct),Ce=l(e),p(q.$$.fragment,e),Me=l(e),k=r(e,"P",{"data-svelte-h":!0}),o(k)!=="svelte-4jupc9"&&(k.innerHTML=gt),He=l(e),E=r(e,"P",{"data-svelte-h":!0}),o(E)!=="svelte-eb33tn"&&(E.innerHTML=dt),Pe=l(e),p(U.$$.fragment,e),Le=l(e),I=r(e,"P",{"data-svelte-h":!0}),o(I)!=="svelte-20agt5"&&(I.textContent=vt),_e=l(e),R=r(e,"UL",{"data-svelte-h":!0}),o(R)!=="svelte-1ypi2lx"&&(R.innerHTML=yt),qe=l(e),z=r(e,"P",{"data-svelte-h":!0}),o(z)!=="svelte-19ch391"&&(z.textContent=wt),ke=l(e),F=r(e,"P",{"data-svelte-h":!0}),o(F)!=="svelte-1eclpic"&&(F.innerHTML=$t),Ee=l(e),p(A.$$.fragment,e),Ue=l(e),S=r(e,"P",{"data-svelte-h":!0}),o(S)!=="svelte-kcly0l"&&(S.textContent=bt),Ie=l(e),Y=r(e,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-4i74o4"&&(Y.innerHTML=Tt),Re=l(e),j=r(e,"P",{"data-svelte-h":!0}),o(j)!=="svelte-f72rot"&&(j.innerHTML=xt),ze=l(e),G=r(e,"P",{"data-svelte-h":!0}),o(G)!=="svelte-bb5nbl"&&(G.innerHTML=Ct),Fe=l(e),p(O.$$.fragment,e),Ae=l(e),B=r(e,"P",{"data-svelte-h":!0}),o(B)!=="svelte-2qmv22"&&(B.textContent=Mt),Se=l(e),D=r(e,"UL",{"data-svelte-h":!0}),o(D)!=="svelte-c4522"&&(D.innerHTML=Ht),Ye=l(e),N=r(e,"P",{"data-svelte-h":!0}),o(N)!=="svelte-g3bjeh"&&(N.innerHTML=Pt),je=l(e),W=r(e,"P",{"data-svelte-h":!0}),o(W)!=="svelte-1lyund8"&&(W.textContent=Lt),Ge=l(e),K=r(e,"P",{"data-svelte-h":!0}),o(K)!=="svelte-1l2kowr"&&(K.innerHTML=_t),Oe=l(e),p(V.$$.fragment,e),Be=l(e),J=r(e,"P",{"data-svelte-h":!0}),o(J)!=="svelte-13d2rfo"&&(J.innerHTML=qt),De=l(e),Q=r(e,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-j0p83d"&&(Q.textContent=kt),Ne=l(e),X=r(e,"P",{"data-svelte-h":!0}),o(X)!=="svelte-1ydj90u"&&(X.textContent=Et),We=l(e),Z=r(e,"UL",{"data-svelte-h":!0}),o(Z)!=="svelte-14hfqsy"&&(Z.innerHTML=Ut),Ke=l(e),ee=r(e,"P",{"data-svelte-h":!0}),o(ee)!=="svelte-10une11"&&(ee.textContent=It),Ve=l(e),te=r(e,"P",{"data-svelte-h":!0}),o(te)!=="svelte-n96fxh"&&(te.textContent=Rt),Je=l(e),p(ne.$$.fragment,e),Qe=l(e),ie=r(e,"P",{"data-svelte-h":!0}),o(ie)!=="svelte-1cy1im7"&&(ie.textContent=zt),Xe=l(e),se=r(e,"UL",{"data-svelte-h":!0}),o(se)!=="svelte-1l539gy"&&(se.innerHTML=Ft),Ze=l(e),p(le.$$.fragment,e),et=l(e),ae=r(e,"P",{"data-svelte-h":!0}),o(ae)!=="svelte-6fjb8c"&&(ae.innerHTML=At),tt=l(e),p(re.$$.fragment,e),nt=l(e),ue=r(e,"P",{}),St(ue).forEach(n),this.h()},h(){Yt(d,"name","hf:doc:metadata"),Yt(d,"content",Jt)},m(e,t){Wt(document.head,d),i(e,pe,t),i(e,oe,t),i(e,me,t),m(v,e,t),i(e,he,t),i(e,y,t),i(e,fe,t),i(e,w,t),i(e,ce,t),i(e,$,t),i(e,ge,t),i(e,b,t),i(e,de,t),i(e,T,t),i(e,ve,t),m(x,e,t),i(e,ye,t),m(C,e,t),i(e,we,t),i(e,M,t),i(e,$e,t),i(e,H,t),i(e,be,t),i(e,P,t),i(e,Te,t),i(e,L,t),i(e,xe,t),i(e,_,t),i(e,Ce,t),m(q,e,t),i(e,Me,t),i(e,k,t),i(e,He,t),i(e,E,t),i(e,Pe,t),m(U,e,t),i(e,Le,t),i(e,I,t),i(e,_e,t),i(e,R,t),i(e,qe,t),i(e,z,t),i(e,ke,t),i(e,F,t),i(e,Ee,t),m(A,e,t),i(e,Ue,t),i(e,S,t),i(e,Ie,t),i(e,Y,t),i(e,Re,t),i(e,j,t),i(e,ze,t),i(e,G,t),i(e,Fe,t),m(O,e,t),i(e,Ae,t),i(e,B,t),i(e,Se,t),i(e,D,t),i(e,Ye,t),i(e,N,t),i(e,je,t),i(e,W,t),i(e,Ge,t),i(e,K,t),i(e,Oe,t),m(V,e,t),i(e,Be,t),i(e,J,t),i(e,De,t),i(e,Q,t),i(e,Ne,t),i(e,X,t),i(e,We,t),i(e,Z,t),i(e,Ke,t),i(e,ee,t),i(e,Ve,t),i(e,te,t),i(e,Je,t),m(ne,e,t),i(e,Qe,t),i(e,ie,t),i(e,Xe,t),i(e,se,t),i(e,Ze,t),m(le,e,t),i(e,et,t),i(e,ae,t),i(e,tt,t),m(re,e,t),i(e,nt,t),i(e,ue,t),it=!0},p:Gt,i(e){it||(h(v.$$.fragment,e),h(x.$$.fragment,e),h(C.$$.fragment,e),h(q.$$.fragment,e),h(U.$$.fragment,e),h(A.$$.fragment,e),h(O.$$.fragment,e),h(V.$$.fragment,e),h(ne.$$.fragment,e),h(le.$$.fragment,e),h(re.$$.fragment,e),it=!0)},o(e){f(v.$$.fragment,e),f(x.$$.fragment,e),f(C.$$.fragment,e),f(q.$$.fragment,e),f(U.$$.fragment,e),f(A.$$.fragment,e),f(O.$$.fragment,e),f(V.$$.fragment,e),f(ne.$$.fragment,e),f(le.$$.fragment,e),f(re.$$.fragment,e),it=!1},d(e){e&&(n(pe),n(oe),n(me),n(he),n(y),n(fe),n(w),n(ce),n($),n(ge),n(b),n(de),n(T),n(ve),n(ye),n(we),n(M),n($e),n(H),n(be),n(P),n(Te),n(L),n(xe),n(_),n(Ce),n(Me),n(k),n(He),n(E),n(Pe),n(Le),n(I),n(_e),n(R),n(qe),n(z),n(ke),n(F),n(Ee),n(Ue),n(S),n(Ie),n(Y),n(Re),n(j),n(ze),n(G),n(Fe),n(Ae),n(B),n(Se),n(D),n(Ye),n(N),n(je),n(W),n(Ge),n(K),n(Oe),n(Be),n(J),n(De),n(Q),n(Ne),n(X),n(We),n(Z),n(Ke),n(ee),n(Ve),n(te),n(Je),n(Qe),n(ie),n(Xe),n(se),n(Ze),n(et),n(ae),n(tt),n(nt),n(ue)),n(d),c(v,e),c(x,e),c(C,e),c(q,e),c(U,e),c(A,e),c(O,e),c(V,e),c(ne,e),c(le,e),c(re,e)}}}const Jt='{"title":"Analytics and Metrics","local":"analytics-and-metrics","sections":[{"title":"Understanding the graphs","local":"understanding-the-graphs","sections":[{"title":"Number of (HTTP) Requests","local":"number-of-http-requests","sections":[],"depth":3},{"title":"Pending Requests","local":"pending-requests","sections":[],"depth":3},{"title":"Latency Distribution","local":"latency-distribution","sections":[],"depth":3},{"title":"Running Replicas","local":"running-replicas","sections":[],"depth":3},{"title":"Compute","local":"compute","sections":[],"depth":3}],"depth":2},{"title":"Create an integration with the Inference Endpoints Metrics API","local":"create-an-integration-with-the-inference-endpoints-metrics-api","sections":[{"title":"Connect with your internal tool","local":"connect-with-your-internal-tool","sections":[],"depth":3},{"title":"Subscribe to Team or Enterprise","local":"subscribe-to-team-or-enterprise","sections":[],"depth":3}],"depth":2}],"depth":1}';function Qt(st){return Ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tn extends Bt{constructor(d){super(),Dt(this,d,Qt,Vt,jt,{})}}export{tn as component};
