import { EuiLink } from '@elastic/eui' ; import React from 'react' ; import { APMQueryParams } from '../url_helpers' ; import { APMLinkExtendProps , useAPMHref } from './apm_link' ; interface Props extends APMLinkExtendProps { serviceName : string ; serviceNodeName : string ; } const persistedFilters = [ 'host' , 'containerId' , 'podName' , 'serviceVersion' , ] ; export function useServiceNodeMetricOverviewHref ( { serviceName , serviceNodeName , } ) { return useAPMHref ( { path : `/services/${ serviceName }/nodes/${ encodeURIComponent ( serviceNodeName ) }/metrics` , persistedFilters , } ) ; } export function ServiceNodeMetricOverviewLink ( { serviceName , serviceNodeName , ... rest } ) { const href = useServiceNodeMetricOverviewHref ( { serviceName , serviceNodeName , } ) ; return < EuiLink href = { href } { ... rest } />; }