Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace analytics collapse dashboard queries, align naming to industry conventions #514

Merged
merged 30 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
873a296
trace analytics v2 first remove expensive dashboard page
derek-ho Jun 6, 2023
639c811
get trace groups request working and mapping correctly
derek-ho Jun 7, 2023
2569f12
get trace group filter fully working
derek-ho Jun 7, 2023
372aa6d
try some service map adjustments
derek-ho Jun 13, 2023
4f46095
change to up down to fully show labels
derek-ho Jun 13, 2023
d882225
put dashboard in accordian at bottom of services and only make calls …
derek-ho Jun 14, 2023
422f27e
some changes to support dashboard content in accordian
derek-ho Jun 15, 2023
4d61988
demo code
derek-ho Jun 15, 2023
1042b17
fix tests
derek-ho Jun 16, 2023
92a173f
Merge branch 'main' of github.com:opensearch-project/dashboards-obser…
derek-ho Jul 17, 2023
ebd7381
remove dashboard from app analytics
derek-ho Jul 17, 2023
1b9256b
Merge branch 'main' of github.com:opensearch-project/dashboards-obser…
derek-ho Jul 17, 2023
74fd3f7
fix up with tests
derek-ho Jul 19, 2023
dcdcb95
fix test
derek-ho Jul 19, 2023
1a62964
revert only and extract to constant
derek-ho Jul 19, 2023
3f9401e
add auth const
derek-ho Jul 19, 2023
a350791
address self-PR review
derek-ho Jul 19, 2023
7b5f791
remove unecessary code
derek-ho Jul 19, 2023
829e2ac
change timeout to 25 seconds
derek-ho Jul 19, 2023
ec4704b
change to row in accordian
derek-ho Jul 20, 2023
5b4d812
Merge branch 'main' of github.com:opensearch-project/dashboards-obser…
derek-ho Aug 28, 2023
45b6163
update labels and tests
derek-ho Aug 28, 2023
194e46e
update cypress test
derek-ho Aug 28, 2023
0294777
verify cypress tests work with changes
derek-ho Aug 29, 2023
542b944
remove accidental only
derek-ho Aug 29, 2023
e9941e0
address PR review comments
derek-ho Aug 29, 2023
d4341d5
Merge branch 'main' of github.com:opensearch-project/dashboards-obser…
derek-ho Aug 29, 2023
3b3feea
make missing configuration more clear
derek-ho Aug 29, 2023
d5233aa
update snapshots
derek-ho Aug 29, 2023
dd255a0
update snapshot
derek-ho Aug 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions .cypress/integration/4_trace_analytics_dashboard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
/// <reference types="cypress" />

import { testDataSet, delay, setTimeFilter, jaegerTestDataSet } from '../utils/constants';
import { suppressResizeObserverIssue } from '../utils/constants';

suppressResizeObserverIssue();//needs to be in file once

