diff --git a/.cypress/integration/4_trace_analytics_dashboard.spec.js b/.cypress/integration/4_trace_analytics_dashboard.spec.js index 37009a642..be31f2183 100644 --- a/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/.cypress/integration/4_trace_analytics_dashboard.spec.js @@ -153,10 +153,10 @@ describe('Testing plots', () => { cy.get('.vis-network').should('exist'); cy.get('.euiButton__text[title="Errors"]').click(); - cy.get('text.ytitle[data-unformatted="Error rate"]').should('exist'); + cy.get('text.ytitle[data-unformatted="Error rate (%)"]').should('exist'); cy.get('.euiButton__text[title="Request Rate"]').click(); - cy.get('text.ytitle[data-unformatted="Request rate"]').should('exist'); + cy.get('text.ytitle[data-unformatted="Request rate (spans)"]').should('exist'); cy.get('text[data-unformatted="50"]').should('exist'); cy.get('input[type="search"]').eq(1).focus().type('payment{enter}'); diff --git a/public/components/trace_analytics/components/common/plots/service_map_scale.tsx b/public/components/trace_analytics/components/common/plots/service_map_scale.tsx index f75d5f907..61bba2841 100644 --- a/public/components/trace_analytics/components/common/plots/service_map_scale.tsx +++ b/public/components/trace_analytics/components/common/plots/service_map_scale.tsx @@ -23,8 +23,8 @@ export function ServiceMapScale(props: { const delta = ticks[1] - ticks[0]; const title = { latency: 'Average duration (ms)', - error_rate: 'Error rate', - throughput: 'Request rate', + error_rate: 'Error rate (%)', + throughput: 'Request rate (spans)', }[props.idSelected]; const percentInterval = 1 / Math.max(ticks.length - 1, 1); const percents = Array.from({ length: ticks.length - 1 }, (v, i) => percentInterval * i); diff --git a/public/components/trace_analytics/components/dashboard/top_groups_page.tsx b/public/components/trace_analytics/components/dashboard/top_groups_page.tsx index 1741a12b0..da3ff8bbd 100644 --- a/public/components/trace_analytics/components/dashboard/top_groups_page.tsx +++ b/public/components/trace_analytics/components/dashboard/top_groups_page.tsx @@ -34,7 +34,7 @@ export function TopGroupsPage(props: { }, { id: 'throughput', - label: 'Rate', + label: 'Request rate', 'data-test-subj': 'throughput-toggle' }, ]; diff --git a/public/components/trace_analytics/components/services/services_content.tsx b/public/components/trace_analytics/components/services/services_content.tsx index 370520d86..0552c567e 100644 --- a/public/components/trace_analytics/components/services/services_content.tsx +++ b/public/components/trace_analytics/components/services/services_content.tsx @@ -46,7 +46,7 @@ export function ServicesContent(props: ServicesProps) { } = props; const [tableItems, setTableItems] = useState([]); - const [trigger, setTrigger] = useState<'open' | 'closed' | undefined>('closed'); + const [trigger, setTrigger] = useState<'open' | 'closed'>('closed'); const [serviceMap, setServiceMap] = useState({}); const [serviceMapIdSelected, setServiceMapIdSelected] = useState< 'latency' | 'error_rate' | 'throughput' diff --git a/public/components/trace_analytics/requests/dashboard_request_handler.ts b/public/components/trace_analytics/requests/dashboard_request_handler.ts index 253fab1b3..d9316bca0 100644 --- a/public/components/trace_analytics/requests/dashboard_request_handler.ts +++ b/public/components/trace_analytics/requests/dashboard_request_handler.ts @@ -50,7 +50,7 @@ export const handleDashboardRequest = async ( .catch((error) => console.error(error)); if (setPercentileMap) setPercentileMap(latencyVariances); - const latencyTrends = await handleDslRequest(http, latencyTrendDSL, getLatencyTrendQuery(), mode, true, setShowTimeoutToast) + const latencyTrends = await handleDslRequest(http, latencyTrendDSL, getLatencyTrendQuery(), mode, setShowTimeoutToast) .then((response) => { const map: any = {}; response.aggregations.trace_group_name.buckets.map((bucket) => { @@ -105,7 +105,7 @@ export const handleDashboardRequest = async ( }) .catch((error) => console.error(error)); - await handleDslRequest(http, DSL, getDashboardQuery(), mode, true, setShowTimeoutToast) + await handleDslRequest(http, DSL, getDashboardQuery(), mode, setShowTimeoutToast) .then((response) => { return Promise.all( response.aggregations.trace_group_name.buckets.map((bucket) => { @@ -138,7 +138,7 @@ export const handleJaegerDashboardRequest = async ( setShowTimeoutToast, setPercentileMap? ) => { - const latencyTrends = await handleDslRequest(http, latencyTrendDSL, getJaegerLatencyTrendQuery(), mode, true, setShowTimeoutToast) + const latencyTrends = await handleDslRequest(http, latencyTrendDSL, getJaegerLatencyTrendQuery(), mode, setShowTimeoutToast) .then((response) => { const map: any = {}; response.aggregations.trace_group_name.buckets.map((bucket) => { @@ -195,7 +195,7 @@ export const handleJaegerDashboardRequest = async ( console.error(error); }); - await handleDslRequest(http, DSL, getJaegerDashboardQuery(), mode, true, setShowTimeoutToast) + await handleDslRequest(http, DSL, getJaegerDashboardQuery(), mode, setShowTimeoutToast) .then((response) => { return Promise.all( response.aggregations.trace_group_name.buckets.map((bucket) => { @@ -249,7 +249,7 @@ export const handleJaegerErrorDashboardRequest = async ( setShowTimeoutToast, setPercentileMap? ) => { - const errorTrends = await handleDslRequest(http, latencyTrendDSL, getJaegerErrorTrendQuery(), mode, true, setShowTimeoutToast) + const errorTrends = await handleDslRequest(http, latencyTrendDSL, getJaegerErrorTrendQuery(), mode, setShowTimeoutToast) .then((response) => { const map: any = {}; response.aggregations.trace_group_name.buckets.map((bucket) => { @@ -304,7 +304,7 @@ export const handleJaegerErrorDashboardRequest = async ( }) .catch((error) => console.error(error)); - await handleDslRequest(http, DSL, getJaegerErrorDashboardQuery(), mode, true, setShowTimeoutToast) + await handleDslRequest(http, DSL, getJaegerErrorDashboardQuery(), mode, setShowTimeoutToast) .then((response) => { return Promise.all( response.aggregations.trace_group_name.buckets.map((bucket) => { diff --git a/public/components/trace_analytics/requests/request_handler.ts b/public/components/trace_analytics/requests/request_handler.ts index e5ba11707..bb687183d 100644 --- a/public/components/trace_analytics/requests/request_handler.ts +++ b/public/components/trace_analytics/requests/request_handler.ts @@ -18,7 +18,6 @@ export async function handleDslRequest( DSL: any, bodyQuery: any, mode: TraceAnalyticsMode, - timeout?: boolean, setShowTimeoutToast?: () => void ) { if (DSL?.query) { @@ -33,8 +32,8 @@ export async function handleDslRequest( if (!bodyQuery.index) { body = { ...bodyQuery, index: mode === 'jaeger' ? JAEGER_INDEX_NAME : DATA_PREPPER_INDEX_NAME }; } - if (timeout) { - const id = setTimeout(() => setShowTimeoutToast!(), 25000); // 25 seconds + if (setShowTimeoutToast) { + const id = setTimeout(() => setShowTimeoutToast(), 25000); // 25 seconds try { return await http.post(TRACE_ANALYTICS_DSL_ROUTE, { @@ -45,14 +44,15 @@ export async function handleDslRequest( } finally { clearTimeout(id); } - } + } else { - try { - return await http.post(TRACE_ANALYTICS_DSL_ROUTE, { - body: JSON.stringify(body), - }); - } catch (error_1) { - console.error(error_1); + try { + return await http.post(TRACE_ANALYTICS_DSL_ROUTE, { + body: JSON.stringify(body), + }); + } catch (error_1) { + console.error(error_1); + } } }