UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

1 lines 827 B
import{n as e,s as t,t as n}from"./jsx-runtime-ButemYzH.js";import{Ac as r,Ol as i,Ss as a,kc as o}from"./index-B0RbDPtk.js";var s=t(e()),c=(e={})=>{let{uiConfig:{prometheusAPIAvailable:t}}=o(),{data:n,error:r,mutate:c}=a(t,{},i(`api/admin/metrics/rps`),l,e);return(0,s.useMemo)(()=>({metrics:n,loading:!r&&!n,refetch:()=>c(),error:r}),[n,r,c])},l=e=>fetch(e).then(r(`Instance Metrics`)).then(e=>e.json()),u=n(),d=()=>{let{uiConfig:{prometheusAPIAvailable:e}}=o();return e?null:(0,u.jsxs)(`p`,{children:[`This view requires the `,(0,u.jsx)(`strong`,{children:`PROMETHEUS_API`}),` environment variable to be set. Refer to our`,` `,(0,u.jsx)(`a`,{href:`https://docs.getunleash.io/concepts/network-view#data-source`,target:`_blank`,rel:`noreferrer`,children:`documentation`}),` `,`for more information.`]})};export{c as n,d as t};