+ | + double_per_ip_bytes + | ++ host + | ++ ip_count + | ++ per_ip_bytes + | ++ resp_code + | ++ sum_bytes + | +
---|---|---|---|---|---|---|
+ + | +||||||
+ + | +
+
+ |
+
+
+
+
+
+ |
+ + + | +
+ |
+
+
+
+
+
+ |
+ + + | +
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
---|---|---|---|
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Name
+
+
+
+ |
+
+
+ Type
+
+
+
+ Visualization
+
+
+ |
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ Name
+
+
+
+ |
+
+
+ Type
+
+
+
+ Visualization
+
+
+ |
+
+ Select a field +
++ Select a field +
++ Select a field +
++ Select a field +
+
+
order
Average latency: 90.1ms
', + title: 'order\n\nAverage latency: 90.1ms', borderWidth: 0, color: 'rgba(158, 134, 192, 1)', }, @@ -156,7 +156,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 2, label: 'analytics-service', size: 15, - title: 'analytics-service
Average latency: 12.99ms
', + title: 'analytics-service\n\nAverage latency: 12.99ms', borderWidth: 0, color: 'rgba(210, 202, 224, 1)', }, @@ -164,7 +164,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 3, label: 'database', size: 15, - title: 'database
Average latency: 49.54ms
', + title: 'database\n\nAverage latency: 49.54ms', borderWidth: 0, color: 'rgba(187, 171, 212, 1)', }, @@ -172,7 +172,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 4, label: 'frontend-client', size: 15, - title: 'frontend-client
Average latency: 207.71ms
', + title: 'frontend-client\n\nAverage latency: 207.71ms', borderWidth: 0, color: 'rgba(78, 42, 122, 1)', }, @@ -180,7 +180,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 5, label: 'inventory', size: 15, - title: 'inventory
Average latency: 183.52ms
', + title: 'inventory\n\nAverage latency: 183.52ms', borderWidth: 0, color: 'rgba(95, 61, 138, 1)', }, @@ -188,7 +188,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 6, label: 'authentication', size: 15, - title: 'authentication
Average latency: 139.09ms
', + title: 'authentication\n\nAverage latency: 139.09ms', borderWidth: 0, color: 'rgba(125, 95, 166, 1)', }, @@ -196,7 +196,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 7, label: 'payment', size: 15, - title: 'payment
Average latency: 134.36ms
', + title: 'payment\n\nAverage latency: 134.36ms', borderWidth: 0, color: 'rgba(129, 99, 169, 1)', }, @@ -204,7 +204,7 @@ export const TEST_SERVICE_MAP_GRAPH = { id: 8, label: 'recommendation', size: 15, - title: 'recommendation
Average latency: 176.97ms
', + title: 'recommendation\n\nAverage latency: 176.97ms', borderWidth: 0, color: 'rgba(100, 66, 143, 1)', }, diff --git a/dashboards-observability/test/event_analytics_constants.ts b/dashboards-observability/test/event_analytics_constants.ts new file mode 100644 index 000000000..e35504e05 --- /dev/null +++ b/dashboards-observability/test/event_analytics_constants.ts @@ -0,0 +1,472 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { LONG_CHART_COLOR } from '../common/constants/shared'; + +export const AVAILABLE_FIELDS = [ + { + name: 'agent', + type: 'string' + }, + { + name: 'bytes', + type: 'long' + }, + { + name: 'clientip', + type: 'ip' + }, + { + name: 'event', + type: 'struct' + }, + { + name: 'extension', + type: 'string' + }, + { + name: 'geo', + type: 'struct' + }, + { + name: 'host', + type: 'string' + }, + { + name: 'index', + type: 'string' + }, + { + name: 'ip', + type: 'ip' + }, + { + name: 'machine', + type: 'struct' + }, + { + name: 'memory', + type: 'double' + }, + { + name: 'message', + type: 'string' + }, + { + name: 'phpmemory', + type: 'long' + }, + { + name: 'referer', + type: 'string' + }, + { + name: 'request', + type: 'string' + }, + { + name: 'response', + type: 'string' + }, + { + name: 'tags', + type: 'string' + }, + { + name: 'timestamp', + type: 'timestamp' + }, + { + name: 'url', + type: 'string' + }, + { + name: 'utc_time', + type: 'timestamp' + } +]; + +export const QUERY_FIELDS = [ + { + name: 'double_per_ip_bytes', + type: 'long' + }, + { + name: 'host', + type: 'text' + }, + { + name: 'ip_count', + type: 'integer' + }, + { + name: 'per_ip_bytes', + type: 'long' + }, + { + name: 'resp_code', + type: 'text' + }, + { + name: 'sum_bytes', + type: 'long' + } +]; + +export const JSON_DATA = [ + { + ip_count: 176, + sum_bytes: 1021420, + host: 'artifacts.opensearch.org', + resp_code: '404', + per_ip_bytes: 5803, + double_per_ip_bytes: 11606 + }, + { + ip_count: 111, + sum_bytes: 560638, + host: 'www.opensearch.org', + resp_code: '404', + per_ip_bytes: 5050, + double_per_ip_bytes: 10100 + }, + { + ip_count: 94, + sum_bytes: 0, + host: 'artifacts.opensearch.org', + resp_code: '503', + per_ip_bytes: 0, + double_per_ip_bytes: 0 + }, + { + ip_count: 78, + sum_bytes: 0, + host: 'www.opensearch.org', + resp_code: '503', + per_ip_bytes: 0, + double_per_ip_bytes: 0 + }, + { + ip_count: 43, + sum_bytes: 247840, + host: 'cdn.opensearch-opensearch-opensearch.org', + resp_code: '404', + per_ip_bytes: 5763, + double_per_ip_bytes: 11526 + }, + { + ip_count: 34, + sum_bytes: 0, + host: 'cdn.opensearch-opensearch-opensearch.org', + resp_code: '503', + per_ip_bytes: 0, + double_per_ip_bytes: 0 + }, + { + ip_count: 13, + sum_bytes: 57735, + host: 'opensearch-opensearch-opensearch.org', + resp_code: '404', + per_ip_bytes: 4441, + double_per_ip_bytes: 8882 + }, + { + ip_count: 6, + sum_bytes: 0, + host: 'opensearch-opensearch-opensearch.org', + resp_code: '503', + per_ip_bytes: 0, + double_per_ip_bytes: 0 + } +]; + +export const JSON_DATA_ALL = [ + { + referer: 'http://twitter.com/success/wendy-lawrence', + request: '/opensearch/opensearch-1.0.0.deb', + agent: 'Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1', + extension: 'deb', + memory: 'null', + geo: '{"srcdest":"IN:US","src":"IN","coordinates":{"lat":39.41042861,"lon":-88.8454325},"dest":"US"}', + utc_time: '2021-11-14 00:39:02.912', + clientip: '223.87.60.27', + host: 'artifacts.opensearch.org', + event: '{"dataset":"sample_web_logs"}', + phpmemory: 'null', + timestamp: '2021-11-14 00:39:02.912', + ip: '223.87.60.27', + index: 'opensearch_dashboards_sample_data_logs', + message: '223.87.60.27 - - [2018-07-22T00:39:02.912Z] "GET /opensearch/opensearch-1.0.0.deb_1 HTTP/1.1" 200 6219 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1"', + url: 'https://artifacts.opensearch.org/downloads/opensearch/opensearch-1.0.0.deb_1', + tags: 'success', + bytes: 6219, + machine: '{"os":"win 8","ram":8589934592}', + response: '200' + }, + { + referer: 'http://www.opensearch-opensearch-opensearch.com/success/james-mcdivitt', + request: '/beats/metricbeat', + agent: 'Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1', + extension: '', + memory: 'null', + geo: '{"srcdest":"JP:IN","src":"JP","coordinates":{"lat":38.58338806,"lon":-86.46248778},"dest":"IN"}', + utc_time: '2021-11-14 03:26:21.326', + clientip: '130.246.123.197', + host: 'www.opensearch.org', + event: '{"dataset":"sample_web_logs"}', + phpmemory: 'null', + timestamp: '2021-11-14 03:26:21.326', + ip: '130.246.123.197', + index: 'opensearch_dashboards_sample_data_logs', + message: '130.246.123.197 - - [2018-07-22T03:26:21.326Z] "GET /beats/metricbeat_1 HTTP/1.1" 200 6850 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1"', + url: 'https://www.opensearch.org/downloads/beats/metricbeat_1', + tags: 'success', + bytes: 6850, + machine: '{"os":"win 8","ram":3221225472}', + response: '200', + }, + { + referer: 'http://twitter.com/success/konstantin-feoktistov', + request: '/styles/main.css', + agent: 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24', + extension: 'css', + memory: 'null', + geo: '{"srcdest":"CO:DE","src":"CO","coordinates":{"lat":36.96015,"lon":-78.18499861},"dest":"DE"}', + utc_time: '2021-11-14 03:30:25.131', + clientip: '120.49.143.213', + host: 'cdn.opensearch-opensearch-opensearch.org', + event: '{"dataset":"sample_web_logs"}', + phpmemory: 'null', + timestamp: '2021-11-14 03:30:25.131', + ip: '120.49.143.213', + index: 'opensearch_dashboards_sample_data_logs', + message: '120.49.143.213 - - [2018-07-22T03:30:25.131Z] "GET /styles/main.css_1 HTTP/1.1" 503 0 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24"', + url: 'https://cdn.opensearch-opensearch-opensearch.org/styles/main.css_1', + tags: 'success', + bytes: 0, + machine: '{"os":"ios","ram":20401094656}', + response: '503' + }, +]; + +export const AGENT_FIELD = { + name: 'agent', + type: 'string' +}; + +export const SAVED_HISTORIES = [ + { + createdTimeMs: '1638901792922', + lastUpdatedTimeMs: '1638901792922', + objectId: 'Kocoln0BYMuJGDsOwDma', + savedVisualization: { + description: '', + name: 'Mock Flight count by destination save to panel', + query: 'source = opensearch_dashboards_sample_data_flights | stats avg(FlightDelayMin) by Carrier', + type: 'bar', + selected_date_range: { + end: 'now', + start: 'now-15m', + text: '' + }, + selected_fields: { + text: '', + tokens: [] + }, + selected_timestamp: { + name: 'timestamp', + type: 'timestamp' + } + }, + tenant: '', + }, + { + createdTimeMs: '1638901777572', + lastUpdatedTimeMs: '1638901777572', + objectId: 'KIcoln0BYMuJGDsOhDmk', + savedVisualization: { + description: '', + name: 'Mock Flight count by destination', + query: 'source = opensearch_dashboards_sample_data_flights | stats avg(FlightDelayMin) by Carrier', + type: 'bar', + selected_date_range: { + end: 'now', + start: 'now-15m', + text: '' + }, + selected_fields: { + text: '', + tokens: [] + }, + selected_timestamp: { + name: 'timestamp', + type: 'timestamp' + } + }, + tenant: '', + } +]; + +export const SELECTED_PANELS_OPTIONS = [ + { + label: '[Logs] Web traffic Panel', + panel: { + dateCreated: 1637781403888, + dateModified: 1637781403888, + id: 'uRZgU30B661cwDZT-ILw', + name: '[Logs] Web traffic Panel' + }, + }, + { + label: '[Logs] Web traffic Panel 2', + panel: { + dateCreated: 1637781403888, + dateModified: 1637781403888, + id: 'uRZgU30B661cwDZT-ILw', + name: '[Logs] Web traffic Panel' + }, + } +]; + +export const DATA_GRID_ROWS = [ + { + AvgTicketPrice: 841.2656, + Cancelled: 'false', + Carrier: 'OpenSearch Dashboards Airlines', + Dest: 'Sydney Kingsford Smith International Airport', + DestAirportID: 'SYD', + DestCityName: 'Sydney', + DestCountry: 'AU', + DestLocation: '{\"lat\":-33.94609833,\"lon\":151.177002}', + DestRegion: 'SE-BD', + DestWeather: "Rain", + DistanceKilometers: 16492.326, + DistanceMiles: 10247.856, + FlightDelay: 'false', + FlightDelayMin: 0, + FlightDelayType: 'No Delay', + FlightNum: '9HY9SWR', + FlightTimeHour: '17.179506930998397', + FlightTimeMin: 1030.7704, + Origin: 'Frankfurt am Main Airport', + OriginAirportID: "FRA", + OriginCityName: 'Frankfurt am Main', + OriginCountry: 'DE', + OriginLocation: '{\"lat\":50.033333,\"lon\":8.570556}', + OriginRegion: 'DE-HE', + OriginWeather: 'Sunny', + dayOfWeek: 0, + timestamp: "2021-05-24 00:00:00" + }, + { + AvgTicketPrice: 882.98267, + Cancelled: 'false', + Carrier: 'Logstash Airways', + Dest: 'Venice Marco Polo Airport', + DestAirportID: 'VE05', + DestCityName: 'Venice', + DestCountry: 'IT', + DestLocation: '{\"lat\":45.505299,\"lon\":12.3519}', + DestRegion: 'IT-34', + DestWeather: "Sunny", + DistanceKilometers: 8823.4, + DistanceMiles: 5482.6064, + FlightDelay: 'false', + FlightDelayMin: 0, + FlightDelayType: 'No Delay', + FlightNum: 'X98CCZO', + FlightTimeHour: '7.73982468459836', + FlightTimeMin: 464.3895, + Origin: 'Cape Town International Airport', + OriginAirportID: "CPT", + OriginCityName: 'Cape Town', + OriginCountry: 'ZA', + OriginLocation: '{\"lat\":-33.96480179,\"lon\":18.60169983}', + OriginRegion: 'SE-BD', + OriginWeather: 'Clear', + dayOfWeek: 0, + timestamp: "2021-05-24 18:27:00" + } +]; + +export const SAMPLE_VISUALIZATIONS = { + data: { + 'count()': [2549, 9337, 1173], + 'span(timestamp,1M)': [ + '2021-05-01 00:00:00', + '2021-06-01 00:00:00', + '2021-07-01 00:00:00' + ], + }, + jsonData: [ + { + 'count()': 2549, + 'span(timestamp,1M)': '2021-05-01 00:00:00' + }, + { + 'count()': 9337, + 'span(timestamp,1M)': '2021-06-01 00:00:00' + }, + { + 'count()': 2549, + 'span(timestamp,1M)': '2021-07-01 00:00:00' + } + ], + metadata: { + fields: [ + { + name: 'count()', + type: 'integer' + }, + { + name: 'span(timestamp,1M)', + type: 'timestamp' + } + ] + } +}; + +export const VISUALIZATION_TYPES = [ + { + fullLabel: 'Bar', + id: 'bar', + label: 'bar', + selection: { + dataLoss: 'nothing' + }, + visualizationId: 'vis-bar-6636' + }, + { + fullLabel: 'H. Bar', + id: 'horizontal_bar', + label: 'H. Bar', + selection: { + dataLoss: 'nothing' + }, + visualizationId: 'vis-bar-6637' + }, + { + fullLabel: 'Line', + id: 'line', + label: 'line', + selection: { + dataLoss: 'nothing' + }, + visualizationId: 'vis-bar-6638' + } +]; + +export const LAYOUT_CONFIG = { + showlegend: true, + margin: { + l: 60, + r: 10, + b: 15, + t: 30, + pad: 0, + }, + height: 220, + colorway: [LONG_CHART_COLOR], +}; \ No newline at end of file diff --git a/opensearch-observability/build.gradle b/opensearch-observability/build.gradle index 906a0aec8..7cd5c88a7 100644 --- a/opensearch-observability/build.gradle +++ b/opensearch-observability/build.gradle @@ -9,7 +9,7 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask buildscript { ext { - opensearch_version = System.getProperty("opensearch.version", "1.2.1-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "1.2.3-SNAPSHOT") // 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2') common_utils_version = System.getProperty("common_utils.version", opensearch_build) @@ -262,7 +262,7 @@ String bwcFilePath = "src/test/kotlin/org/opensearch/observability/resources/bwc testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["1.1.0","1.2.1-SNAPSHOT"] + versions = ["1.1.0",opensearch_version] numberOfNodes = 3 plugin(provider(new Callable