From 2961e46c5c484531cf2a4c6bcf29d4fced2537cf Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:55:08 -0800 Subject: [PATCH 01/11] Bump prismjs from 1.25.0 to 1.27.0 in /dashboards-observability (#508) (#574) Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.25.0...v1.27.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit b4f491a16f81725db6d63f604a3020e5b89dd720) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dashboards-observability/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboards-observability/yarn.lock b/dashboards-observability/yarn.lock index 75c63573b..4d07cfde7 100644 --- a/dashboards-observability/yarn.lock +++ b/dashboards-observability/yarn.lock @@ -2312,9 +2312,9 @@ pretty-bytes@^5.4.1: integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== prismjs@^1.22.0, prismjs@~1.24.0: - version "1.25.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.25.0.tgz#6f822df1bdad965734b310b315a23315cf999756" - integrity sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg== + version "1.27.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" + integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== process-nextick-args@~2.0.0: version "2.0.1" From 4afca569100adf2b6b108a124709b89016c9a697 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:39:23 -0800 Subject: [PATCH 02/11] change to support java 8 in compile and runtime (#575) (#576) Signed-off-by: Zhongnan Su (cherry picked from commit 5c43e9dac336b37fa4f6f002709e0965015383aa) Co-authored-by: Zhongnan Su --- .../opensearch-observability-test-and-build-workflow.yml | 1 + .../org/opensearch/observability/settings/PluginSettings.kt | 4 ++-- .../kotlin/org/opensearch/observability/PluginRestTestCase.kt | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/opensearch-observability-test-and-build-workflow.yml b/.github/workflows/opensearch-observability-test-and-build-workflow.yml index 618308a33..2c33f8511 100644 --- a/.github/workflows/opensearch-observability-test-and-build-workflow.yml +++ b/.github/workflows/opensearch-observability-test-and-build-workflow.yml @@ -12,6 +12,7 @@ jobs: strategy: matrix: java: + - 8 - 11 - 14 diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt index 7782425ca..0f5d31504 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt @@ -15,7 +15,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.observability.ObservabilityPlugin.Companion.LOG_PREFIX import org.opensearch.observability.ObservabilityPlugin.Companion.PLUGIN_NAME import java.io.IOException -import java.nio.file.Path +import java.nio.file.Paths /** * settings specific to observability Plugin. @@ -246,7 +246,7 @@ internal object PluginSettings { var settings: Settings? = null val configDirName = BootstrapInfo.getSystemProperties()?.get("opensearch.path.conf")?.toString() if (configDirName != null) { - val defaultSettingYmlFile = Path.of(configDirName, PLUGIN_NAME, "observability.yml") + val defaultSettingYmlFile = Paths.get(configDirName, PLUGIN_NAME, "observability.yml") try { settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build() } catch (exception: IOException) { diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt index 33afa6e80..c80e1bddd 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt @@ -38,7 +38,7 @@ import java.io.IOException import java.io.InputStreamReader import java.nio.charset.StandardCharsets import java.nio.file.Files -import java.nio.file.Path +import java.nio.file.Paths import java.security.cert.X509Certificate import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName @@ -263,7 +263,7 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() { false ) proxy.getExecutionData(false)?.let { - val path = Path.of("$jacocoBuildPath/integTest.exec") + val path = Paths.get("$jacocoBuildPath/integTest.exec") Files.write(path, it) } } From c85b9ef2359b3a6e0d8bf02dfbd792dd271de2f2 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:41:23 -0700 Subject: [PATCH 03/11] Add 1.3.0 release notes (#580) (#582) Signed-off-by: Eugene Lee --- ...rch-observability.release-notes-1.3.0.0.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 release-notes/opensearch-observability.release-notes-1.3.0.0.md diff --git a/release-notes/opensearch-observability.release-notes-1.3.0.0.md b/release-notes/opensearch-observability.release-notes-1.3.0.0.md new file mode 100644 index 000000000..2cd38fc33 --- /dev/null +++ b/release-notes/opensearch-observability.release-notes-1.3.0.0.md @@ -0,0 +1,92 @@ +## Version 1.3.0.0 Release Notes + +Compatible with OpenSearch and OpenSearch Dashboards Version 1.3.0 + +### Features +* Feature latest observability ([#509](https://github.com/opensearch-project/observability/pull/509)) +* Live tail - Event analytics ([#494](https://github.com/opensearch-project/observability/pull/494)) +* Add Events Flyout and Correlate Traces with logs ([#493](https://github.com/opensearch-project/observability/pull/493)) +* Merge Application Analytics into main ([#454](https://github.com/opensearch-project/observability/pull/454)) + +### Enhancements +* Disable duplicate visualization and enable edit panel ([#554](https://github.com/opensearch-project/observability/pull/554)) +* Allow app creation with one composition ([#557](https://github.com/opensearch-project/observability/pull/557)) +* Add ability to choose visualization for availability ([#552](https://github.com/opensearch-project/observability/pull/552)) +* added common visualization parser ([#550](https://github.com/opensearch-project/observability/pull/550)) +* converting datetime to utc from picker ([#551](https://github.com/opensearch-project/observability/pull/551)) +* Feature/remove timestamp saving ([#546](https://github.com/opensearch-project/observability/pull/546)) +* Feature convert browser time to utc time ([#542](https://github.com/opensearch-project/observability/pull/542)) +* replace viz icon ([#543](https://github.com/opensearch-project/observability/pull/543)) +* Add availability metrics to app table ([#539](https://github.com/opensearch-project/observability/pull/539)) +* Add autocomplete to panels, add parse command to app analytics ([#529](https://github.com/opensearch-project/observability/pull/529)) +* changes panel requests & date, traces link in events ([#533](https://github.com/opensearch-project/observability/pull/533)) +* Include related services node under service filter ([#527](https://github.com/opensearch-project/observability/pull/527)) +* Change availability level to have expression ([#525](https://github.com/opensearch-project/observability/pull/525)) +* Feature/sort only datatable in flyout ([#522](https://github.com/opensearch-project/observability/pull/522)) +* Add service map to services and trace view page ([#518](https://github.com/opensearch-project/observability/pull/518)) +* Edit visualization in Application Analytics ([#519](https://github.com/opensearch-project/observability/pull/519)) +* Add parse command back in autocompletion ([#517](https://github.com/opensearch-project/observability/pull/517)) +* Add autocomplete enhancements ([#507](https://github.com/opensearch-project/observability/pull/507)) +* Make base query immutable ([#500](https://github.com/opensearch-project/observability/pull/500)) +* Redirect to trace tab, updateMappings once, etc ([#481](https://github.com/opensearch-project/observability/pull/481)) +* Finish autocomplete logic for after where ([#480](https://github.com/opensearch-project/observability/pull/480)) +* UI changes to Metrics Tab ([#476](https://github.com/opensearch-project/observability/pull/476)) +* Add date_nanos to valid time fields ([#426](https://github.com/opensearch-project/observability/pull/426)) +* Separate default filters and extra filters ([#474](https://github.com/opensearch-project/observability/pull/474)) +* Saving time for individual applications ([#473](https://github.com/opensearch-project/observability/pull/473)) +* Support lazy scroll and auto complete for PPL parse command ([#421](https://github.com/opensearch-project/observability/pull/421)) +* Add observability visualization to notebooks ([#351](https://github.com/opensearch-project/observability/pull/351)) + +### Bug Fixes +* fix for datepicker issue ([#571](https://github.com/opensearch-project/observability/pull/571)) +* Show saved time range when editing saved visualization ([#570](https://github.com/opensearch-project/observability/pull/570)) +* Issue/query click ([#569](https://github.com/opensearch-project/observability/pull/569)) +* Fix fields not showing up in panels autocomplete ([#566](https://github.com/opensearch-project/observability/pull/566)) +* Pass in prop curSelectedTabId for live tail ([#567](https://github.com/opensearch-project/observability/pull/567)) +* added fix for threshold ([#568](https://github.com/opensearch-project/observability/pull/568)) +* fix interval selector issue, revert interval function changes ([#563](https://github.com/opensearch-project/observability/pull/563)) +* remove bold letter and extra pranthesis ([#559](https://github.com/opensearch-project/observability/pull/559)) +* Issue horizontal bar ([#556](https://github.com/opensearch-project/observability/pull/556)) +* final live tail fixes ([#558](https://github.com/opensearch-project/observability/pull/558)) +* fix page flicker for live tail ([#541](https://github.com/opensearch-project/observability/pull/541)) +* Fix multiple flyouts issue in explorer ([#538](https://github.com/opensearch-project/observability/pull/538)) +* Flyout bugs ([#540](https://github.com/opensearch-project/observability/pull/540)) +* detete request and response changes for event and panels ([#530](https://github.com/opensearch-project/observability/pull/530)) +* Issue/darkmode support viz config ([#521](https://github.com/opensearch-project/observability/pull/521)) +* Visualizations do not follow set timerange ([#516](https://github.com/opensearch-project/observability/pull/516)) +* Fix empty userConfigs stringify ([#513](https://github.com/opensearch-project/observability/pull/513)) +* Fix lower margin of autocomplete being cut off ([#512](https://github.com/opensearch-project/observability/pull/512)) +* fix issue of clicking query caused crash ([#515](https://github.com/opensearch-project/observability/pull/515)) +* Feature viz saving on missing fields ([#511](https://github.com/opensearch-project/observability/pull/511)) +* Fix events flyout bugs and Styling ([#510](https://github.com/opensearch-project/observability/pull/510)) +* Bump prismjs from 1.25.0 to 1.27.0 in /dashboards-observability ([#508](https://github.com/opensearch-project/observability/pull/508)) +* Revert query pre-processing for parse command ([#497](https://github.com/opensearch-project/observability/pull/497)) +* Fix create/edit page bug ([#475](https://github.com/opensearch-project/observability/pull/475)) +* Fix queries being filtered out ([#472](https://github.com/opensearch-project/observability/pull/472)) +* Guava package update ([#404](https://github.com/opensearch-project/observability/pull/404)) +* CVE fix:json-schema, gson & glob-parent ([#368](https://github.com/opensearch-project/observability/pull/368)) + +### Documentation +* Sync PPL commands doc with main repo ([#549](https://github.com/opensearch-project/observability/pull/549)) +* Fixed documentation links ([#534](https://github.com/opensearch-project/observability/pull/534)) +* Add parse command docs ([#535](https://github.com/opensearch-project/observability/pull/535)) +* updating readme and badges ([#352](https://github.com/opensearch-project/observability/pull/352)) + +### Maintenance +* bump main to 1.3 ([#361](https://github.com/opensearch-project/observability/pull/361)) + +### Infrastructure +* change to support java 8 in compile and runtime ([#575](https://github.com/opensearch-project/observability/pull/575)) +* Update cypress test ([#564](https://github.com/opensearch-project/observability/pull/564)) +* fixed flaky panel test ([#565](https://github.com/opensearch-project/observability/pull/565)) +* Feature flyout tests ([#553](https://github.com/opensearch-project/observability/pull/553)) +* Add cypress tests for application analytics ([#544](https://github.com/opensearch-project/observability/pull/544)) +* Update panels cypress ([#545](https://github.com/opensearch-project/observability/pull/545)) +* Update cypress for trace analytics traces view ([#536](https://github.com/opensearch-project/observability/pull/536)) +* Cypress fix for panels and events ([#531](https://github.com/opensearch-project/observability/pull/531)) +* updated panels flaky jest tests ([#505](https://github.com/opensearch-project/observability/pull/505)) +* Change Default CI java version to 11 ([#504](https://github.com/opensearch-project/observability/pull/504)) +* Update backport and add auto-delete workflows ([#496](https://github.com/opensearch-project/observability/pull/496)) +* Add auto backporting functionality ([#491](https://github.com/opensearch-project/observability/pull/491)) +* [main] jcenter removed from gradle.build ([#374](https://github.com/opensearch-project/observability/pull/374)) +* Configure WhiteSource for GitHub.com ([#365](https://github.com/opensearch-project/observability/pull/365)) \ No newline at end of file From 341dd538013612017a67c01a0e6f11c7dac4506a Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Tue, 29 Mar 2022 13:16:58 -0700 Subject: [PATCH 04/11] cypress tests Signed-off-by: Eric Wei --- .../integration/event_analytics.spec.js | 238 ++++++++++++++---- .../.cypress/utils/event_constants.js | 70 ++++++ .../timechart_header/timechart_header.tsx | 2 +- .../config_controls/config_value_options.tsx | 3 +- .../config_editor/default_vis_editor.tsx | 1 + .../config_panel/config_panel.tsx | 4 +- .../shared_components/empty_placeholder.tsx | 4 +- .../visualizations/charts/text/text.tsx | 8 +- 8 files changed, 278 insertions(+), 52 deletions(-) create mode 100644 dashboards-observability/.cypress/utils/event_constants.js diff --git a/dashboards-observability/.cypress/integration/event_analytics.spec.js b/dashboards-observability/.cypress/integration/event_analytics.spec.js index 1e784a275..0e1bc8092 100644 --- a/dashboards-observability/.cypress/integration/event_analytics.spec.js +++ b/dashboards-observability/.cypress/integration/event_analytics.spec.js @@ -12,35 +12,15 @@ import { SAVE_QUERY2, SAVE_QUERY3, SAVE_QUERY4, -} from '../utils/constants'; + querySearch, + YEAR_TO_DATE_DOM_ID, + landOnEventHome, + landOnEventExplorer, + landOnEventVisualizations, + landOnPanels +} from '../utils/event_constants'; import { supressResizeObserverIssue } from '../utils/constants'; -const landOnEventHome = () => { - cy.visit(`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics`); - cy.wait(delay); -}; - -const landOnEventExplorer = () => { - cy.visit( - `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer` - ); - cy.wait(delay); -}; - -const landOnPanels = () => { - cy.visit( - `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/operational_panels` - ); - cy.wait(delay); -}; - -const querySearch = (query) => { - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(query); - cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click(); - cy.get('[data-test-subj="superDatePickerCommonlyUsed_This_year"]').click(); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); -}; - describe('Adding sample data and visualization', () => { it('Adds sample flights data for event analytics', () => { cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`); @@ -51,6 +31,26 @@ describe('Adding sample data and visualization', () => { }); }); +describe('Search a query on event home', () => { + it('Search a query and redirect to explorer to display query output', () => { + landOnEventHome(); + + cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query); + cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click(); + cy.get('[data-test-subj="superDatePickerCommonlyUsed_Year_to date"]').click(); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); + cy.window().its('store').invoke('getState').then((state) => { + expect(Object.values(state.queries)[0]['rawQuery'].trim()).equal(TEST_QUERIES[0].query) + expect(Object.values(state.queries)[0]['selectedDateRange'][0]).equal("now/y"); + expect(Object.values(state.queries)[0]['selectedDateRange'][1]).equal("now"); + }); + cy.wait(delay); + + cy.url().should('contain', '#/event_analytics/explorer'); + cy.get('[data-test-subj="searchAutocompleteTextArea"]').contains(TEST_QUERIES[0].query); + }); +}); + describe('Open flyout for a data row to see details', () => { beforeEach(() => { landOnEventExplorer(); @@ -78,19 +78,6 @@ describe('Open flyout for a data row to see details', () => { }); }); -describe('Search a query on event home', () => { - it('Search a query and redirect to explorer to display result data', () => { - landOnEventHome(); - - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); - cy.wait(delay); - - cy.url().should('contain', '#/event_analytics/explorer'); - cy.get('[data-test-subj="searchAutocompleteTextArea"]').contains(TEST_QUERIES[0].query); - }); -}); - describe('Add/delete/switch explorer top level tabs', () => { beforeEach(() => { landOnEventExplorer(); @@ -299,7 +286,7 @@ describe('Saves a query on explorer page', () => { }); }); -describe('Override default timestamp for an index', () => { +describe('Override timestamp for an index', () => { it('Click override button to override default timestamp', () => { landOnEventExplorer(); @@ -318,7 +305,7 @@ describe('Override default timestamp for an index', () => { describe('Toggle sidebar fields', () => { it('Toggle fields between available and selected section', () => { landOnEventExplorer(); - querySearch(TEST_QUERIES[0].query); + querySearch(TEST_QUERIES[0].query, YEAR_TO_DATE_DOM_ID); cy.wait(delay); cy.get('[data-test-subj="fieldToggle-AvgTicketPrice"]').click(); @@ -333,7 +320,7 @@ describe('Toggle sidebar fields', () => { describe('Search fields in sidebar', () => { it('Search a field', () => { landOnEventExplorer(); - querySearch(TEST_QUERIES[0].query); + querySearch(TEST_QUERIES[0].query, YEAR_TO_DATE_DOM_ID); cy.wait(delay); cy.get('[data-test-subj="eventExplorer__sidebarSearch"]').type('A'); @@ -366,6 +353,31 @@ describe('Delete saved objects', () => { }); }); +describe('Click to view field insights', () => { + beforeEach(() => { + landOnEventExplorer(); + querySearch(TEST_QUERIES[2].query, YEAR_TO_DATE_DOM_ID); + }); + + it.only('Click a numerical field to view field insights', () => { + cy.get('[data-test-subj="field-bytes-showDetails"]').click(); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Top values').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Rare values').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Average overtime').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Maximum overtime').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Minimum overtime').should('exist'); + }); + + it.only('Click a non-numerical field to view insights', () => { + cy.get('[data-test-subj="field-host-showDetails"]').click(); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Top values').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Rare values').should('exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Average overtime').should('not.exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Maximum overtime').should('not.exist'); + cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Minimum overtime').should('not.exist'); + }); +}); + describe('Switch on and off livetail', () => { it('Switch on and off in live tail', () => { landOnEventExplorer(); @@ -422,7 +434,7 @@ describe('Live tail stop automatically', () => { .find('button.euiTab') .first() .should('have.class', 'euiTab-isSelected'); -}); + }); it('Close current selected tab', () => { cy.get('[data-test-subj="eventExplorer__addNewTab"]').click(); @@ -442,4 +454,142 @@ describe('Live tail stop automatically', () => { it('Live tail should be stopped', () => { cy.get('.euiButton__text').contains('Live'); }); +}); + +describe('Renders noresult chart', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('It should render no result when there is no data', () => { + cy.get('[data-test-subj="vizWorkspace__noData"] p').contains('No results found').should('exist'); + }); +}); + +describe('Renders bar charts', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Renders vertical bar chart', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Bar').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); + cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').first().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Vertical').click(); + cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').last().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Group').click(); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('g.xaxislayer-above > g.xtick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); + }); + + it('Renders horiztontal bar chart', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Bar').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); + cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').first().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Horizontal').click(); + cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Group').click(); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('g.yaxislayer-above > g.ytick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); + }); +}); + +describe('Renders line charts', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Renders line chart with threshold', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Line').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); + cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Lines').click(); + cy.get('#configPanel__Thresholds span').contains('+ Add threadshold').click(); + cy.get('[data-test-subj="nameFieldText"]').type('Max'); + cy.get('[data-test-subj="valueFieldNumber"]').type(3800); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('g.text > g.textpoint text[data-unformatted|="Max"]').should('exist'); + cy.get('g.xaxislayer-above > g.xtick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); + }); +}); + +describe('Renders pie charts', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Renders pie chart', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Pie').click(); + cy.get('g.pielayer').should('exist'); + }); +}); + +describe('Renders heatmap chart', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Renders heatmap chart with different z-axes', () => { + querySearch(TEST_QUERIES[4].query, TEST_QUERIES[4].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Heatmap').click(); + cy.wait(delay); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').click(); + cy.wait(delay); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('g.g-gtitle text[data-unformatted|="count()"]').should('exist'); + cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').click(); + cy.wait(delay); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('avg(bytes)').click(); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('g.g-gtitle text[data-unformatted|="avg(bytes)"]').should('exist'); + }); +}); + +describe('Renders markdown chart', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Renders markdown chart with test title', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Text').click(); + cy.get('[data-test-subj="workspace__viz_markdown"] h2').contains('Text').should('exist'); + cy.get('textarea.euiMarkdownEditorTextArea').type('## testing title'); + cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.get('[data-test-subj="workspace__viz_markdown"] h2').contains('testing title').should('exist'); + }); +}); + +describe('Renders data view', () => { + beforeEach(() => { + landOnEventVisualizations(); + }); + + it('Switch views between data table and visualization workspace', () => { + querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); + cy.get('[data-test-subj="workspace__dataTableViewSwitch"]').click(); + cy.get('[data-test-subj="workspace__dataTable"]').should('exist'); + cy.get('[data-test-subj="workspace__dataTableViewSwitch"]').click(); + cy.get('[data-test-subj="workspace__dataTable"]').should('not.exist'); + }); }); \ No newline at end of file diff --git a/dashboards-observability/.cypress/utils/event_constants.js b/dashboards-observability/.cypress/utils/event_constants.js new file mode 100644 index 000000000..38f8f5dd7 --- /dev/null +++ b/dashboards-observability/.cypress/utils/event_constants.js @@ -0,0 +1,70 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { supressResizeObserverIssue } from './constants' + +export const delay = 500; +export const YEAR_TO_DATE_DOM_ID = '[data-test-subj="superDatePickerCommonlyUsed_Year_to date"]' + +export const TEST_QUERIES = [ + { + query: 'source = opensearch_dashboards_sample_data_flights' + }, + { + query: 'source = opensearch_dashboards_sample_data_flights | stats avg(FlightDelayMin) by Carrier' + }, + { + query: 'source = opensearch_dashboards_sample_data_logs' + }, + { + query: 'source = opensearch_dashboards_sample_data_logs | stats count() by host', + dateRangeDOM: YEAR_TO_DATE_DOM_ID + }, + { + query: 'source = opensearch_dashboards_sample_data_logs | stats count(), avg(bytes) by host, tags', + dateRangeDOM: YEAR_TO_DATE_DOM_ID + }, +]; + +export const TESTING_PANEL = 'Mock Testing Panels'; +export const SAVE_QUERY1 = 'Mock Flight Events Overview'; +export const SAVE_QUERY2 = 'Mock Flight count by destination'; +export const SAVE_QUERY3 = 'Mock Flight count by destination save to panel'; +export const SAVE_QUERY4 = 'Mock Flight peek'; + +export const querySearch = (query, rangeSelected) => { + cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(query); + cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click(); + cy.get(rangeSelected).click(); + cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); +}; + +export const landOnEventHome = () => { + cy.visit(`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics`); + cy.wait(delay); +}; + +export const landOnEventExplorer = () => { + cy.visit( + `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer` + ); + cy.wait(delay); +}; + +export const landOnEventVisualizations = () => { + cy.visit( + `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer` + ); + cy.get('button[id="main-content-vis"]').contains('Visualizations').click(); + supressResizeObserverIssue(); + cy.wait(delay); +}; + +export const landOnPanels = () => { + cy.visit( + `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/operational_panels` + ); + cy.wait(delay); +}; \ No newline at end of file diff --git a/dashboards-observability/public/components/explorer/timechart_header/timechart_header.tsx b/dashboards-observability/public/components/explorer/timechart_header/timechart_header.tsx index 651563023..81b53f627 100644 --- a/dashboards-observability/public/components/explorer/timechart_header/timechart_header.tsx +++ b/dashboards-observability/public/components/explorer/timechart_header/timechart_header.tsx @@ -66,7 +66,7 @@ export function TimechartHeader({ })} compressed id="dscResultsIntervalSelector" - data-test-subj="discoverIntervalSelect" + data-test-subj="eventAnalytics__EventIntervalSelect" options={options} value={interval} onChange={handleIntervalChange} diff --git a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/config_controls/config_value_options.tsx b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/config_controls/config_value_options.tsx index f3b80e568..f7ff2e609 100644 --- a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/config_controls/config_value_options.tsx +++ b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/config_controls/config_value_options.tsx @@ -13,6 +13,7 @@ export const ConfigValueOptions = ({ vizState, handleConfigChange, sectionName, + sectionId = 'valueOptions' }: any) => { const { data } = visualizations; const { data: vizData = {}, metadata: { fields = [] } = {} } = data?.rawVizData; @@ -55,7 +56,7 @@ export const ConfigValueOptions = ({ return ( diff --git a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/default_vis_editor.tsx b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/default_vis_editor.tsx index 0cbad5326..1b6ec01e1 100644 --- a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/default_vis_editor.tsx +++ b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_editor/default_vis_editor.tsx @@ -27,6 +27,7 @@ export const VizDataPanel = ({ visualizations, onConfigChange, vizState = {}, ta handleConfigChange={handleConfigEditing(section.mapTo)} vizState={vizState[section.mapTo] || section.defaultState || {}} sectionName={section.name} + sectionId={section.id} /> ); diff --git a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_panel.tsx b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_panel.tsx index 783ae69fc..83a9012f0 100644 --- a/dashboards-observability/public/components/explorer/visualizations/config_panel/config_panel.tsx +++ b/dashboards-observability/public/components/explorer/visualizations/config_panel/config_panel.tsx @@ -186,7 +186,9 @@ export const ConfigPanel = ({ visualizations, setCurVisId }: any) => { gutterSize="none" responsive={false} > - + ( <> - +

diff --git a/dashboards-observability/public/components/visualizations/charts/text/text.tsx b/dashboards-observability/public/components/visualizations/charts/text/text.tsx index f6248c3d0..644dbb674 100644 --- a/dashboards-observability/public/components/visualizations/charts/text/text.tsx +++ b/dashboards-observability/public/components/visualizations/charts/text/text.tsx @@ -16,8 +16,10 @@ export const Text = ({ visualizations }: any) => { const { dataConfig = {} } = visualizations?.data?.userConfigs; return ( - - {dataConfig.text?.markdown ? dataConfig.text?.markdown : DEFAULT_MARKDOWN} - +
+ + {dataConfig.text?.markdown ? dataConfig.text?.markdown : DEFAULT_MARKDOWN} + +
); }; From 1ff675bb39b4314b9c219902bdac52fcbbe87702 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Tue, 29 Mar 2022 16:12:01 -0700 Subject: [PATCH 05/11] add stashed changes and resolve intermittent failed tests Signed-off-by: Eric Wei --- .../integration/event_analytics.spec.js | 44 ++++++++++++------- .../.cypress/utils/constants.js | 19 -------- .../.cypress/utils/event_constants.js | 3 +- .../public/components/app.tsx | 5 +++ .../explorer/sidebar/field_insights.tsx | 2 +- .../workspace_panel/workspace_panel.tsx | 8 +++- .../charts/data_table/data_table.tsx | 1 + 7 files changed, 42 insertions(+), 40 deletions(-) diff --git a/dashboards-observability/.cypress/integration/event_analytics.spec.js b/dashboards-observability/.cypress/integration/event_analytics.spec.js index 0e1bc8092..f8b6fc3c0 100644 --- a/dashboards-observability/.cypress/integration/event_analytics.spec.js +++ b/dashboards-observability/.cypress/integration/event_analytics.spec.js @@ -54,12 +54,10 @@ describe('Search a query on event home', () => { describe('Open flyout for a data row to see details', () => { beforeEach(() => { landOnEventExplorer(); + querySearch(TEST_QUERIES[0].query, TEST_QUERIES[0].dateRangeDOM); }); it('Should be able to open flyout and see data, json and traces', () => { - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); - cy.wait(delay); cy.get('[data-test-subj="docTable"] tbody tr button.euiButtonIcon').first().click(); cy.get('.observability-flyout').should('exist'); cy.get('.observability-flyout .osdDocViewer .euiTabs span.euiTab__content').contains('JSON').click(); @@ -68,9 +66,6 @@ describe('Open flyout for a data row to see details', () => { }); it('Should be able to see srrounding docs', () => { - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); - cy.wait(delay); cy.get('[data-test-subj="docTable"] tbody tr button.euiButtonIcon').first().click(); cy.get('.observability-flyout').should('exist'); cy.get('.observability-flyout span.euiButton__text').contains('View surrounding events').click(); @@ -158,15 +153,13 @@ describe('Add/delete/switch explorer top level tabs', () => { describe('Load a saved query from event home', () => { it('Click on a saved query and redirect to explorer', () => { landOnEventExplorer(); - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(TEST_QUERIES[0].query); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); - cy.wait(delay); + querySearch(TEST_QUERIES[0].query, TEST_QUERIES[0].dateRangeDOM); cy.get('.tab-title').contains('Events').click(); cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click(); cy.get('[data-test-subj="eventExplorer__querySaveName"]').type(SAVE_QUERY4); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); - cy.wait(delay); + cy.wait(delay * 3); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); @@ -190,16 +183,17 @@ describe('Click actions', () => { it('Actions - click event explorer', () => { cy.get('[data-test-subj="eventHomeAction"]').click(); - cy.get('[data-test-subj="eventHomeAction__explorer"]').click(); cy.wait(delay); + cy.get('[data-test-subj="eventHomeAction__explorer"]').click(); cy.url().should('contain', '#/event_analytics/explorer'); }); it('Actions - add sample data', () => { cy.get('[data-test-subj="eventHomeAction"]').click(); + cy.wait(delay); cy.get('[data-test-subj="eventHomeAction__addSamples"]').click(); cy.get('[data-test-subj="confirmModalConfirmButton"]').click(); - cy.wait(delay * 2); + cy.wait(delay * 4); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); }); @@ -227,7 +221,7 @@ describe('Saves a query on explorer page', () => { cy.wait(delay); cy.get('[data-test-subj="eventExplorer__querySaveName"]').type(SAVE_QUERY1); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); - cy.wait(delay); + cy.wait(delay * 3); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); @@ -348,7 +342,7 @@ describe('Delete saved objects', () => { cy.get('input.euiFieldText[placeholder="delete"]').type('delete'); cy.get('button.euiButton--danger').should('not.be.disabled'); cy.get('.euiButton__text').contains('Delete').click(); - cy.wait(delay); + cy.wait(delay * 4); cy.get('.euiTextAlign').contains('No Queries or Visualizations').should('exist'); }); }); @@ -359,7 +353,7 @@ describe('Click to view field insights', () => { querySearch(TEST_QUERIES[2].query, YEAR_TO_DATE_DOM_ID); }); - it.only('Click a numerical field to view field insights', () => { + it('Click a numerical field to view field insights', () => { cy.get('[data-test-subj="field-bytes-showDetails"]').click(); cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Top values').should('exist'); cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Rare values').should('exist'); @@ -368,7 +362,7 @@ describe('Click to view field insights', () => { cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Minimum overtime').should('exist'); }); - it.only('Click a non-numerical field to view insights', () => { + it('Click a non-numerical field to view insights', () => { cy.get('[data-test-subj="field-host-showDetails"]').click(); cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Top values').should('exist'); cy.get('[data-test-subj="sidebarField__fieldInsights"] button').contains('Rare values').should('exist'); @@ -474,32 +468,44 @@ describe('Renders bar charts', () => { it('Renders vertical bar chart', () => { querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); - cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Bar').click(); + cy.wait(delay * 2); + cy.get('[data-test-subj="comboBoxOptionsList "] span').contains('Bar').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').first().click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Vertical').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').last().click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Group').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.wait(delay * 2); cy.get('g.xaxislayer-above > g.xtick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); }); it('Renders horiztontal bar chart', () => { querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Bar').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').first().click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Horizontal').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').eq(1).click(); + cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Group').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.wait(delay * 2); cy.get('g.yaxislayer-above > g.ytick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); }); }); @@ -523,6 +529,7 @@ describe('Renders line charts', () => { cy.get('[data-test-subj="nameFieldText"]').type('Max'); cy.get('[data-test-subj="valueFieldNumber"]').type(3800); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.wait(delay * 2); cy.get('g.text > g.textpoint text[data-unformatted|="Max"]').should('exist'); cy.get('g.xaxislayer-above > g.xtick text[data-unformatted|="artifacts.opensearch.org"]').should('exist'); }); @@ -537,6 +544,7 @@ describe('Renders pie charts', () => { querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Pie').click(); + cy.wait(delay); cy.get('g.pielayer').should('exist'); }); }); @@ -560,6 +568,7 @@ describe('Renders heatmap chart', () => { cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('avg(bytes)').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.wait(delay * 2); cy.get('g.g-gtitle text[data-unformatted|="avg(bytes)"]').should('exist'); }); }); @@ -576,6 +585,7 @@ describe('Renders markdown chart', () => { cy.get('[data-test-subj="workspace__viz_markdown"] h2').contains('Text').should('exist'); cy.get('textarea.euiMarkdownEditorTextArea').type('## testing title'); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); + cy.wait(delay * 2); cy.get('[data-test-subj="workspace__viz_markdown"] h2').contains('testing title').should('exist'); }); }); diff --git a/dashboards-observability/.cypress/utils/constants.js b/dashboards-observability/.cypress/utils/constants.js index e99c97ddc..56506b842 100644 --- a/dashboards-observability/.cypress/utils/constants.js +++ b/dashboards-observability/.cypress/utils/constants.js @@ -93,25 +93,6 @@ export const PPL_QUERY_TEXT = `%ppl source=opensearch_dashboards_sample_data_flights ` -// event analytics -export const TEST_QUERIES = [ - { - query: 'source = opensearch_dashboards_sample_data_flights' - }, - { - query: 'source = opensearch_dashboards_sample_data_flights | stats avg(FlightDelayMin) by Carrier' - }, - { - query: 'source = opensearch_dashboards_sample_data_logs' - }, -]; - -export const TESTING_PANEL = 'Mock Testing Panels'; -export const SAVE_QUERY1 = 'Mock Flight Events Overview'; -export const SAVE_QUERY2 = 'Mock Flight count by destination'; -export const SAVE_QUERY3 = 'Mock Flight count by destination save to panel'; -export const SAVE_QUERY4 = 'Mock Flight peek'; - export const supressResizeObserverIssue = () => { // exception is thrown on loading EuiDataGrid in cypress only, ignore for now cy.on('uncaught:exception', (err, runnable) => { diff --git a/dashboards-observability/.cypress/utils/event_constants.js b/dashboards-observability/.cypress/utils/event_constants.js index 38f8f5dd7..7368240b6 100644 --- a/dashboards-observability/.cypress/utils/event_constants.js +++ b/dashboards-observability/.cypress/utils/event_constants.js @@ -10,7 +10,8 @@ export const YEAR_TO_DATE_DOM_ID = '[data-test-subj="superDatePickerCommonlyUsed export const TEST_QUERIES = [ { - query: 'source = opensearch_dashboards_sample_data_flights' + query: 'source = opensearch_dashboards_sample_data_flights', + dateRangeDOM: YEAR_TO_DATE_DOM_ID }, { query: 'source = opensearch_dashboards_sample_data_flights | stats avg(FlightDelayMin) by Carrier' diff --git a/dashboards-observability/public/components/app.tsx b/dashboards-observability/public/components/app.tsx index 36594b890..3cc0da4de 100644 --- a/dashboards-observability/public/components/app.tsx +++ b/dashboards-observability/public/components/app.tsx @@ -26,6 +26,11 @@ interface ObservabilityAppDeps { timestampUtils: any; } +// for cypress to test redux store +if (window.Cypress) { + window.store = store; +} + export const App = ({ CoreStartProp, DepsStart, diff --git a/dashboards-observability/public/components/explorer/sidebar/field_insights.tsx b/dashboards-observability/public/components/explorer/sidebar/field_insights.tsx index fd03ce1f5..90b3c958e 100644 --- a/dashboards-observability/public/components/explorer/sidebar/field_insights.tsx +++ b/dashboards-observability/public/components/explorer/sidebar/field_insights.tsx @@ -127,7 +127,7 @@ export const FieldInsights = ({ field, query }: any) => { }, [curReport, reportContent, field.name]); return ( - + {generalReports.map((report) => { diff --git a/dashboards-observability/public/components/explorer/visualizations/workspace_panel/workspace_panel.tsx b/dashboards-observability/public/components/explorer/visualizations/workspace_panel/workspace_panel.tsx index 9934e4f27..525083525 100644 --- a/dashboards-observability/public/components/explorer/visualizations/workspace_panel/workspace_panel.tsx +++ b/dashboards-observability/public/components/explorer/visualizations/workspace_panel/workspace_panel.tsx @@ -21,7 +21,7 @@ interface IWorkSpacePanel { export function WorkspacePanel({ visualizations }: IWorkSpacePanel) { const [isTableViewOn, setIsTableViewOn] = useState(false); const VisualizationPanel = useMemo(() => { - return ; + return ; }, [visualizations]); return ( @@ -55,6 +55,7 @@ export function WorkspacePanel({ visualizations }: IWorkSpacePanel) { setIsTableViewOn((staleState) => !staleState); }} aria-describedby="table view switcher" + data-test-subj="workspace__dataTableViewSwitch" compressed /> @@ -64,7 +65,10 @@ export function WorkspacePanel({ visualizations }: IWorkSpacePanel) { - {isTableViewOn ? : VisualizationPanel} + {isTableViewOn ? + : VisualizationPanel} diff --git a/dashboards-observability/public/components/visualizations/charts/data_table/data_table.tsx b/dashboards-observability/public/components/visualizations/charts/data_table/data_table.tsx index 99f72748d..912a9dc2c 100644 --- a/dashboards-observability/public/components/visualizations/charts/data_table/data_table.tsx +++ b/dashboards-observability/public/components/visualizations/charts/data_table/data_table.tsx @@ -87,6 +87,7 @@ export const DataTable = ({ visualizations }: any) => { return ( Date: Tue, 29 Mar 2022 16:48:46 -0700 Subject: [PATCH 06/11] run tests and update snapshots Signed-off-by: Eric Wei --- .../integration/event_analytics.spec.js | 20 +++++++++---------- .../.cypress/utils/event_constants.js | 2 +- .../shared_components.test.tsx.snap | 4 +++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dashboards-observability/.cypress/integration/event_analytics.spec.js b/dashboards-observability/.cypress/integration/event_analytics.spec.js index f8b6fc3c0..63cb829f5 100644 --- a/dashboards-observability/.cypress/integration/event_analytics.spec.js +++ b/dashboards-observability/.cypress/integration/event_analytics.spec.js @@ -159,7 +159,7 @@ describe('Load a saved query from event home', () => { cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click(); cy.get('[data-test-subj="eventExplorer__querySaveName"]').type(SAVE_QUERY4); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); - cy.wait(delay * 3); + cy.wait(delay * 2); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); @@ -221,7 +221,7 @@ describe('Saves a query on explorer page', () => { cy.wait(delay); cy.get('[data-test-subj="eventExplorer__querySaveName"]').type(SAVE_QUERY1); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); - cy.wait(delay * 3); + cy.wait(delay * 2); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); @@ -241,7 +241,7 @@ describe('Saves a query on explorer page', () => { cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click(); cy.get('[data-test-subj="eventExplorer__querySaveName"]').type(SAVE_QUERY2); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); @@ -471,7 +471,7 @@ describe('Renders bar charts', () => { cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] span').contains('Bar').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').eq(1).click(); cy.wait(delay); @@ -490,7 +490,7 @@ describe('Renders bar charts', () => { it('Renders horiztontal bar chart', () => { querySearch(TEST_QUERIES[3].query, TEST_QUERIES[3].dateRangeDOM); cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Bar').click(); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').first().click(); cy.wait(delay); @@ -499,10 +499,10 @@ describe('Renders bar charts', () => { cy.wait(delay); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('host').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').first().click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Horizontal').click(); cy.get('#configPanel__chart_options [data-test-subj="comboBoxInput"]').eq(1).click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Group').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); cy.wait(delay * 2); @@ -558,14 +558,14 @@ describe('Renders heatmap chart', () => { querySearch(TEST_QUERIES[4].query, TEST_QUERIES[4].dateRangeDOM); cy.get('[data-test-subj="configPane__vizTypeSelector"] [data-test-subj="comboBoxInput"]').click(); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('Heatmap').click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('count()').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); cy.get('g.g-gtitle text[data-unformatted|="count()"]').should('exist'); cy.get('#configPanel__value_options [data-test-subj="comboBoxInput"]').click(); - cy.wait(delay); + cy.wait(delay * 2); cy.get('[data-test-subj="comboBoxOptionsList "] button span').contains('avg(bytes)').click(); cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); cy.wait(delay * 2); diff --git a/dashboards-observability/.cypress/utils/event_constants.js b/dashboards-observability/.cypress/utils/event_constants.js index 7368240b6..7e3b5b8bc 100644 --- a/dashboards-observability/.cypress/utils/event_constants.js +++ b/dashboards-observability/.cypress/utils/event_constants.js @@ -5,7 +5,7 @@ import { supressResizeObserverIssue } from './constants' -export const delay = 500; +export const delay = 1000; export const YEAR_TO_DATE_DOM_ID = '[data-test-subj="superDatePickerCommonlyUsed_Year_to date"]' export const TEST_QUERIES = [ diff --git a/dashboards-observability/public/components/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap b/dashboards-observability/public/components/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap index 7fc0731ee..19cd42dc3 100644 --- a/dashboards-observability/public/components/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap +++ b/dashboards-observability/public/components/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap @@ -7,11 +7,13 @@ exports[`Shared components Renders empty placeholder component 1`] = `
From 1a51a424f3f8604764f338c6d672c7f0782d9243 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Tue, 29 Mar 2022 17:02:18 -0700 Subject: [PATCH 07/11] added one missed changes Signed-off-by: Eric Wei --- .../integration/event_analytics.spec.js | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/dashboards-observability/.cypress/integration/event_analytics.spec.js b/dashboards-observability/.cypress/integration/event_analytics.spec.js index 4d484567e..63cb829f5 100644 --- a/dashboards-observability/.cypress/integration/event_analytics.spec.js +++ b/dashboards-observability/.cypress/integration/event_analytics.spec.js @@ -21,35 +21,6 @@ import { } from '../utils/event_constants'; import { supressResizeObserverIssue } from '../utils/constants'; -<<<<<<< HEAD -======= -const landOnEventHome = () => { - cy.visit(`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics`); - cy.wait(delay); -}; - -const landOnEventExplorer = () => { - cy.visit( - `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer` - ); - cy.wait(delay * 2); -}; - -const landOnPanels = () => { - cy.visit( - `${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/operational_panels` - ); - cy.wait(delay); -}; - -const querySearch = (query) => { - cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(query); - cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click(); - cy.get('[data-test-subj="superDatePickerCommonlyUsed_This_year"]').click(); - cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click(); -}; - ->>>>>>> main describe('Adding sample data and visualization', () => { it('Adds sample flights data for event analytics', () => { cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`); @@ -60,7 +31,6 @@ describe('Adding sample data and visualization', () => { }); }); -<<<<<<< HEAD describe('Search a query on event home', () => { it('Search a query and redirect to explorer to display query output', () => { landOnEventHome(); @@ -78,20 +48,6 @@ describe('Search a query on event home', () => { cy.url().should('contain', '#/event_analytics/explorer'); cy.get('[data-test-subj="searchAutocompleteTextArea"]').contains(TEST_QUERIES[0].query); -======= -describe('Has working breadcrumbs', () => { - it('Redirect to correct page on breadcrumb click', () => { - landOnEventExplorer(); - cy.get('.euiBreadcrumb').contains('Explorer').click(); - cy.wait(delay); - cy.get('[data-test-subj="searchAutocompleteTextArea"]').should('exist'); - cy.get('.euiBreadcrumb').contains('Event analytics').click(); - cy.wait(delay); - cy.get('.euiTitle').contains('Event analytics').should('exist'); - cy.get('.euiBreadcrumb').contains('Observability').click(); - cy.wait(delay); - cy.get('.euiTitle').contains('Event analytics').should('exist'); ->>>>>>> main }); }); From 8543dd6e66f230f8e112c5ffd4eb0715d2cd64e3 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Tue, 29 Mar 2022 17:13:03 -0700 Subject: [PATCH 08/11] update snapshots after merging main Signed-off-by: Eric Wei --- .../count_distribution.test.tsx.snap | 181 ++++++ .../__snapshots__/notebook.test.tsx.snap | 2 + .../__snapshots__/para_input.test.tsx.snap | 8 +- .../__snapshots__/para_output.test.tsx.snap | 2 +- .../__snapshots__/paragraphs.test.tsx.snap | 4 +- .../span_detail_flyout.test.tsx.snap | 577 ++++++++++++++++++ .../__snapshots__/plotly.test.tsx.snap | 170 ++++++ 7 files changed, 937 insertions(+), 7 deletions(-) diff --git a/dashboards-observability/public/components/explorer/visualizations/count_distribution/__tests__/__snapshots__/count_distribution.test.tsx.snap b/dashboards-observability/public/components/explorer/visualizations/count_distribution/__tests__/__snapshots__/count_distribution.test.tsx.snap index e2f169d5f..df3f7b3bd 100644 --- a/dashboards-observability/public/components/explorer/visualizations/count_distribution/__tests__/__snapshots__/count_distribution.test.tsx.snap +++ b/dashboards-observability/public/components/explorer/visualizations/count_distribution/__tests__/__snapshots__/count_distribution.test.tsx.snap @@ -169,4 +169,185 @@ exports[`Count distribution component Renders count distribution component with `; +exports[`Count distribution component Renders count distribution component with data 2`] = ` + + + +
+ + + +`; + exports[`Count distribution component Renders empty count distribution component 1`] = ``; diff --git a/dashboards-observability/public/components/notebooks/components/__tests__/__snapshots__/notebook.test.tsx.snap b/dashboards-observability/public/components/notebooks/components/__tests__/__snapshots__/notebook.test.tsx.snap index ae892d536..d184baf15 100644 --- a/dashboards-observability/public/components/notebooks/components/__tests__/__snapshots__/notebook.test.tsx.snap +++ b/dashboards-observability/public/components/notebooks/components/__tests__/__snapshots__/notebook.test.tsx.snap @@ -313,6 +313,8 @@ exports[` spec renders the component 1`] = `
`; +exports[` spec renders the component 2`] = `null`; + exports[` spec renders the empty component 1`] = `
spec renders the markdown component 1`] = `
spec renders the markdown component 1`] = ` exports[` spec renders the visualization component 1`] = `
spec renders other types of outputs 1`] = ` class="euiText euiText--medium" >
`; diff --git a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/paragraphs.test.tsx.snap b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/paragraphs.test.tsx.snap index 4b7da1ef2..ab01c3c85 100644 --- a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/paragraphs.test.tsx.snap +++ b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/paragraphs.test.tsx.snap @@ -79,10 +79,10 @@ exports[` spec renders the component 1`] = ` class="euiFormRow__fieldWrapper" >
spec renders the empty component 1`] = ` `; + +exports[` spec renders the empty component 2`] = ` + + + + + + +
+ + + +
+
+ + +
+ } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + returnFocus={[Function]} + shards={Array []} + sideCar={ + Object { + "assignMedium": [Function], + "assignSyncMedium": [Function], + "options": Object { + "async": true, + "ssr": false, + }, + "read": [Function], + "useMedium": [Function], + } + } + > + + +
+ } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + returnFocus={[Function]} + shards={Array []} + sideCar={ + Object { + "assignMedium": [Function], + "assignSyncMedium": [Function], + "options": Object { + "async": true, + "ssr": false, + }, + "read": [Function], + "useMedium": [Function], + } + } + > + + +
+ } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + returnFocus={[Function]} + shards={Array []} + > + + +
+ } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + returnFocus={[Function]} + shards={Array []} + /> + + + + +
+
+ + + + + + +
+ +

+ Span detail +

+
+
+
+ +
+
+
+ - +
+
+
+
+
+
+
+
+ + + + + + + + + + + + +
+ + + + + +`; diff --git a/dashboards-observability/public/components/visualizations/plotly/__tests__/__snapshots__/plotly.test.tsx.snap b/dashboards-observability/public/components/visualizations/plotly/__tests__/__snapshots__/plotly.test.tsx.snap index 66ee5e216..a426dfc52 100644 --- a/dashboards-observability/public/components/visualizations/plotly/__tests__/__snapshots__/plotly.test.tsx.snap +++ b/dashboards-observability/public/components/visualizations/plotly/__tests__/__snapshots__/plotly.test.tsx.snap @@ -145,3 +145,173 @@ exports[`Ploty base component Renders Ploty base component 1`] = ` `; + +exports[`Ploty base component Renders Ploty base component 2`] = ` + + +
+ + +`; From c18772581eaa91a155ce7a963799c6faf5660d58 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Wed, 30 Mar 2022 10:15:48 -0700 Subject: [PATCH 09/11] added back one missing tests Signed-off-by: Eric Wei --- .../.cypress/integration/event_analytics.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dashboards-observability/.cypress/integration/event_analytics.spec.js b/dashboards-observability/.cypress/integration/event_analytics.spec.js index 63cb829f5..5ee45d3b8 100644 --- a/dashboards-observability/.cypress/integration/event_analytics.spec.js +++ b/dashboards-observability/.cypress/integration/event_analytics.spec.js @@ -31,6 +31,22 @@ describe('Adding sample data and visualization', () => { }); }); +describe('Has working breadcrumbs', () => { + it('Redirect to correct page on breadcrumb click', () => { + landOnEventExplorer(); + cy.wait(delay * 3); + cy.get('.euiBreadcrumb').contains('Explorer').click(); + cy.wait(delay); + cy.get('[data-test-subj="searchAutocompleteTextArea"]').should('exist'); + cy.get('.euiBreadcrumb').contains('Event analytics').click(); + cy.wait(delay); + cy.get('.euiTitle').contains('Event analytics').should('exist'); + cy.get('.euiBreadcrumb').contains('Observability').click(); + cy.wait(delay); + cy.get('.euiTitle').contains('Event analytics').should('exist'); + }); +}); + describe('Search a query on event home', () => { it('Search a query and redirect to explorer to display query output', () => { landOnEventHome(); From f8ce6651cc6b572c40550428e1c2e3d9e5dcb437 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Wed, 30 Mar 2022 15:59:11 -0700 Subject: [PATCH 10/11] merged main and run tests Signed-off-by: Eric Wei --- .../__snapshots__/create.test.tsx.snap | 3242 +++--- .../__snapshots__/log_config.test.tsx.snap | 60 +- .../service_config.test.tsx.snap | 928 +- .../__snapshots__/trace_config.test.tsx.snap | 82 +- .../custom_panel_table.test.tsx.snap | 882 +- .../__snapshots__/empty_panel.test.tsx.snap | 266 +- .../visualization_flyout.test.tsx.snap | 1658 ++- .../__snapshots__/no_results.test.tsx.snap | 5 +- .../__snapshots__/docViewer.test.tsx.snap | 2 +- .../json_code_block.test.tsx.snap | 240 +- .../saved_query_table.test.tsx.snap | 402 +- .../__snapshots__/save_panel.test.tsx.snap | 34 +- .../__snapshots__/field.test.tsx.snap | 341 +- .../__snapshots__/sidebar.test.tsx.snap | 9233 +++++++++-------- .../__snapshots__/datapanel.test.tsx.snap | 6022 +++++------ .../field_accordion.test.tsx.snap | 6019 +++++------ .../__snapshots__/field_item.test.tsx.snap | 300 +- .../__snapshots__/field_list.test.tsx.snap | 3 - .../shared_components.test.tsx.snap | 11 +- .../__snapshots__/note_table.test.tsx.snap | 66 +- .../__snapshots__/notebook.test.tsx.snap | 36 +- .../__snapshots__/para_input.test.tsx.snap | 10 +- .../__snapshots__/paragraphs.test.tsx.snap | 53 +- .../__snapshots__/search_bar.test.tsx.snap | 476 +- .../filter_edit_popover.test.tsx.snap | 13 - .../__snapshots__/filters.test.tsx.snap | 152 +- .../__snapshots__/dashboard.test.tsx.snap | 1198 +-- .../dashboard_table.test.tsx.snap | 1133 +- .../latency_trend_cell.test.tsx.snap | 82 +- .../__snapshots__/services.test.tsx.snap | 1612 +-- .../services_table.test.tsx.snap | 699 +- .../service_breakdown_panel.test.tsx.snap | 14 +- .../span_detail_flyout.test.tsx.snap | 1605 ++- .../span_detail_panel.test.tsx.snap | 285 +- .../span_detail_table.test.tsx.snap | 269 +- .../__snapshots__/traces.test.tsx.snap | 708 +- .../__snapshots__/traces_table.test.tsx.snap | 693 +- 37 files changed, 20023 insertions(+), 18811 deletions(-) diff --git a/dashboards-observability/public/components/application_analytics/__tests__/__snapshots__/create.test.tsx.snap b/dashboards-observability/public/components/application_analytics/__tests__/__snapshots__/create.test.tsx.snap index 03cda5c00..b7e4195f2 100644 --- a/dashboards-observability/public/components/application_analytics/__tests__/__snapshots__/create.test.tsx.snap +++ b/dashboards-observability/public/components/application_analytics/__tests__/__snapshots__/create.test.tsx.snap @@ -14,13 +14,13 @@ Object { style="max-width: 1130px;" >
-
-
+
-
- You can't change the base query after the application is created. -
+ You can't change the base query after the application is created.
@@ -282,7 +273,7 @@ Object { class="euiFormRow__fieldWrapper" >
@@ -331,7 +322,7 @@ Object {
The default logs view in the application will be filtered by this query.
@@ -436,11 +427,8 @@ Object {
-
-
+
- +
+
- + +

-

- No matches -

+

+ No matches +

@@ -829,11 +823,8 @@ Object {
diff --git a/dashboards-observability/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/dashboards-observability/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index b2fc1fce3..45ef0c814 100644 --- a/dashboards-observability/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/dashboards-observability/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -246,7 +246,6 @@ exports[`Dashboard component renders dashboard 1`] = ` /> @@ -254,7 +253,6 @@ exports[`Dashboard component renders dashboard 1`] = ` className="euiFormControlLayoutIcons" >
+
-
- - - + + + + + + + +
-
+
@@ -939,51 +947,59 @@ exports[`Dashboard component renders dashboard 1`] = ` display="inlineBlock" hasArrow={true} isOpen={false} - ownFocus={true} + ownFocus={false} panelPaddingSize="m" withTitle={true} > -
- - - + + + +
-
+
@@ -1010,7 +1026,7 @@ exports[`Dashboard component renders dashboard 1`] = ` >
- -

- No matches -

-
+ +

+ No matches +

+
@@ -1260,7 +1276,7 @@ exports[`Dashboard component renders dashboard 1`] = ` >
- - -
- - - - - - + + + Latency + + + + + + +
+ + + - - - - - + + + Error rate + + + + + + +
+ + + - - - - + + + + Throughput + + + + + + +
+ +
@@ -1624,7 +1649,7 @@ exports[`Dashboard component renders dashboard 1`] = ` isInvalid={false} > @@ -1641,7 +1665,6 @@ exports[`Dashboard component renders dashboard 1`] = ` className="euiFormControlLayoutIcons" >
+
@@ -3065,21 +3103,21 @@ exports[`Dashboard component renders empty dashboard 1`] = `
- -

- Trace Analytics not set up -

-
+ +

+ Trace Analytics not set up +

+
@@ -3109,6 +3147,13 @@ exports[`Dashboard component renders empty dashboard 1`] = ` className="euiSpacer euiSpacer--l" /> + +
+
-
- - - + + + +
-
+
@@ -1050,6 +1058,7 @@ exports[`Dashboard table component renders dashboard table 1`] = ` - - - - + + - + Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation. + + } + delay="regular" + position="top" > - - Traces of all requests that share a common API and operation at the start of distributed tracing instrumentation. - - } - delay="regular" - position="top" + - -
- Trace group name - - + Trace group name + + + - - - - -
-
-   -
-
-
-
+ viewBox="0 0 16 16" + width={16} + xmlns="http://www.w3.org/2000/svg" + /> + + +
+
+   +
+ + + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - + Range of latencies for traces within a trace group in the selected time range. + + } + delay="regular" + position="top" > - - Range of latencies for traces within a trace group in the selected time range. - - } - delay="regular" - position="top" + - - Latency variance (ms) - - - - - - - + viewBox="0 0 16 16" + width={16} + xmlns="http://www.w3.org/2000/svg" + /> + + - - + + +
-
- -
- 0                100            200            300            400 -
-
-
- - - - + 0                100            200            300            400 +
+ +
+ + + + + - - + + + + + Click to unsort + + + + - - - - + + - + Average latency of traces within a trace group in the selected time range. + + } + delay="regular" + position="top" > - - Average latency of traces within a trace group in the selected time range. - - } - delay="regular" - position="top" + - -
- Average latency (ms) - - + Average latency (ms) + + + - - - - -
-
-   -
-
-
-
+ viewBox="0 0 16 16" + width={16} + xmlns="http://www.w3.org/2000/svg" + /> + + +
+
+   +
+ + + + + + + + + Click to sort in ascending order - + + + + + + + + +
+ + + + 24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group. + + } + delay="regular" + position="top" + > + +
+ 24-hour latency trend + + + + + + +
+
+   +
+
+
- - +
+
- - 24 hour time series view of hourly average, hourly percentile, and hourly range of latency for traces within a trace group. + Error rate based on count of trace errors within a trace group in the selected time range. } delay="regular" @@ -1478,7 +1607,7 @@ exports[`Dashboard table component renders dashboard table 1`] = ` onMouseOver={[Function]} >
- 24-hour latency trend + Error rate - - - - - - - - - - - + + - + Count of traces with unique trace identifiers in the selected time range. + + } + delay="regular" + position="top" > - - Count of traces with unique trace identifiers in the selected time range. - - } - delay="regular" - position="top" + - -
- Traces - - + Traces + + + - - - - -
-
-   -
-
-
-
+ viewBox="0 0 16 16" + width={16} + xmlns="http://www.w3.org/2000/svg" + /> + +
+
+
+   +
+
+ +
+ + + + + + Click to sort in ascending order - - -
+ + +
@@ -2867,88 +2906,97 @@ exports[`Dashboard table component renders dashboard table 1`] = ` display="inlineBlock" hasArrow={true} isOpen={false} - ownFocus={true} + ownFocus={false} panelPaddingSize="none" + withTitle={true} > -
- - - + + + +
-
+
@@ -2990,7 +3038,7 @@ exports[`Dashboard table component renders dashboard table 1`] = ` > - + > + + + + + +
-
+
diff --git a/dashboards-observability/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/dashboards-observability/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 13aa55a99..0bb2cad16 100644 --- a/dashboards-observability/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/dashboards-observability/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -250,7 +250,6 @@ exports[`Services component renders empty services page 1`] = ` /> @@ -258,7 +257,6 @@ exports[`Services component renders empty services page 1`] = ` className="euiFormControlLayoutIcons" >
+
-
- - - + > + + + + + +
-
+
@@ -920,51 +928,59 @@ exports[`Services component renders empty services page 1`] = ` display="inlineBlock" hasArrow={true} isOpen={false} - ownFocus={true} + ownFocus={false} panelPaddingSize="m" withTitle={true} > -
- - - + + + +
-
+
@@ -991,7 +1007,7 @@ exports[`Services component renders empty services page 1`] = ` >
- -

- Trace Analytics not set up -

-
+ +

+ Trace Analytics not set up +

+
@@ -1117,6 +1133,13 @@ exports[`Services component renders empty services page 1`] = ` className="euiSpacer euiSpacer--l" /> + +
+
- - -
- - - - - - + + + Latency + + + + + + +
+ + + - - - - - + + + Error rate + + + + + + +
+ + + - - - - + + + + Throughput + + + + +
+
+
+ +
@@ -1581,7 +1606,7 @@ exports[`Services component renders empty services page 1`] = ` isInvalid={false} > @@ -1598,7 +1622,6 @@ exports[`Services component renders empty services page 1`] = ` className="euiFormControlLayoutIcons" >
+
-
- - - + + + + + + + +
-
+
@@ -2677,51 +2707,59 @@ exports[`Services component renders services page 1`] = ` display="inlineBlock" hasArrow={true} isOpen={false} - ownFocus={true} + ownFocus={false} panelPaddingSize="m" withTitle={true} > -
- - - + + + +
-
+ @@ -2748,7 +2786,7 @@ exports[`Services component renders services page 1`] = ` >
- -

- No matches -

-
+ +

+ No matches +

+
@@ -2896,7 +2934,7 @@ exports[`Services component renders services page 1`] = ` >
- - -
- - - - - - + + + Latency + + + + + + +
+ + + - - - - - + + + Error rate + + + + + + +
+ + + - - - - + + + + Throughput + + + + + + +
+ + @@ -3260,7 +3307,7 @@ exports[`Services component renders services page 1`] = ` isInvalid={false} > @@ -3277,7 +3323,6 @@ exports[`Services component renders services page 1`] = ` className="euiFormControlLayoutIcons" > - - - - + + - - Average latency (ms) - + Average latency (ms) + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - - Error rate - + Error rate + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - - Throughput - + Throughput + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - - No. of connected services - + No. of connected services + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - - Connected services - + Connected services + + + + + + + Click to sort in ascending order - - - + + + - - - - + + - - Traces - + Traces + + + + + + + Click to sort in ascending order - - - + + + @@ -1459,88 +1528,97 @@ exports[`Services table component renders services table 1`] = ` display="inlineBlock" hasArrow={true} isOpen={false} - ownFocus={true} + ownFocus={false} panelPaddingSize="none" + withTitle={true} > -
- - - + + + +
- +
@@ -1582,7 +1660,7 @@ exports[`Services table component renders services table 1`] = ` > +
+

+ Span detail +

+
+
+
+
+
+ + Overview + +
+
+
+
+
+
+
+ Span ID +
+
+
+
+
+
+
+ +
+
+ + + +
+
+ 67c279e1100d75c3 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Parent span ID +
+
+
+
+
+ + - + +
+
+
+
+
+
+
+
+
+
+ Service +
+
+
+
+
+
+
+ + frontend-client + +
+
+
+
+
+
+
+
+
+
+
+
+
+ Operation +
+
+
+
+
+
+
+ + client_pay_order + +
+
+
+
+
+
+
+
+
+
+
+
+
+ Duration +
+
+
+
+
+
+
+ + 225 ms + +
+
+
+
+
+
+
+
+
+
+
+
+
+ Start time +
+
+
+
+
+
+
+ + 03/25/2021 17:23:45 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ End time +
+
+
+
+
+
+
+ + 03/25/2021 17:23:45 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ Errors +
+
+
+
+
+
+
+ + No + +
+
+
+
+
+
+
+
+
+
+
+ + Span attributes + + + (12) + +
+
+
+
+
+
+
+ droppedAttributesCount +
+
+
+
+
+
+
+ + 0 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ droppedEventsCount +
+
+
+
+
+
+
+ + 0 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ droppedLinksCount +
+
+
+
+
+
+
+ + 0 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ instrumentationLibrary.name +
+
+
+
+
+
+
+ + __main__ + +
+
+
+
+
+
+
+
+
+
+
+
+
+ kind +
+
+
+
+
+
+
+ + SPAN_KIND_INTERNAL + +
+
+
+
+
+
+
+
+
+
+
+
+
+ resource.attributes.host@hostname +
+
+
+
+
+
+
+ + ip-172-31-10-8.us-west-2.compute.internal + +
+
+
+
+
+
+
+
+
+
+
+
+
+ resource.attributes.service@name +
+
+
+
+
+
+
+ + frontend-client + +
+
+
+
+
+
+
+
+
+
+
+
+
+ resource.attributes.telemetry@sdk@language +
+
+
+
+
+
+
+ + python + +
+
+
+
+
+
+
+
+
+
+
+
+
+ resource.attributes.telemetry@sdk@name +
+
+
+
+
+
+
+ + opentelemetry + +
+
+
+
+
+
+
+
+
+
+
+
+
+ resource.attributes.telemetry@sdk@version +
+
+
+
+
+
+
+ + 0.14b0 + +
+
+
+
+
+
+
+
+
+
+
+
+
+ links +
+
+
+
+
+ + - + +
+
+
+
+
+
+
+
+
+
+ traceState +
+
+
+
+
+ + - + +
+
+
+
+
+
+
+
+
+
+
+
+
+`; exports[` spec renders the empty component 1`] = ` spec renders the empty component 1`] = ` event="keydown" handler={[Function]} /> - - -