Skip to content

Commit

Permalink
merge (#3)
Browse files Browse the repository at this point in the history
* Bump prismjs from 1.24.1 to 1.25.0 (opensearch-project#137)

Bumps [prismjs](https:/PrismJS/prism) from 1.24.1 to 1.25.0.
- [Release notes](https:/PrismJS/prism/releases)
- [Changelog](https:/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.24.1...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump immer from 9.0.5 to 9.0.6 (opensearch-project#136)

Bumps [immer](https:/immerjs/immer) from 9.0.5 to 9.0.6.
- [Release notes](https:/immerjs/immer/releases)
- [Commits](immerjs/immer@v9.0.5...v9.0.6)

---
updated-dependencies:
- dependency-name: immer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Redirect legacy notebooks URL to current observability one (opensearch-project#141)

* Move observability frontend to a sub directory (opensearch-project#142)

* Add minimal plugin for backend observability (opensearch-project#143)

* Add models for objects and requests (opensearch-project#144)

* Add CRUD actions and index operations for observability objects (opensearch-project#145)

* Update data modal and enable CI (opensearch-project#148)

* Panels' visualization design change (opensearch-project#149)

* modified common files

* modified UI components

* modified panel adaptor and router

* moved loading to post http call

* fixed prettier quotes

* Feature timestamp (opensearch-project#152)

* timestamp related changes

Signed-off-by: Eric Wei <[email protected]>

* cleanup

Signed-off-by: Eric Wei <[email protected]>

* removed loggings and change to console error

Signed-off-by: Eric Wei <[email protected]>

* remove unused sidebar component

Signed-off-by: Eric Wei <[email protected]>

* adding cancel button for edit & panel actions (opensearch-project#153)

* Feature toasts errors handling (opensearch-project#155)

* timestamp related changes

Signed-off-by: Eric Wei <[email protected]>

* cleanup

Signed-off-by: Eric Wei <[email protected]>

* removed loggings and change to console error

Signed-off-by: Eric Wei <[email protected]>

* remove unused sidebar component

Signed-off-by: Eric Wei <[email protected]>

* added toasts

Signed-off-by: Eric Wei <[email protected]>

* resolved build failure

Signed-off-by: Eric Wei <[email protected]>

* couple of error handling changes

Signed-off-by: Eric Wei <[email protected]>

* added types

Signed-off-by: Eric Wei <[email protected]>

* Autocomplete only displays current command (opensearch-project#157)

* Only show current command in suggestion
Signed-off by: Eugene Lee <[email protected]>

* Remove console logs
Signed-off by: Eugene Lee <[email protected]>

* Only display suggestion
Signed-off by: Eugene Lee <[email protected]>

* Removed commas
Signed-off by: Eugene Lee <[email protected]>

* Remove import
Signed-off by: Eugene Lee <[email protected]>

* changed to support query without 'search' prefix (opensearch-project#158)

Signed-off-by: Eric Wei <[email protected]>

* Remove app analytics (opensearch-project#154)

* removing app analytics from sidenav

* removed unused headers

* added trace analytics as default page

* Use JS API to redirect legacy notebooks URL (opensearch-project#162)

* Panels bug fix#1 (opensearch-project#159)

* fixed UI bugs #1

* folder name typo fix

* changes for adopting new sql artifact (opensearch-project#165)

* changes for adopting new sql artifact

Signed-off-by: Eric Wei <[email protected]>

* minor changes

Signed-off-by: Eric Wei <[email protected]>

* Improve reindex handling for .opensearch-notebooks (opensearch-project#163)

* inherited datepicker format from settings (opensearch-project#164)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joshua <[email protected]>
Co-authored-by: Shenoy Pratik <[email protected]>
Co-authored-by: Eric Wei <[email protected]>
Co-authored-by: eugenesk24 <[email protected]>
  • Loading branch information
6 people authored Oct 29, 2021
1 parent e7783f8 commit e4d33d3
Show file tree
Hide file tree
Showing 451 changed files with 9,663 additions and 728 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Test and Build Trace Analytics
name: Test and Build Observability Dashboards Plugin

on: [pull_request, push]

Expand All @@ -15,6 +15,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
Expand All @@ -40,14 +43,12 @@ jobs:
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
- name: Checkout Plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/observability
- name: Move Observability to Plugins Dir
run: mv dashboards-observability OpenSearch-Dashboards/plugins/dashboards-observability

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/observability
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn osd bootstrap
# TODO enable unit tests when ready
Expand All @@ -56,22 +57,22 @@ jobs:
# 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/observability
# - name: Upload coverage
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# direcotry: ./OpenSearch-Dashboards/plugins/dashboards-observability

# TODO remove hard coded version when observability is ready
- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/observability
cd OpenSearch-Dashboards/plugins/dashboards-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: observability
path: ./OpenSearch-Dashboards/plugins/observability/build
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test and Build OpenSearch Observability Backend Plugin

on: [pull_request, push]

env:
OPENSEARCH_VERSION: '1.1.0-SNAPSHOT'
OPENSEARCH_BRANCH: '1.1'
COMMON_UTILS_BRANCH: 'main'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.14
uses: actions/setup-java@v1
with:
java-version: 1.14

# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: ${{ env.OPENSEARCH_BRANCH }}
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal

# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
repository: 'opensearch-project/common-utils'
path: common-utils
ref: ${{ env.COMMON_UTILS_BRANCH }}
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

- name: Build with Gradle
run: |
cd opensearch-observability
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
- name: Create Artifact Path
run: |
mkdir -p opensearch-observability-builds
cp -r ./opensearch-observability/build/distributions/*.zip opensearch-observability-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability
path: opensearch-observability-builds
13 changes: 10 additions & 3 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,29 @@ So you want to contribute code to this project? Excellent! We're glad you're her
1. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory.
1. cd into `plugins` directory in the OpenSearch Dashboards source code directory.
1. Check out this package from version control into the `plugins` directory.
1. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/trace-analytics`.
```bash
git clone [email protected]:opensearch-project/trace-analytics.git plugins --no-checkout
cd plugins
echo 'dashboards-observability/*' >> .git/info/sparse-checkout
git config core.sparseCheckout true
git checkout main
```
6. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/dashboards-observability`.

Ultimately, your directory structure should look like this:

```md
.
├── OpenSearch-Dashboards
│ └── plugins
│ └── trace-analytics
│ └── dashboards-observability
```

### Build

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/trace-analytics-dashboards*.zip`
Example output: `./build/observability*.zip`

### Run

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Additionally the fields can be sorted and filtered.

## Documentation

Please see our technical [documentation](https://opensearch.org/docs/monitoring-plugins/trace/index/) to learn more about its features.
Please see our technical [documentation](https://opensearch.org/docs/latest/monitoring-plugins/trace/index/) to learn more about its features.

## Contributing

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,3 @@
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 };
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
export const RAW_QUERY = 'rawQuery';
export const FINAL_QUERY = 'finalQuery';
export const SELECTED_DATE_RANGE = 'selectedDateRange';
export const INDEX = 'indexPattern';
export const INDEX = 'index';
export const SELECTED_TIMESTAMP = 'selectedTimestamp';
export const SELECTED_FIELDS = 'selectedFields';
export const UNSELECTED_FIELDS = 'unselectedFields';
export const AVAILABLE_FIELDS = 'availableFields';
Expand All @@ -23,6 +24,7 @@ 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 HAS_SAVED_TIMESTAMP = 'hasSavedTimestamp';

export const DATE_PICKER_FORMAT = 'YYYY-MM-DD HH:mm:ss';
export const TIME_INTERVAL_OPTIONS = [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const observabilityPluginOrder = 6000;
export const UI_DATE_FORMAT = 'MM/DD/YYYY hh:mm A';
export const PPL_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
export const PPL_STATS_REGEX = /\|\s*stats/i;
export const PPL_INDEX_INSERT_POINT_REGEX = /search (source|index)\s*=\s*([^\s]+)(.*)/i;
export const PPL_INDEX_INSERT_POINT_REGEX = /(search source|source|index)\s*=\s*([^\s]+)(.*)/i;
export const PPL_INDEX_REGEX = /(search source|source|index)\s*=\s*([^|\s]+)/i;

// Observability plugin URI
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ export type CustomPanelListType = {

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

export type PanelType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ import {
SELECTED_FIELDS,
UNSELECTED_FIELDS,
AVAILABLE_FIELDS,
QUERIED_FIELDS
QUERIED_FIELDS,
INDEX,
FINAL_QUERY,
SELECTED_TIMESTAMP,
SELECTED_DATE_RANGE
} from '../constants/explorer';
import { HttpStart } from '../../../../src/core/public';
import SavedObjects from '../../public/services/saved_objects/event_analytics/saved_objects';
import TimestampUtils from '../../public/services/timestamp/timestamp';
import PPLService from '../../public/services/requests/ppl';
import DSLService from '../../public/services/requests/dsl';

export interface IQueryTab {
id: string;
Expand All @@ -38,7 +46,11 @@ export interface ITabQueries {
}

export interface IQuery {
[RAW_QUERY]: string
[RAW_QUERY]: string;
[FINAL_QUERY]: string;
[INDEX]: string;
[SELECTED_DATE_RANGE]: Array<string>;
[SELECTED_TIMESTAMP]: string;
}

export interface IExplorerTabFields {
Expand All @@ -53,7 +65,15 @@ export interface IExplorerFields {
}

export interface ILogExplorerProps {
pplService: any;
dslService: any;
pplService: PPLService;
dslService: DSLService;
savedObjects: SavedObjects;
http: HttpStart;
timestampUtils: TimestampUtils;
setToast: (
title: string,
color?: string,
text?: React.ReactChild | undefined,
side?: string | undefined
) => void;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/

export { getIndexPatternFromRawQuery, insertDateRangeToQuery } from './query_utils';
export { uiSettingsService } from './settings_service';
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const insertDateRangeToQuery = ({
rawQuery,
startTime,
endTime,
timeField = 'utc_time',
timeField,
}: {
rawQuery: string;
startTime: string;
Expand All @@ -47,7 +47,7 @@ export const insertDateRangeToQuery = ({
const tokens = rawQuery.match(PPL_INDEX_INSERT_POINT_REGEX);

if (isEmpty(tokens)) return finalQuery;
finalQuery = `search ${tokens![1]}=${tokens![2]} | where ${timeField} >= timestamp('${start}') and ${timeField} <= timestamp('${end}')${tokens![3]}`;
finalQuery = `${tokens![1]}=${tokens![2]} | where ${timeField} >= timestamp('${start}') and ${timeField} <= timestamp('${end}')${tokens![3]}`;

return finalQuery;
};
23 changes: 23 additions & 0 deletions dashboards-observability/common/utils/settings_service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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.
*/

import { IUiSettingsClient } from '../../../../src/core/public';

let uiSettings: IUiSettingsClient;

export const uiSettingsService = {
init: (client: IUiSettingsClient) => {
uiSettings = client;
},
get: (key: string, defaultOverride?: any) => {
return uiSettings?.get(key, defaultOverride) || '';
},
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e4d33d3

Please sign in to comment.