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 2.x] [Bug] Update observability saved objects to Discover saved objects #2166

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -772,7 +772,7 @@ exports[`Integration Setup Inputs Renders the connection inputs 1`] = `
hasChildLabel={true}
hasEmptyLabelSpace={false}
helpText="Select a data source to pull the data from."
label="Data Source"
label="Direct query connections"
labelType="label"
>
<div
Expand All @@ -792,7 +792,7 @@ exports[`Integration Setup Inputs Renders the connection inputs 1`] = `
className="euiFormLabel euiFormRow__label"
htmlFor="random_html_id"
>
Data Source
Direct query connections
</label>
</EuiFormLabel>
</div>
Expand Down Expand Up @@ -1368,7 +1368,7 @@ exports[`Integration Setup Inputs Renders the connection inputs with a locked co
hasChildLabel={true}
hasEmptyLabelSpace={false}
helpText="Select a data source to pull the data from."
label="Data Source"
label="Direct query connections"
labelType="label"
>
<div
Expand All @@ -1388,7 +1388,7 @@ exports[`Integration Setup Inputs Renders the connection inputs with a locked co
className="euiFormLabel euiFormRow__label"
htmlFor="random_html_id"
>
Data Source
Direct query connections
</label>
</EuiFormLabel>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { ASSET_FILTER_OPTIONS } from '../../../../common/constants/integrations'
import { INTEGRATIONS_BASE } from '../../../../common/constants/shared';
import { dataSourceFilterFn } from '../../../../common/utils/shared';
import { useToast } from '../../../../public/components/common/toast';
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';
import { coreRefs } from '../../../framework/core_refs';
import { DeleteModal } from '../../common/helpers/delete_modal';
import { PanelTitle } from '../../trace_analytics/components/common/helper_functions';
import { AddedIntegrationProps } from './integration_types';
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';
import { coreRefs } from '../../../framework/core_refs';

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

Expand Down Expand Up @@ -193,8 +193,8 @@ export function AddedIntegration(props: AddedIntegrationProps) {
componentConfig={{
activeOption: [
{
id: data?.references?.[0]?.id,
label: data?.references?.[0]?.name,
id: data?.references?.[0]?.id ?? '',
label: data?.references?.[0]?.name ?? '',
},
],
fullWidth: true,
Expand Down
2 changes: 2 additions & 0 deletions public/components/integrations/components/integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
EuiSpacer,
EuiTab,
EuiTabs,
EuiText,
} from '@elastic/eui';
import React, { ComponentType, useEffect, useState } from 'react';
import { DataSourceSelectorProps } from '../../../../../../src/plugins/data_source_management/public/components/data_source_selector/data_source_selector';
Expand Down Expand Up @@ -174,6 +175,7 @@ export function Integration(props: AvailableIntegrationProps) {
<EuiModalHeader>
<EuiModalHeaderTitle>
<h1>Select Data Source</h1>
<EuiText color="subdued">Select which data source to install sample data to</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const INTEGRATION_CONNECTION_DATA_SOURCE_TYPES: Map<
[
's3',
{
title: 'Data Source',
title: 'Direct query connections',
lower: 'data_source',
help: 'Select a data source to pull the data from.',
},
Expand Down Expand Up @@ -224,7 +224,7 @@ export function IntegrationConnectionInputs({
{dataSourceEnabled && (
<>
<EuiCompressedFormRow
label="Data Source"
label="Open Source Connections"
helpText="Select the type of remote data source to query from."
>
<DataSourceSelector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"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="}
{"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="}
{"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="}
{"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="}
{"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="}
{"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="}
{"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="}
{"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"]}
{"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"]}
{"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"]}
{"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"]}
{"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"]}
{"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"]}
{"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"]}
{"exportedCount":7,"missingRefCount":0,"missingReferences":[]}
Loading
Loading