Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
897a63c
Bump prismjs from 1.24.1 to 1.25.0 (#137)
dependabot[bot] Oct 18, 2021
6a06e24
Bump immer from 9.0.5 to 9.0.6 (#136)
dependabot[bot] Oct 18, 2021
d360344
Redirect legacy notebooks URL to current observability one (#141)
joshuali925 Oct 18, 2021
a5e92f3
Move observability frontend to a sub directory (#142)
joshuali925 Oct 19, 2021
796be2e
Add minimal plugin for backend observability (#143)
joshuali925 Oct 19, 2021
938e5b6
Add models for objects and requests (#144)
joshuali925 Oct 19, 2021
fbebd6c
Add CRUD actions and index operations for observability objects (#145)
joshuali925 Oct 19, 2021
9015a96
Update data modal and enable CI (#148)
joshuali925 Oct 20, 2021
fc5f9c3
Panels' visualization design change (#149)
ps48 Oct 21, 2021
51be6de
Feature timestamp (#152)
mengweieric Oct 22, 2021
9aa0c23
adding cancel button for edit & panel actions (#153)
ps48 Oct 22, 2021
254c428
Feature toasts errors handling (#155)
mengweieric Oct 25, 2021
103281b
Autocomplete only displays current command (#157)
eugenesk24 Oct 26, 2021
eaf5fdd
changed to support query without 'search' prefix (#158)
mengweieric Oct 26, 2021
8e95476
Remove app analytics (#154)
ps48 Oct 27, 2021
769d028
Use JS API to redirect legacy notebooks URL (#162)
joshuali925 Oct 27, 2021
45932e6
Panels bug fix#1 (#159)
ps48 Oct 28, 2021
2731780
changes for adopting new sql artifact (#165)
mengweieric Oct 28, 2021
a6a7991
Improve reindex handling for .opensearch-notebooks (#163)
joshuali925 Oct 28, 2021
b8c67ca
inherited datepicker format from settings (#164)
ps48 Oct 28, 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
  •  
  •  
  •  
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 git@github.com: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.
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
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
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;
}
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.
Loading