describe('Dump test data', () => {
it('Indexes test data', () => {
Expand Down Expand Up @@ -88,6 +91,7 @@ describe('Testing dashboard table', () => {
},
});
setTimeFilter();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
});

it('Renders the dashboard table', () => {
Expand All @@ -97,15 +101,6 @@ describe('Testing dashboard table', () => {
cy.contains('7.14%').should('exist');
});

it('Has working breadcrumbs', () => {
cy.get('.euiBreadcrumb').contains('Dashboard').click();
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.get('.euiTitle').contains('Logs').should('exist');
});

it('Adds the percentile filters', () => {
cy.contains(' >= 95 percentile').click({ force: true });
cy.contains(' >= 95 percentile').click({ force: true });
Expand All @@ -131,7 +126,6 @@ describe('Testing dashboard table', () => {
it('Redirects to traces table with filter', () => {
cy.get('.euiLink').contains('13').click();

cy.get('h2.euiTitle').contains('Traces').should('exist');
cy.contains(' (13)').should('exist');
cy.contains('client_create_order').should('exist');

Expand All @@ -149,20 +143,20 @@ describe('Testing plots', () => {
},
});
setTimeFilter();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
});

it('Renders service map', () => {
// plotly scale texts are in attribute "data-unformatted"
cy.get('text.ytitle[data-unformatted="Latency (ms)"]').should('exist');
cy.get('text.ytitle[data-unformatted="Average duration (ms)"]').should('exist');
cy.get('text[data-unformatted="200"]').should('exist');
cy.get('.vis-network').should('exist');

cy.get('.euiButton__text[title="Error rate"]').click();
cy.get('text.ytitle[data-unformatted="Error rate"]').should('exist');
cy.get('text[data-unformatted="10%"]').should('exist');
cy.get('.euiButton__text[title="Errors"]').click();
cy.get('text.ytitle[data-unformatted="Error rate (%)"]').should('exist');

cy.get('.euiButton__text[title="Throughput"]').click();
cy.get('text.ytitle[data-unformatted="Throughput"]').should('exist');
cy.get('.euiButton__text[title="Request Rate"]').click();
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}');
Expand All @@ -184,6 +178,7 @@ describe('Latency by trace group table', () =>{
},
});
setTimeFilter();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
});

it('Verify columns in Latency by trace group table along with pagination functionality', () => {
Expand All @@ -194,9 +189,9 @@ describe('Latency by trace group table', () =>{
cy.get('[data-test-subj="tableHeaderCell_24_hour_latency_trend_3"]').should('exist');
cy.get('[data-test-subj="tableHeaderCell_dashboard_error_rate_4"]').should('exist');
cy.get('[data-test-subj="tableHeaderCell_dashboard_traces_5"]').should('exist');
cy.get('[data-test-subj="tablePaginationPopoverButton"]').click();
cy.get('[data-test-subj="tablePaginationPopoverButton"]').eq(1).click();
cy.get('.euiIcon.euiIcon--medium.euiIcon--inherit.euiContextMenu__icon').eq(0).should('exist').click();
cy.get('[data-test-subj="pagination-button-next"]').should('exist').click();
cy.get('[data-test-subj="pagination-button-next"]').eq(1).should('exist').click();
cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').contains('mysql').should('exist');
});

Expand Down Expand Up @@ -225,7 +220,7 @@ describe('Latency by trace group table', () =>{
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
cy.wait(delay);//Fails without
cy.get('.euiTableCellContent.euiTableCellContent--alignRight.euiTableCellContent--overflowingContent').contains('211.04').should('exist');
cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').click();
cy.get('button[data-test-subj="dashboard-table-trace-group-name-button"]').eq(0).click();
cy.get('.euiBadge.euiBadge--hollow.euiBadge--iconRight.globalFilterItem').click();
cy.get('.euiIcon.euiIcon--medium.euiContextMenu__arrow').click();
cy.get('.euiContextMenuPanelTitle').contains('Edit filter').should('exist');
Expand Down Expand Up @@ -350,6 +345,7 @@ describe('Testing switch mode to jaeger', () => {
setTimeFilter();
cy.get("[data-test-subj='indexPattern-switch-link']").click();
cy.get("[data-test-subj='jaeger-mode']").click();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
});

it('Verifies errors mode columns and data', () => {
Expand All @@ -358,15 +354,14 @@ describe('Testing switch mode to jaeger', () => {
cy.contains('100%').should('exist');
cy.contains('7').should('exist');
cy.contains('Service and Operation Name').should('exist');
cy.contains('Average latency (ms)').should('exist');
cy.contains('Average duration (ms)').should('exist');
cy.contains('Error rate').should('exist');
cy.contains('Traces').should('exist');
});

it('Verifies traces links to traces page', () => {
cy.get('.euiLink').contains('7').click();
cy.get('[data-test-subj="dashboard-table-traces-button"]').contains('7').click();

cy.get('h2.euiTitle').contains('Traces').should('exist');
cy.contains(' (7)').should('exist');
cy.get("[data-test-subj='filterBadge']").eq(0).contains('process.serviceName: redis')
cy.get("[data-test-subj='filterBadge']").eq(1).contains('operationName: GetDriver');
Expand All @@ -379,7 +374,7 @@ describe('Testing switch mode to jaeger', () => {
cy.contains('0%').should('exist');
cy.contains('8').should('exist');
cy.contains('Service and Operation Name').should('exist');
cy.contains('Average latency (ms)').should('exist');
cy.contains('Average duration (ms)').should('exist');
cy.contains('Error rate').should('exist');
cy.contains('Traces').should('exist');
});
Expand Down
24 changes: 12 additions & 12 deletions .cypress/integration/5_trace_analytics_services.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

/// <reference types="cypress" />

import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter, verify_traces_spans_data_grid_cols_exists, count_table_row } from '../utils/constants';
import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter, verify_traces_spans_data_grid_cols_exists, count_table_row, AUTH_SERVICE_SPAN_ID } from '../utils/constants';
import { suppressResizeObserverIssue } from '../utils/constants';

suppressResizeObserverIssue();//needs to be in file once

describe('Testing services table empty state', () => {
beforeEach(() => {
Expand Down Expand Up @@ -49,9 +52,9 @@ describe('Testing services table', () => {
it('Verify columns in Services table', () => {
cy.get('.euiFlexItem.euiFlexItem--flexGrow10 .panel-title').contains('Services').should('exist');
cy.get('.euiTableCellContent__text[title="Name"]').should('exist');
cy.get('.euiTableCellContent__text[title="Average latency (ms)"]').should('exist');
cy.get('.euiTableCellContent__text[title="Average duration (ms)"]').should('exist');
cy.get('.euiTableCellContent__text[title="Error rate"]').should('exist');
cy.get('.euiTableCellContent__text[title="Throughput"]').should('exist');
cy.get('.euiTableCellContent__text[title="Request rate"]').should('exist');
cy.get('.euiTableCellContent__text[title="No. of connected services"]').should('exist');
cy.get('.euiTableCellContent__text[title="Connected services"]').should('exist');
cy.get('.euiTableCellContent__text[title="Traces"]').should('exist');
Expand Down Expand Up @@ -110,9 +113,7 @@ describe('Testing service view', () => {
cy.get('.euiBreadcrumb').contains(SERVICE_NAME).click();
cy.get('h2.euiTitle').contains(SERVICE_NAME).should('exist');
cy.get('.euiBreadcrumb').contains('Services').click();
cy.get('.euiTitle').contains('Services').should('exist');
cy.get('.euiBreadcrumb').contains('Trace analytics').click();
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb').contains('Observability').click();
cy.get('.euiTitle').contains('Logs').should('exist');
});
Expand Down Expand Up @@ -143,10 +144,10 @@ describe('Testing Service map', () => {
it('Render Service map', () => {
cy.get('.euiText.euiText--medium .panel-title').contains('Service map');
cy.get('[data-test-subj="latency"]').should('exist');
cy.get('.ytitle').contains('Latency (ms)');
cy.get('[data-text = "Error rate"]').click();
cy.get('.ytitle').contains('Average duration (ms)');
cy.get('[data-text = "Errors"]').click();
cy.contains('60%');
cy.get('[data-text = "Throughput"]').click();
cy.get('[data-text = "Duration"]').click();
cy.contains('100');
cy.get('.euiText.euiText--medium').contains('Focus on').should('exist');
cy.get('[placeholder="Service name"]').focus().type('database{enter}');
Expand Down Expand Up @@ -238,7 +239,7 @@ describe('Testing traces Spans table and verify columns functionality', () => {
it('Renders the spans table and click on first span to verify details', () => {
cy.get('.euiLink.euiLink--primary').contains('authentication').should('exist').click();
verify_traces_spans_data_grid_cols_exists();
cy.get('.euiLink--primary').eq(4).click();
cy.contains(AUTH_SERVICE_SPAN_ID).click();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer to specific span id to prevent flakiness in case it doesn't show up 5th

cy.get('[data-test-subj="spanDetailFlyout"] .euiTitle.euiTitle--medium').contains('Span detail').should('exist');
cy.get('.euiFlyoutBody .panel-title').contains('Overview').should('exist');
cy.get('.euiTextColor.euiTextColor--subdued').contains('Span ID').should('exist');
Expand Down Expand Up @@ -284,16 +285,15 @@ describe('Testing switch mode to jaeger', () => {
cy.contains('310.29').should('exist');
cy.contains('0%').should('exist');
cy.contains('Name').should('exist');
cy.contains('Average latency (ms)').should('exist');
cy.contains('Average duration (ms)').should('exist');
cy.contains('Error rate').should('exist');
cy.contains('Throughput').should('exist');
cy.contains('Request rate').should('exist');
cy.contains('Traces').should('exist');
});

it('Verifies traces links to traces page with filter applied', () => {
cy.get('.euiTableRow').should('have.length.lessThan', 7);//Replaces Wait
cy.get('.euiLink').contains('7').click();
cy.get('h2.euiTitle').contains('Traces').should('exist');
cy.contains(' (7)').should('exist');
cy.get("[data-test-subj='filterBadge']").eq(0).contains('process.serviceName: customer')
})
Expand Down
4 changes: 1 addition & 3 deletions .cypress/integration/6_trace_analytics_traces.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ describe('Testing trace view', () => {
cy.get(`.euiBreadcrumb[href="#/traces/${TRACE_ID}"]`).click();
cy.get('h2.euiTitle').contains(TRACE_ID).should('exist');
cy.get('.euiBreadcrumb[href="#/traces"]').click();
cy.get('.euiTitle').contains('Traces').should('exist');
cy.get('.euiBreadcrumb[href="#/"]').click();
cy.get('.euiTitle').contains('Dashboard').should('exist');
cy.get('.euiBreadcrumb[href="observability-logs#/"]').click();
cy.get('.euiTitle').contains('Logs').should('exist');
});
Expand Down Expand Up @@ -125,7 +123,7 @@ describe('Testing traces table', () => {
it('Renders the traces table and verify Table Column, Pagination and Rows Data ', () => {
cy.get('.euiTableCellContent__text').contains('Trace ID').should('exist');
cy.get('.euiTableCellContent__text').contains('Trace group').should('exist');
cy.get('.euiTableCellContent__text').contains('Latency (ms)').should('exist');
cy.get('.euiTableCellContent__text').contains('Duration (ms)').should('exist');
cy.get('.euiTableCellContent__text').contains('Percentile in trace group').should('exist');
cy.get('.euiTableCellContent__text').contains('Errors').should('exist');
cy.get('.euiTableCellContent__text').contains('Last updated').should('exist');
Expand Down
12 changes: 7 additions & 5 deletions .cypress/integration/7_app_analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,19 @@ describe('Viewing application', () => {
});

it('Shows latency variance in dashboards table', () => {
changeTimeTo24('months');
changeTimeTo24('years');
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
cy.get('[data-test-subj="dashboardTable"]').first().within(($table) => {
cy.get('.plot-container').should('have.length.at.least', 1);
})
});

it('Adds filter when Trace group name is clicked', () => {
cy.wait(delay);//List not loading without
cy.get('[data-test-subj="app-analytics-overviewTab"]').click();
cy.get('[data-test-subj="trace-groups-service-operation-accordian"]').click();
cy.get('[data-test-subj="dashboard-table-trace-group-name-button"]').contains('client_create_order').click();
cy.get('.euiTableRow').should('have.length', 1, { timeout: timeoutDelay });
cy.get('[data-test-subj="client_create_orderFilterBadge"]').should('exist');
cy.get('[data-test-subj="filterBadge"]').click();
cy.get('[data-test-subj="filterBadge"]').eq(1).click();
cy.get('[data-test-subj="deleteFilterIcon"]').click();
cy.get('[data-test-subj="client_create_orderFilterBadge"]').should('not.exist');
});
Expand All @@ -276,7 +276,7 @@ describe('Viewing application', () => {
cy.get('[data-test-subj="serviceDetailFlyoutTitle"]').should('be.visible');
cy.get('[data-test-subj="serviceDetailFlyout"]').within(($flyout) => {
cy.get('[data-test-subj="Number of connected servicesDescriptionList"]').should('contain', '3');
cy.get('[data-text="Error rate"]').click();
cy.get('[data-text="Errors"]').click();
cy.get('.ytitle').contains('Error rate').should('exist');
});
cy.get('[data-test-subj="dataGridRowCell"] button').contains('718dc32a693c8a17').click();
Expand Down Expand Up @@ -307,6 +307,7 @@ describe('Viewing application', () => {
it('Opens span detail flyout when Span ID is clicked', () => {
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
cy.wait(delay);
cy.get('input[type="search"]').focus().type(`5ff3516909562c60`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search for specific traceId to prevent flakiness on it not showing up on first page

cy.get('[data-test-subj="dataGridRowCell"]').contains('5ff3516909562c60').click();
cy.get('[data-test-subj="spanDetailFlyout"]').should('be.visible');
cy.get('[data-test-subj="spanDetailFlyout"]').within(($flyout) => {
Expand Down Expand Up @@ -543,6 +544,7 @@ describe('Editing application', () => {
});
});


describe('Application Analytics home page', () => {
beforeEach(() => {
moveToHomePage();
Expand Down
1 change: 1 addition & 0 deletions .cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const TRACE_ID = '8832ed6abbb2a83516461960c89af49d';
export const SPAN_ID = 'a673bc074b438374';
export const SERVICE_NAME = 'frontend-client';
export const SERVICE_SPAN_ID = '7df5609a6d104736';
export const AUTH_SERVICE_SPAN_ID = '277a5934acf55dcf';
derek-ho marked this conversation as resolved.
Show resolved Hide resolved

export const testDataSet = [
{
Expand Down
Loading
Loading