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

[BACKPORT] Backport 2.x to main #1304

Merged
merged 33 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5fcf787
Fix change availability bug (#667) (#671)
opensearch-trigger-bot[bot] Apr 19, 2022
52ae188
Add release notes for 2.0.0-rc1 (#674) (#675)
opensearch-trigger-bot[bot] Apr 21, 2022
d34e211
Support integTestRemote with security enabled endpoint (#699) (#703)
opensearch-trigger-bot[bot] May 2, 2022
bacb5b2
Add data test subj to app analytics (#704) (#718)
eugenesk24 May 4, 2022
b0ee26c
Remove rc1 reference (#730) (#737)
opensearch-trigger-bot[bot] May 13, 2022
afee280
[Backport] app-analytics features and bug fixes for 2.0 release (#740)
mengweieric May 17, 2022
fa03021
Release notes 2.0.0.0 (#757) (#758)
opensearch-trigger-bot[bot] May 19, 2022
2d93bd3
Incremented version to 2.0.1 (#785)
zelinh Jun 9, 2022
a3fbfcd
Backport from main to 2.1 (#822)
kavithacm Jun 27, 2022
3b0678a
2.1 release notes (#839) (#840)
opensearch-trigger-bot[bot] Jul 6, 2022
4230612
change 2.1 version bump PR under maintenance (#841) (#842)
opensearch-trigger-bot[bot] Jul 7, 2022
da9e9c0
Bump to 2.2.0 (#918)
vamsi-amazon Aug 6, 2022
3a19811
Release Notes for 2.2.0 (#920) (#922)
opensearch-trigger-bot[bot] Aug 6, 2022
cc0974a
Staging for version increment automation (#848) (#939)
opensearch-trigger-bot[bot] Aug 26, 2022
1439357
Increment version to 2.3.0-SNAPSHOT (#979)
opensearch-trigger-bot[bot] Sep 7, 2022
09eb803
release notes for 2.3.0 (#1003) (#1004)
opensearch-trigger-bot[bot] Sep 9, 2022
ada6d20
bump version to 2.4.0 (#1071)
ps48 Oct 4, 2022
5ffac44
update jackson to 2.13.4 (#1062) (#1064)
opensearch-trigger-bot[bot] Oct 14, 2022
17458d4
add group = org.opensearch.plugin (#1115) (#1126)
opensearch-trigger-bot[bot] Oct 14, 2022
fc6ae79
Change auto expand replicas to 0-2 (#1186) (#1190)
opensearch-trigger-bot[bot] Oct 26, 2022
5a90273
[2.x] Add log pattern table (#1187) (#1212)
joshuali925 Nov 1, 2022
4b0a1fe
Release notes for 2.4.0 (#1259) (#1262)
opensearch-trigger-bot[bot] Nov 4, 2022
fe97804
[BACKPORT] Backport 2.4 commits to 2.x (#1277)
mengweieric Nov 18, 2022
fdd58ce
merged 2.x
mengweieric Nov 21, 2022
0ee5e1d
Implementing search feature (#1286)
sejli Nov 23, 2022
0fe1253
fix bug with overriding patterns (#1298)
derek-ho Nov 28, 2022
750d067
Merge branch '2.x' into 2.x-to-main
mengweieric Nov 28, 2022
8718fe7
resolved failing tests and updated snapshots
mengweieric Nov 28, 2022
17b8771
Add metrics framework for frontend and backend (#1306)
joshuali925 Dec 2, 2022
28299fc
[BACKPORT 2.x] QS to 6.5.3 (#1335)
derek-ho Dec 6, 2022
58a3838
Hot fixes and cypress test changes (#1327)
mengweieric Dec 7, 2022
adf936e
merged 2.x and resolved conflicts
mengweieric Dec 7, 2022
d7b7167
resolved couple of minior issues
mengweieric Dec 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
- name: Checkout Plugin
uses: actions/checkout@v1

# Enable longer filenames for windows
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
Expand Down
317 changes: 150 additions & 167 deletions dashboards-observability/.cypress/integration/1_event_analytics.spec.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TEST_QUERIES,
querySearch,
landOnEventVisualizations
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const numberOfWindow = 4;
const legendSize = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TEST_QUERIES,
querySearch,
landOnEventVisualizations,
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const numberOfWindow = 4;
const labelSize = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TEST_QUERIES,
querySearch,
landOnEventVisualizations,
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const numberOfWindow = 4;
const labelSize = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
landOnEventVisualizations,
saveVisualizationAndVerify,
deleteVisualization,
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const renderLogsView = () => {
landOnEventVisualizations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TEST_QUERIES,
querySearch,
landOnEventVisualizations
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const numberOfWindow = 4;
const metricsPrecisionUpdated = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
renderDataConfig,
saveVisualizationAndVerify,
deleteVisualization,
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const renderPieChart = () => {
landOnEventVisualizations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TEST_QUERIES,
querySearch,
landOnEventVisualizations
} from '../../utils/event_constants';
} from '../../utils/event_analytics/constants';

const numberOfWindow = 4;
const labelSize = 20;
Expand Down
1 change: 1 addition & 0 deletions dashboards-observability/.cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

export const delay = 1500;
export const COMMAND_TIMEOUT_LONG = 10000;

// trace analytics
export const TRACE_ID = '8832ed6abbb2a83516461960c89af49d';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { supressResizeObserverIssue } from './constants';
import { COMMAND_TIMEOUT_LONG, supressResizeObserverIssue, TIMEOUT_DELAY } from '../constants';

export const delay = 1000;
export const YEAR_TO_DATE_DOM_ID = '[data-test-subj="superDatePickerCommonlyUsed_Year_to date"]';
Expand Down Expand Up @@ -72,10 +72,13 @@ export const aggregationValues = [
];

export const querySearch = (query, rangeSelected) => {
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(query);
cy.get('[data-test-subj="searchAutocompleteTextArea"]', { timeout: COMMAND_TIMEOUT_LONG })
.clear()
.focus()
.type(query, { delay: 50 });
cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click();
cy.wait(delay);
cy.get(rangeSelected).click();
cy.wait(delay * 2);
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').contains('Refresh').click();
};

Expand All @@ -88,6 +91,7 @@ export const landOnEventExplorer = () => {
cy.visit(
`${Cypress.env('opensearchDashboards')}/app/observability-dashboards#/event_analytics/explorer`
);
supressResizeObserverIssue();
cy.wait(delay);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { COMMAND_TIMEOUT_LONG } from '../constants';

export const clearQuerySearchBoxText = (testSubjectName) => {
cy.get(`[data-test-subj="${testSubjectName}"]`, {
timeout: COMMAND_TIMEOUT_LONG,
}).clear({ force: true });
};
26 changes: 20 additions & 6 deletions dashboards-observability/common/constants/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const RAW_QUERY = 'rawQuery';
export const FINAL_QUERY = 'finalQuery';
export const SELECTED_DATE_RANGE = 'selectedDateRange';
export const INDEX = 'index';
export const SELECTED_PATTERN_FIELD = 'selectedPatternField';
export const PATTERN_REGEX = 'patternRegex';
export const FILTERED_PATTERN = 'filteredPattern';
export const SELECTED_TIMESTAMP = 'selectedTimestamp';
export const SELECTED_FIELDS = 'selectedFields';
export const UNSELECTED_FIELDS = 'unselectedFields';
Expand All @@ -29,7 +32,7 @@ export const TAB_CHART_ID_TXT_PFX = 'main-content-vis-';
export const TAB_EVENT_ID = 'main-content-events';
export const TAB_CHART_ID = 'main-content-vis';
export const HAS_SAVED_TIMESTAMP = 'hasSavedTimestamp';
export const FILTER_OPTIONS = ['Visualization', 'Query'];
export const FILTER_OPTIONS = ['Visualization', 'Query', 'Metric'];
export const SAVED_QUERY = 'savedQuery';
export const SAVED_VISUALIZATION = 'savedVisualization';
export const SAVED_OBJECT_ID = 'savedObjectId';
Expand Down Expand Up @@ -78,11 +81,16 @@ 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';
export const REDUX_EXPL_SLICE_PATTERNS = 'patterns';
export const PLOTLY_GAUGE_COLUMN_NUMBER = 4;
export const APP_ANALYTICS_TAB_ID_REGEX = /application-analytics-tab.+/;
export const DEFAULT_AVAILABILITY_QUERY = 'stats count() by span( timestamp, 1h )';
export const PPL_DEFAULT_PATTERN_REGEX_FILETER = '[a-zA-Z\\d]';
// Greedily matches the longest substring for example (patterns referer | patterns pattern='[0-9]' message | where ...) used to modify the query for patterns table
export const PATTERNS_REGEX = /\|\s*patterns.+?\|.*\s*where\s+patterns_field\s*\=\s*'[^a-zA-Z0-9]+'/;
// Used to extract the initial pattern applied
export const PATTERNS_EXTRACTOR_REGEX = /patterns\s+(?<pattern>\S+)/;
export const ADD_BUTTON_TEXT = '+ Add color theme';
export const ADD_SERIES_POSITION_TEXT = '+ Add label position';
export const NUMBER_INPUT_MIN_LIMIT = 1;

export const VIZ_CONTAIN_XY_AXIS = [
Expand Down Expand Up @@ -281,7 +289,13 @@ export const DATA_CONFIG_HINTS_INFO = {
[BREAKDOWNS]:
"Defines how each series is broken down. Breakdowns are 'by' clauses that subdivide the existing series.",
};
export const SERIES_POSITION_OPTIONS = [
{ id: htmlIdGenerator('ct')(), label: 'Left', side: 'left' },
{ id: htmlIdGenerator('ct')(), label: 'Right', side: 'right' },
];

// Metrics constants
export const UNITS_OF_MEASURE = [
'seconds (s)',
'hours (h)',
'celsius (C)',
'farenheit (F)',
'meters (m)',
'kilometers (k)',
]
26 changes: 26 additions & 0 deletions dashboards-observability/common/constants/metrics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

// requests constants
export const VISUALIZATION = 'viz';
export const SAVED_VISUALIZATION = 'savedVisualization';
export const PPL_DATASOURCES_REQUEST =
'show datasources | where CONNECTOR_TYPE="PROMETHEUS" | fields DATASOURCE_NAME';

// redux
export const REDUX_SLICE_METRICS = 'metrics';

export const resolutionOptions = [
{ value: 's', text: 'seconds' },
{ value: 'm', text: 'minutes' },
{ value: 'h', text: 'hours' },
{ value: 'd', text: 'days' },
// { value: 'M', text: 'Months' }, // commenting it here as prometheus doesn't have support
// { value: 'q', text: 'quarters' },
{ value: 'y', text: 'years' },
];

export const DEFAULT_METRIC_HEIGHT = 2;
export const DEFAULT_METRIC_WIDTH = 12;
2 changes: 2 additions & 0 deletions dashboards-observability/common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const observabilityPluginOrder = 6000;
export const SQL_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/search-plugins/sql/index/';
export const PPL_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/observability-plugin/ppl/commands/';
export const PPL_PATTERNS_DOCUMENTATION_URL =
'https://github.com/opensearch-project/sql/blob/2.x/docs/user/ppl/cmd/patterns.rst#description';
export const UI_DATE_FORMAT = 'MM/DD/YYYY hh:mm A';
export const PPL_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss.SSSSSS';
export const SPAN_REGEX = /span/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ channels { WHITESPACE, ERRORCHANNEL }

// COMMAND KEYWORDS
SEARCH: 'SEARCH';
DESCRIBE: 'DESCRIBE';
SHOW: 'SHOW';
FROM: 'FROM';
WHERE: 'WHERE';
FIELDS: 'FIELDS';
Expand All @@ -23,8 +25,16 @@ HEAD: 'HEAD';
TOP: 'TOP';
RARE: 'RARE';
PARSE: 'PARSE';
METHOD: 'METHOD';
REGEX: 'REGEX';
PUNCT: 'PUNCT';
GROK: 'GROK';
PATTERN: 'PATTERN';
PATTERNS: 'PATTERNS';
NEW_FIELD: 'NEW_FIELD';
KMEANS: 'KMEANS';
AD: 'AD';
ML: 'ML';

// COMMAND ASSIST KEYWORDS
AS: 'AS';
Expand All @@ -33,6 +43,7 @@ SOURCE: 'SOURCE';
INDEX: 'INDEX';
D: 'D';
DESC: 'DESC';
CATALOGS: 'CATALOGS';

// CLAUSE KEYWORDS
SORTBY: 'SORTBY';
Expand All @@ -59,6 +70,7 @@ SAMPLE_SIZE: 'SAMPLE_SIZE';
OUTPUT_AFTER: 'OUTPUT_AFTER';
TIME_DECAY: 'TIME_DECAY';
ANOMALY_RATE: 'ANOMALY_RATE';
CATEGORY_FIELD: 'CATEGORY_FIELD';
TIME_FIELD: 'TIME_FIELD';
TIME_ZONE: 'TIME_ZONE';
TRAINING_DATA_SIZE: 'TRAINING_DATA_SIZE';
Expand Down Expand Up @@ -101,6 +113,7 @@ DAY_SECOND: 'DAY_SECOND';
DAY_MINUTE: 'DAY_MINUTE';
DAY_HOUR: 'DAY_HOUR';
YEAR_MONTH: 'YEAR_MONTH';
CONVERT_TZ: 'CONVERT_TZ';

// DATASET TYPES
DATAMODEL: 'DATAMODEL';
Expand Down Expand Up @@ -168,6 +181,7 @@ VAR_POP: 'VAR_POP';
STDDEV_SAMP: 'STDDEV_SAMP';
STDDEV_POP: 'STDDEV_POP';
PERCENTILE: 'PERCENTILE';
TAKE: 'TAKE';
FIRST: 'FIRST';
LAST: 'LAST';
LIST: 'LIST';
Expand Down Expand Up @@ -222,21 +236,39 @@ TAN: 'TAN';

// DATE AND TIME FUNCTIONS
ADDDATE: 'ADDDATE';
CURDATE: 'CURDATE';
CURRENT_DATE: 'CURRENT_DATE';
CURRENT_TIME: 'CURRENT_TIME';
CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
CURTIME: 'CURTIME';
DATE: 'DATE';
DATE_ADD: 'DATE_ADD';
DATE_FORMAT: 'DATE_FORMAT';
DATE_SUB: 'DATE_SUB';
DAYNAME: 'DAYNAME';
DAYOFMONTH: 'DAYOFMONTH';
DAYOFWEEK: 'DAYOFWEEK';
DAYOFYEAR: 'DAYOFYEAR';
DAYNAME: 'DAYNAME';
FROM_DAYS: 'FROM_DAYS';
LOCALTIME: 'LOCALTIME';
LOCALTIMESTAMP: 'LOCALTIMESTAMP';
FROM_UNIXTIME: 'FROM_UNIXTIME';
MAKEDATE: 'MAKEDATE';
MAKETIME: 'MAKETIME';
MONTHNAME: 'MONTHNAME';
NOW: 'NOW';
PERIOD_ADD: 'PERIOD_ADD';
PERIOD_DIFF: 'PERIOD_DIFF';
SUBDATE: 'SUBDATE';
SYSDATE: 'SYSDATE';
TIME: 'TIME';
TIME_TO_SEC: 'TIME_TO_SEC';
TIMESTAMP: 'TIMESTAMP';
DATE_FORMAT: 'DATE_FORMAT';
TO_DAYS: 'TO_DAYS';
UTC_DATE: 'UTC_DATE';
UTC_TIME: 'UTC_TIME';
UTC_TIMESTAMP: 'UTC_TIMESTAMP';
UNIX_TIMESTAMP: 'UNIX_TIMESTAMP';

// TEXT FUNCTIONS
SUBSTR: 'SUBSTR';
Expand Down Expand Up @@ -267,11 +299,16 @@ ISNOTNULL: 'ISNOTNULL';
IFNULL: 'IFNULL';
NULLIF: 'NULLIF';
IF: 'IF';
TYPEOF: 'TYPEOF';

// RELEVANCE FUNCTIONS AND PARAMETERS
MATCH: 'MATCH';
MATCH_PHRASE: 'MATCH_PHRASE';
MATCH_PHRASE_PREFIX: 'MATCH_PHRASE_PREFIX';
MATCH_BOOL_PREFIX: 'MATCH_BOOL_PREFIX';
SIMPLE_QUERY_STRING: 'SIMPLE_QUERY_STRING';
MULTI_MATCH: 'MULTI_MATCH';
QUERY_STRING: 'QUERY_STRING';

ALLOW_LEADING_WILDCARD: 'ALLOW_LEADING_WILDCARD';
ANALYZE_WILDCARD: 'ANALYZE_WILDCARD';
Expand All @@ -282,6 +319,7 @@ CUTOFF_FREQUENCY: 'CUTOFF_FREQUENCY';
DEFAULT_FIELD: 'DEFAULT_FIELD';
DEFAULT_OPERATOR: 'DEFAULT_OPERATOR';
ENABLE_POSITION_INCREMENTS: 'ENABLE_POSITION_INCREMENTS';
ESCAPE: 'ESCAPE';
FLAGS: 'FLAGS';
FUZZY_MAX_EXPANSIONS: 'FUZZY_MAX_EXPANSIONS';
FUZZY_PREFIX_LENGTH: 'FUZZY_PREFIX_LENGTH';
Expand Down
Loading