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

Merge observability into main branch #135

Merged
merged 61 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f9d1116
ppl api
mengweieric Apr 9, 2021
9dd0c89
added gitignore
mengweieric Apr 9, 2021
8225377
added few config files
mengweieric Apr 9, 2021
256544e
UI prototype, search, data grid, date filter
mengweieric Apr 20, 2021
06628c4
commmon endpoints
mengweieric Apr 20, 2021
e613ed5
added cypress dep
mengweieric Apr 20, 2021
b5505b1
added explorer
mengweieric Apr 21, 2021
42e0a68
added live stream switch and some other minor changes
mengweieric Apr 28, 2021
912852a
explorer tabs
mengweieric Apr 28, 2021
58df410
added types
mengweieric Apr 28, 2021
31e589b
general discover table UI for log explorer
mengweieric May 5, 2021
5ae4338
move state for each tab one level up
mengweieric May 13, 2021
534accc
sidebar, searchbar styling, field selector
mengweieric May 22, 2021
b1cdb1c
fixed tab content not updating issue
mengweieric May 25, 2021
d21d6d8
removed comments and unused vars
mengweieric May 25, 2021
e6c8139
Migrated from kibana to opensearch
mengweieric Jun 3, 2021
c596ea2
license
mengweieric Jun 3, 2021
5a41dd1
os migration + code cleanup
mengweieric Jun 10, 2021
7a59618
use sql/ppl plugin
mengweieric Jun 10, 2021
0df3500
code cleanup and some refactorings
mengweieric Jun 20, 2021
d03d01b
added new license
mengweieric Jun 21, 2021
f75b03c
added sidebar & home page
mengweieric Jul 8, 2021
8be791d
code clean up
mengweieric Jul 9, 2021
e9f1aed
Merge pull request #64 from opensearch-project/feature/pluginsidebar
mengweieric Jul 9, 2021
2442f53
Feature/visualization (#83)
mengweieric Aug 6, 2021
4c7755b
Feature/observability custom panels (#87)
ps48 Aug 10, 2021
8ba0533
Feature/visualization (#88)
mengweieric Aug 18, 2021
0ca74e0
Feature query regex (#94)
mengweieric Aug 25, 2021
44c4d04
Move documents and repo setups
joshuali925 Aug 26, 2021
0ea8099
Remove manual sidenav index
joshuali925 Aug 26, 2021
2af17ab
Add placeholders pages for trace analytics
joshuali925 Aug 27, 2021
6179cd6
Move TA to subdirectory
joshuali925 Aug 27, 2021
5f0f841
Merge remote-tracking branch 'TA/main' into feature/merge-trace-analy…
joshuali925 Aug 27, 2021
6563071
Move TA to subdirectory
joshuali925 Aug 27, 2021
590849f
Update maintainers
joshuali925 Aug 27, 2021
3243dca
Disable workflows
joshuali925 Aug 27, 2021
910714b
Merge branch 'feature/setup-trace-analytics' into feature/merge-trace…
joshuali925 Aug 27, 2021
2109b3c
Set up repo to prepare merging trace analytics (#97)
joshuali925 Aug 27, 2021
92dc061
Merge branch 'feature/observability' of github.com:opensearch-project…
joshuali925 Aug 27, 2021
f714958
Move observability to trace analytics position in dashboards side nav
joshuali925 Aug 27, 2021
46b3bea
Organize trace analytics project structure
joshuali925 Aug 27, 2021
85d991d
Feature/custom panel add viz (#98)
ps48 Aug 31, 2021
1bb5888
Migrate trace analytics components to observability
joshuali925 Aug 30, 2021
d060a6a
Merge branch 'feature/observability' into feature/merge-trace-analytics
joshuali925 Aug 31, 2021
f340db4
Fix corner cases for side nav when finding selected id (#101)
joshuali925 Aug 31, 2021
74ba9ad
Refactor constants and remove unused trace analytics components
joshuali925 Sep 1, 2021
09970db
Merge trace analytics from main branch into observability (#102)
joshuali925 Sep 1, 2021
91193e5
Feature/field search and sorting (#103)
mengweieric Sep 2, 2021
69e78b3
Merge branch 'main' into feature/trace-analytics-tests
joshuali925 Sep 3, 2021
0e401aa
Update UT and IT for trace analytics
joshuali925 Sep 3, 2021
e60b1cd
Update CI workflow file for observability
joshuali925 Sep 3, 2021
d723e2b
Refactor trace analytics UT and IT, sync main branch (#107)
joshuali925 Sep 3, 2021
a42bd83
Added ppl query filter, added router placeholder for panels (#108)
ps48 Sep 9, 2021
7f699c0
Added Algolia Autocomplete Bar (#110)
sejli Sep 10, 2021
a059f2a
Merge notebooks frontend to observability (#109)
joshuali925 Sep 13, 2021
afd0c78
Adding plugin backend adaptor (#126)
ps48 Oct 6, 2021
618d5b1
Update notebooks to use observability backend (#129)
joshuali925 Oct 8, 2021
f3f7a8f
Event Analytics - Add index picker to explorer page (#125)
kavithacm Oct 11, 2021
059d81a
Feature/operational panels backend (#130)
ps48 Oct 12, 2021
f1d3512
Feature/p1 release (#133)
mengweieric Oct 14, 2021
4ae70c4
Feature/operational panel UI (#132)
ps48 Oct 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
413 changes: 413 additions & 0 deletions .cypress/integration/notebooks.spec.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('Dump test data', () => {

describe('Testing dashboard table empty state', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/dashboard', {
cy.visit('app/observability#/trace_analytics/home', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand All @@ -104,7 +104,7 @@ describe('Testing dashboard table empty state', () => {

describe('Testing dashboard table', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/dashboard', {
cy.visit('app/observability#/trace_analytics/home', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('Testing dashboard table', () => {
cy.contains(' (13)').should('exist');
cy.contains('client_create_order').should('exist');

cy.get('.euiSideNavItemButton__label').contains('Dashboard').click();
cy.get('.euiSideNavItemButton__label').contains('Trace analytics').click();
cy.wait(delay);

cy.contains('client_create_order').should('exist');
Expand All @@ -163,7 +163,7 @@ describe('Testing dashboard table', () => {

describe('Testing plots', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/dashboard', {
cy.visit('app/observability#/trace_analytics/home', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { delay, SERVICE_NAME, setTimeFilter } from '../utils/constants';

describe('Testing services table empty state', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/services', {
cy.visit('app/observability#/trace_analytics/services', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand All @@ -46,7 +46,7 @@ describe('Testing services table empty state', () => {

describe('Testing services table', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/services', {
cy.visit('app/observability#/trace_analytics/services', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('Testing service view empty state', () => {
if (err.message.includes('ResizeObserver loop'))
return false;
});
cy.visit(`app/trace-analytics-dashboards#/services/${SERVICE_NAME}`, {
cy.visit(`app/observability#/trace_analytics/services/${SERVICE_NAME}`, {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand All @@ -99,7 +99,7 @@ describe('Testing service view', () => {
if (err.message.includes('ResizeObserver loop'))
return false;
});
cy.visit(`app/trace-analytics-dashboards#/services/${SERVICE_NAME}`, {
cy.visit(`app/observability#/trace_analytics/services/${SERVICE_NAME}`, {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { delay, setTimeFilter, SPAN_ID, TRACE_ID } from '../utils/constants';

describe('Testing traces table empty state', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/traces', {
cy.visit('app/observability#/trace_analytics/traces', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand All @@ -46,7 +46,7 @@ describe('Testing traces table empty state', () => {

describe('Testing traces table', () => {
beforeEach(() => {
cy.visit('app/trace-analytics-dashboards#/traces', {
cy.visit('app/observability#/trace_analytics/traces', {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('Testing traces table', () => {

describe('Testing trace view', () => {
beforeEach(() => {
cy.visit(`app/trace-analytics-dashboards#/traces/${TRACE_ID}`, {
cy.visit(`app/observability#/trace_analytics/traces/${TRACE_ID}`, {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
},
Expand Down
49 changes: 44 additions & 5 deletions .cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
* permissions and limitations under the License.
*/

export const delay = 1500;

// trace analytics
export const TRACE_ID = '8832ed6abbb2a83516461960c89af49d';
export const SPAN_ID = 'a673bc074b438374';
export const SERVICE_NAME = 'frontend-client';

export const testDataSet = [
{
mapping_url: 'https://raw.githubusercontent.com/opensearch-project/trace-analytics/main/.cypress/utils/otel-v1-apm-service-map-mappings.json',
Expand All @@ -42,11 +49,6 @@ export const testDataSet = [
},
]

export const delay = 1500;
export const TRACE_ID = '8832ed6abbb2a83516461960c89af49d';
export const SPAN_ID = 'a673bc074b438374';
export const SERVICE_NAME = 'frontend-client';

export const setTimeFilter = (setEndTime = false, refresh = true) => {
const startTime = 'Mar 25, 2021 @ 10:00:00.000';
const endTime = 'Mar 25, 2021 @ 11:00:00.000';
Expand Down Expand Up @@ -74,3 +76,40 @@ export const setTimeFilter = (setEndTime = false, refresh = true) => {
if (refresh) cy.get('.euiButton__text').contains('Refresh').click();
cy.wait(delay);
};

// notebooks
export const TEST_NOTEBOOK = 'Test Notebook';
export const SAMPLE_URL = 'https://github.com/opensearch-project/sql/tree/main/sql-jdbc';
export const MARKDOWN_TEXT = `%md
# Heading 1

#### List and links

* 1
* 2
* [SQL JDBC](${SAMPLE_URL})

---
#### Code block
* Explain SQL
\`\`\`
POST _plugins/_sql/_explain
{
"query": "SELECT * FROM my-index LIMIT 50"
}
\`\`\`

#### Table
| a1 | b1 | c1 | d1 |
|----|----|----|----|
| a2 | b2 | c2 | d2 |
| a3 | b3 | c3 | d3 |
`

export const SQL_QUERY_TEXT = `%sql
select * from opensearch_dashboards_sample_data_flights limit 20
`

export const PPL_QUERY_TEXT = `%ppl
source=opensearch_dashboards_sample_data_flights
`
26 changes: 14 additions & 12 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Test and Build Trace Analytics
on: [pull_request, push]

env:
PLUGIN_NAME: trace-analytics-dashboards
PLUGIN_NAME: observability
OPENSEARCH_VERSION: '1.x'
OPENSEARCH_PLUGIN_VERSION: 1.1.0.0

Expand Down Expand Up @@ -43,33 +43,35 @@ jobs:
- name: Checkout Plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/trace-analytics
path: OpenSearch-Dashboards/plugins/observability

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
cd OpenSearch-Dashboards/plugins/observability
yarn osd bootstrap

- name: Test
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
yarn test --coverage
# TODO enable unit tests when ready
# - name: Test
# run: |
# cd OpenSearch-Dashboards/plugins/observability
# yarn test --coverage

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
direcotry: ./OpenSearch-Dashboards/plugins/trace-analytics
direcotry: ./OpenSearch-Dashboards/plugins/observability

# TODO remove hard coded version when observability is ready
- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
yarn build
cd OpenSearch-Dashboards/plugins/observability
yarn build --opensearch-dashboards-version 1.1.0
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: trace-analytics
path: ./OpenSearch-Dashboards/plugins/trace-analytics/build
name: observability
path: ./OpenSearch-Dashboards/plugins/observability/build

13 changes: 8 additions & 5 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Trace Analytics Maintainers
# Observability Maintainers

## Maintainers
| Maintainer | GitHub ID | Affiliation |
|------------------------|---------------------------------------------------|-------------|
| David Cui | [davidcui1225](https://github.com/davidcui1225) | Amazon |
| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
| Maintainer | GitHub ID | Affiliation |
|---------------|-------------------------------------------------|-------------|
| David Cui | [davidcui1225](https://github.com/davidcui1225) | Amazon |
| Eric Wei | [mengweieric](https://github.com/mengweieric) | Amazon |
| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
| Sean Li | [sejli](https://github.com/sejli) | Amazon |
| Shenoy Pratik | [ps48](https://github.com/ps48) | Amazon |
37 changes: 37 additions & 0 deletions common/constants/custom_panels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const CUSTOM_PANELS_API_PREFIX = '/api/observability/operational_panels';
export const CUSTOM_PANELS_DOCUMENTATION_URL = 'https://www.opensearch.org';
export const CREATE_PANEL_MESSAGE = 'Enter a name to describe the purpose of this custom panel.';
export const RENAME_VISUALIZATION_MESSAGE =
'Enter a name to describe the purpose of this visualization.';

export type VisualizationType = {
id: string;
title: string;
x: number;
y: number;
w: number;
h: number;
query: string;
type: string;
};

export type PanelType = {
name: string;
dateCreated: string;
dateModified: string;
visualizations: VisualizationType[];
timeRange: { to: string; from: string };
queryFilter: { query: string; language: string };
refreshConfig: { pause: string; value: string };
};
69 changes: 69 additions & 0 deletions common/constants/explorer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const RAW_QUERY = 'rawQuery';
export const FINAL_QUERY = 'finalQuery';
export const SELECTED_DATE_RANGE = 'selectedDateRange';
export const INDEX = 'indexPattern';
export const SELECTED_FIELDS = 'selectedFields';
export const UNSELECTED_FIELDS = 'unselectedFields';
export const AVAILABLE_FIELDS = 'availableFields';
export const QUERIED_FIELDS = 'queriedFields';
export const TAB_ID_TXT_PFX = 'query-panel-';
export const TAB_TITLE = 'New query';
export const TAB_CHART_TITLE = 'Visualizations';
export const TAB_EVENT_TITLE = 'Events';
export const TAB_EVENT_ID_TXT_PFX = 'main-content-events-';
export const TAB_CHART_ID_TXT_PFX = 'main-content-vis-';

export const DATE_PICKER_FORMAT = 'YYYY-MM-DD HH:mm:ss';
export const TIME_INTERVAL_OPTIONS = [
{
display: 'Auto',
val: 'h' // same as value of Hour for now
},
{
display: 'Minute',
val: 'm'
},
{
display: 'Hour',
val: 'h'
},
{
display: 'Day',
val: 'd'
},
{
display: 'Week',
val: 'w'
},
{
display: 'Month',
val: 'M'
},
{
display: 'Year',
val: 'y'
},
]

// redux
export const SELECTED_QUERY_TAB = 'selectedQueryTab';
export const QUERY_TAB_IDS = 'queryTabIds';
export const NEW_SELECTED_QUERY_TAB = 'newSelectedQueryTab';
export const REDUX_EXPL_SLICE_QUERIES = 'queries';
export const REDUX_EXPL_SLICE_QUERY_RESULT = 'queryResults';
export const REDUX_EXPL_SLICE_FIELDS = 'fields';
export const REDUX_EXPL_SLICE_QUERY_TABS = 'queryTabs';
export const REDUX_EXPL_SLICE_VISUALIZATION = 'explorerVisualization';
export const REDUX_EXPL_SLICE_COUNT_DISTRIBUTION = 'countDistributionVisualization'

29 changes: 29 additions & 0 deletions common/constants/notebooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const NOTEBOOKS_API_PREFIX = '/api/observability/notebooks';
export const NOTEBOOKS_SELECTED_BACKEND = 'DEFAULT'; // ZEPPELIN || DEFAULT
export const NOTEBOOKS_FETCH_SIZE = 1000;
export const CREATE_NOTE_MESSAGE = 'Enter a name to describe the purpose of this notebook.';
export const NOTEBOOKS_DOCUMENTATION_URL = 'https://opensearch.org/docs/dashboards/notebooks/';

export const zeppelinURL = 'http://localhost:8080';

export const wreckOptions = {
baseUrl: zeppelinURL,
headers: { 'Content-Type': 'application/json' },
};

const BASE_NOTEBOOKS_URI = '/_plugins/_notebooks';
export const OPENSEARCH_NOTEBOOKS_API = {
GET_NOTEBOOKS: `${BASE_NOTEBOOKS_URI}/notebooks`,
NOTEBOOK: `${BASE_NOTEBOOKS_URI}/notebook`,
};
Loading