Skip to content

Commit 4c7a171

Browse files
authored
[Bug] Update observability saved objects to Discover saved objects (#2165)
* changes for the saved objects to point to discover saved objects Signed-off-by: sumukhswamy <[email protected]> * updated comments Signed-off-by: sumukhswamy <[email protected]> * addressed comments Signed-off-by: sumukhswamy <[email protected]> * addressed comments Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]>
1 parent ad6600c commit 4c7a171

File tree

13 files changed

+153
-51
lines changed

13 files changed

+153
-51
lines changed

public/components/integrations/components/__tests__/__snapshots__/setup_integration_inputs.test.tsx.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ exports[`Integration Setup Inputs Renders the connection inputs 1`] = `
772772
hasChildLabel={true}
773773
hasEmptyLabelSpace={false}
774774
helpText="Select a data source to pull the data from."
775-
label="Data Source"
775+
label="Direct query connections"
776776
labelType="label"
777777
>
778778
<div
@@ -792,7 +792,7 @@ exports[`Integration Setup Inputs Renders the connection inputs 1`] = `
792792
className="euiFormLabel euiFormRow__label"
793793
htmlFor="random_html_id"
794794
>
795-
Data Source
795+
Direct query connections
796796
</label>
797797
</EuiFormLabel>
798798
</div>
@@ -1368,7 +1368,7 @@ exports[`Integration Setup Inputs Renders the connection inputs with a locked co
13681368
hasChildLabel={true}
13691369
hasEmptyLabelSpace={false}
13701370
helpText="Select a data source to pull the data from."
1371-
label="Data Source"
1371+
label="Direct query connections"
13721372
labelType="label"
13731373
>
13741374
<div
@@ -1388,7 +1388,7 @@ exports[`Integration Setup Inputs Renders the connection inputs with a locked co
13881388
className="euiFormLabel euiFormRow__label"
13891389
htmlFor="random_html_id"
13901390
>
1391-
Data Source
1391+
Direct query connections
13921392
</label>
13931393
</EuiFormLabel>
13941394
</div>

public/components/integrations/components/added_integration.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/* eslint-disable react-hooks/exhaustive-deps */
66

77
import {
8-
EuiSmallButtonIcon,
98
EuiFlexGroup,
109
EuiFlexItem,
1110
EuiHealth,
@@ -18,6 +17,7 @@ import {
1817
EuiPageHeader,
1918
EuiPageHeaderSection,
2019
EuiPanel,
20+
EuiSmallButtonIcon,
2121
EuiSpacer,
2222
EuiTableFieldDataColumnType,
2323
EuiText,
@@ -29,11 +29,11 @@ import { ASSET_FILTER_OPTIONS } from '../../../../common/constants/integrations'
2929
import { INTEGRATIONS_BASE } from '../../../../common/constants/shared';
3030
import { dataSourceFilterFn } from '../../../../common/utils/shared';
3131
import { useToast } from '../../../../public/components/common/toast';
32+
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';
33+
import { coreRefs } from '../../../framework/core_refs';
3234
import { DeleteModal } from '../../common/helpers/delete_modal';
3335
import { PanelTitle } from '../../trace_analytics/components/common/helper_functions';
3436
import { AddedIntegrationProps } from './integration_types';
35-
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';
36-
import { coreRefs } from '../../../framework/core_refs';
3737

3838
const newNavigation = coreRefs.chrome?.navGroup.getNavGroupEnabled();
3939

@@ -193,8 +193,8 @@ export function AddedIntegration(props: AddedIntegrationProps) {
193193
componentConfig={{
194194
activeOption: [
195195
{
196-
id: data?.references?.[0]?.id,
197-
label: data?.references?.[0]?.name,
196+
id: data?.references?.[0]?.id ?? '',
197+
label: data?.references?.[0]?.name ?? '',
198198
},
199199
],
200200
fullWidth: true,

public/components/integrations/components/integration.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
EuiSpacer,
1919
EuiTab,
2020
EuiTabs,
21+
EuiText,
2122
} from '@elastic/eui';
2223
import React, { ComponentType, useEffect, useState } from 'react';
2324
import { DataSourceSelectorProps } from '../../../../../../src/plugins/data_source_management/public/components/data_source_selector/data_source_selector';
@@ -174,6 +175,7 @@ export function Integration(props: AvailableIntegrationProps) {
174175
<EuiModalHeader>
175176
<EuiModalHeaderTitle>
176177
<h1>Select Data Source</h1>
178+
<EuiText color="subdued">Select which data source to install sample data to</EuiText>
177179
</EuiModalHeaderTitle>
178180
</EuiModalHeader>
179181

public/components/integrations/components/setup_integration_inputs.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const INTEGRATION_CONNECTION_DATA_SOURCE_TYPES: Map<
3434
[
3535
's3',
3636
{
37-
title: 'Data Source',
37+
title: 'Direct query connections',
3838
lower: 'data_source',
3939
help: 'Select a data source to pull the data from.',
4040
},
@@ -224,7 +224,7 @@ export function IntegrationConnectionInputs({
224224
{dataSourceEnabled && (
225225
<>
226226
<EuiCompressedFormRow
227-
label="Data Source"
227+
label="Open Source Connections"
228228
helpText="Select the type of remote data source to query from."
229229
>
230230
<DataSourceSelector
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{"attributes":{"createdTimeMs":1713289099101,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Top IPs by Request Count","query":"SELECT c_ip, COUNT(*) AS request_count FROM {table_name} GROUP BY c_ip ORDER BY request_count DESC LIMIT 10;","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Top IPs by Request Count","version":1},"id":"1d07d010-fc18-11ee-99c9-43e5dbd0692c","references":[],"type":"observability-search","updated_at":"2024-04-16T17:52:30.414Z","version":"WzI3NTEsMV0="}
2-
{"attributes":{"createdTimeMs":1713293044079,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Top Status by Count","query":"SELECT sc_status, COUNT(*) AS status_count FROM {table_name} GROUP BY sc_status ORDER BY status_count DESC LIMIT 10;","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Top Status by Count","version":1},"id":"4c6b8820-fc21-11ee-ab45-d3075d0510e6","references":[],"type":"observability-search","updated_at":"2024-04-16T18:44:47.956Z","version":"WzI4MzAsMV0="}
3-
{"attributes":{"createdTimeMs":1713290175184,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Number of Requests","query":"SELECT COUNT(*) AS request_count FROM {table_name};","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Number of Requests","version":1},"id":"9e6a9b40-fc1a-11ee-99c9-43e5dbd0692c","references":[],"type":"observability-search","updated_at":"2024-04-16T17:56:15.220Z","version":"WzI3NTIsMV0="}
4-
{"attributes":{"createdTimeMs":1713293161193,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Total Bytes Served","query":"SELECT SUM(sc_bytes) AS total_bytes_served FROM {table_name};","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Total Bytes Served","version":1},"id":"92398eb0-fc21-11ee-ab45-d3075d0510e6","references":[],"type":"observability-search","updated_at":"2024-04-16T18:46:01.242Z","version":"WzI4MzEsMV0="}
5-
{"attributes":{"createdTimeMs":1713293269224,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Average Time Taken","query":"SELECT AVG(time_taken) AS average_time_taken FROM {table_name};","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Average Time Taken","version":1},"id":"d2a038a0-fc21-11ee-ab45-d3075d0510e6","references":[],"type":"observability-search","updated_at":"2024-04-16T18:47:49.290Z","version":"WzI4MzIsMV0="}
6-
{"attributes":{"createdTimeMs":1713293425335,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Slow Requests from Average Time threshold","query":"WITH avg_time AS (SELECT AVG(time_to_first_byte) AS avg_time FROM {table_name}) SELECT * FROM {table_name} CROSS JOIN avg_time WHERE time_to_first_byte > 2 * avg_time LIMIT 10;","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Slow Requests from Average Time threshold","version":1},"id":"2fac4250-fc22-11ee-ab45-d3075d0510e6","references":[],"type":"observability-search","updated_at":"2024-04-16T18:59:34.785Z","version":"WzI4MzQsMV0="}
7-
{"attributes":{"createdTimeMs":1713294061574,"savedQuery":{"data_sources":"[{\"name\":\"mys3\",\"type\":\"s3glue\",\"label\":\"mys3\",\"value\":\"mys3\"}]","description":"","name":"Requests by User Agent","query":"SELECT * FROM {table_name} WHERE cs_user_agent LIKE '%Chrome%' LIMIT 10;","query_lang":"SQL","selected_date_range":{"end":"now","start":"now-15m","text":""},"selected_fields":{"text":"","tokens":[]},"selected_timestamp":{"name":"","type":"timestamp"}},"title":"Requests by User Agent","version":1},"id":"aae73c80-fc23-11ee-ab45-d3075d0510e6","references":[],"type":"observability-search","updated_at":"2024-04-16T19:01:01.640Z","version":"WzI4MzUsMV0="}
1+
{"attributes":{"title":"Top IPs by Request Count","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT c_ip, COUNT(*) AS request_count FROM {table_name} GROUP BY c_ip ORDER BY request_count DESC LIMIT 10;\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Top IPs by Request Count","version":1},"id":"1d07d010-fc18-11ee-99c9-43e5dbd0692c","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T17:56:15.220Z","version":"WzI3NTIsMV0=","workspaces":["C8yixd"]}
2+
{"attributes":{"title":"Top Status by Count","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT sc_status, COUNT(*) AS status_count FROM {table_name} GROUP BY sc_status ORDER BY status_count DESC LIMIT 10;\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Top Status by Count","version":1},"id":"4c6b8820-fc21-11ee-ab45-d3075d0510e6","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T18:44:47.956Z","version":"WzI4MzAsMV0=","workspaces":["C8yixd"]}
3+
{"attributes":{"title":"Number of Requests","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT COUNT(*) AS request_count FROM {table_name};\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Number of Requests","version":1},"id":"9e6a9b40-fc1a-11ee-99c9-43e5dbd0692c","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T17:56:15.220Z","version":"WzI3NTIsMV0=","workspaces":["C8yixd"]}
4+
{"attributes":{"title":"Total Bytes Served","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT SUM(sc_bytes) AS total_bytes_served FROM {table_name};\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Total Bytes Served","version":1},"id":"92398eb0-fc21-11ee-ab45-d3075d0510e6","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T18:46:01.242Z","version":"WzI4MzEsMV0=","workspaces":["C8yixd"]}
5+
{"attributes":{"title":"Average Time Taken","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT AVG(time_taken) AS average_time_taken FROM {table_name};\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Average Time Taken","version":1},"id":"d2a038a0-fc21-11ee-ab45-d3075d0510e6","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T18:47:49.290Z","version":"WzI4MzIsMV0=","workspaces":["C8yixd"]}
6+
{"attributes":{"title":"Slow Requests from Average Time threshold","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"WITH avg_time AS (SELECT AVG(time_to_first_byte) AS avg_time FROM {table_name}) SELECT * FROM {table_name} CROSS JOIN avg_time WHERE time_to_first_byte > 2 * avg_time LIMIT 10;\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Slow Requests from Average Time threshold","version":1},"id":"2fac4250-fc22-11ee-ab45-d3075d0510e6","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T18:59:34.785Z","version":"WzI4MzQsMV0=","workspaces":["C8yixd"]}
7+
{"attributes":{"title":"Requests by User Agent","description":"","hits":0,"columns":["_source"],"sort":[],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"SELECT * FROM {table_name} WHERE cs_user_agent LIKE '%Chrome%' LIMIT 10;\",\"language\":\"SQL\",\"dataset\":{\"id\":\"2e1b1b80-9c4d-11ee-8c90-0242ac120001\",\"title\":\"mys3.default.table1\",\"type\":\"s3glue\",\"dataSource\":{\"id\":\"3f2a1e1c-9c4d-11ee-8c90-0242ac120002\",\"name\":\"mys3\",\"type\":\"EXTERNAL\"}}},\"highlightAll\":true,\"version\":true,\"aggs\":{\"2\":{\"date_histogram\":{\"field\":\"timestamp\",\"calendar_interval\":\"1w\",\"time_zone\":\"America/Los_Angeles\",\"min_doc_count\":1}},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}}"},"title":"Requests by User Agent","version":1},"id":"aae73c80-fc23-11ee-ab45-d3075d0510e6","migrationVersion":{"search":"7.9.3"},"type":"search","references":[],"updated_at":"2024-04-16T19:01:01.640Z","version":"WzI4MzUsMV0=","workspaces":["C8yixd"]}
88
{"exportedCount":7,"missingRefCount":0,"missingReferences":[]}

0 commit comments

Comments
 (0)