+ {i18n.translate(
+ 'xpack.upgradeAssistant.checkupTab.reindexing.flyout.learnMoreLinkLabel',
+ {
+ defaultMessage: 'Learn more',
+ }
+ )}
+
+ ),
+ }}
+ />
+
+
+ >
+ )}
= ({
/>
) : (
{
expect(upgradeStatus.totalCriticalDeprecations).toBe(0);
});
+ it('filters out frozen indices if old index deprecations exist for the same indices', async () => {
+ esClient.asCurrentUser.migration.deprecations.mockResponse({
+ cluster_settings: [],
+ node_settings: [],
+ ml_settings: [],
+ index_settings: {
+ frozen_index: [
+ {
+ level: 'critical',
+ message: 'Old index with a compatibility version < 8.0',
+ url: 'https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking-changes-8.0',
+ details: 'This index has version: 7.17.28-8.0.0',
+ resolve_during_rolling_upgrade: false,
+ _meta: { reindex_required: true },
+ },
+ {
+ level: 'critical',
+ message:
+ 'Index [frozen_index] is a frozen index. The frozen indices feature is deprecated and will be removed in version 9.0.',
+ url: 'https://www.elastic.co/guide/en/elasticsearch/reference/master/frozen-indices.html',
+ details:
+ 'Frozen indices must be unfrozen before upgrading to version 9.0. (The legacy frozen indices feature no longer offers any advantages. You may consider cold or frozen tiers in place of frozen indices.)',
+ resolve_during_rolling_upgrade: false,
+ },
+ ],
+ },
+ data_streams: {},
+ // @ts-expect-error not in types yet
+ ilm_policies: {},
+ templates: {},
+ });
+
+ // @ts-expect-error not full interface of response
+ esClient.asCurrentUser.indices.resolveIndex.mockResponse(resolvedIndices);
+
+ const upgradeStatus = await getESUpgradeStatus(esClient, {
+ ...featureSet,
+ });
+
+ expect([
+ ...upgradeStatus.migrationsDeprecations,
+ ...upgradeStatus.enrichedHealthIndicators,
+ ]).toHaveLength(1);
+ expect(upgradeStatus.totalCriticalDeprecations).toBe(1);
+ });
+
it('returns health indicators', async () => {
esClient.asCurrentUser.migration.deprecations.mockResponse({
cluster_settings: [],
diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts
index 707c5ca00ba3a..35647c9df64c4 100644
--- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts
+++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts
@@ -127,13 +127,13 @@ export const getEnrichedDeprecations = async (
const systemIndicesList = convertFeaturesToIndicesArray(systemIndices.features);
- const indexSettingsIndexNames = Object.keys(deprecations.index_settings).map(
- (indexName) => indexName!
- );
+ const indexSettingsIndexNames = Object.keys(deprecations.index_settings);
const indexSettingsIndexStates = indexSettingsIndexNames.length
? await esIndicesStateCheck(dataClient.asCurrentUser, indexSettingsIndexNames)
: {};
+ const deprecationsByIndex = new Map();
+
return normalizeEsResponse(deprecations)
.filter((deprecation) => {
switch (deprecation.type) {
@@ -173,10 +173,39 @@ export const getEnrichedDeprecations = async (
indexSettingsIndexStates[deprecation.index!] === 'closed' ? 'index-closed' : undefined;
}
- const enrichedDeprecation = _.omit(deprecation, 'metadata');
- return {
- ...enrichedDeprecation,
+ const enrichedDeprecation = {
+ ..._.omit(deprecation, 'metadata'),
correctiveAction,
};
+
+ if (deprecation.index) {
+ const indexDeprecations = deprecationsByIndex.get(deprecation.index) || [];
+ indexDeprecations.push(enrichedDeprecation);
+ deprecationsByIndex.set(deprecation.index, indexDeprecations);
+ }
+
+ return enrichedDeprecation;
+ })
+ .filter((deprecation) => {
+ if (
+ deprecation.index &&
+ deprecation.message.includes(`Index [${deprecation.index}] is a frozen index`)
+ ) {
+ // frozen indices are created in 7.x, so they are old / incompatible as well
+ // reindexing + deleting is required, so no need to bubble up this deprecation in the UI
+ const indexDeprecations = deprecationsByIndex.get(deprecation.index)!;
+ const oldIndexDeprecation: EnrichedDeprecationInfo | undefined = indexDeprecations.find(
+ (elem) =>
+ elem.type === 'index_settings' &&
+ elem.index === deprecation.index &&
+ elem.correctiveAction?.type === 'reindex'
+ );
+ if (oldIndexDeprecation) {
+ oldIndexDeprecation.frozen = true;
+ return false;
+ }
+ }
+
+ return true;
});
};
diff --git a/x-pack/platform/plugins/shared/automatic_import/common/constants.ts b/x-pack/platform/plugins/shared/automatic_import/common/constants.ts
index 109de8faf9e1a..15fb68b7d01f4 100644
--- a/x-pack/platform/plugins/shared/automatic_import/common/constants.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/common/constants.ts
@@ -37,6 +37,7 @@ export enum GenerationErrorCode {
UNSUPPORTED_LOG_SAMPLES_FORMAT = 'unsupported-log-samples-format',
UNPARSEABLE_CSV_DATA = 'unparseable-csv-data',
CEF_ERROR = 'cef-not-supported',
+ BUILD_INTEGRATION_ERROR = 'build-integration-error',
}
// Size limits
diff --git a/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx
index a7dd8eae0fdab..18b670b8d7b93 100644
--- a/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx
+++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx
@@ -8,7 +8,7 @@
import React from 'react';
import { render, act, type RenderResult, fireEvent } from '@testing-library/react';
import { TestProvider } from '../../../../../mocks/test_provider';
-import { DataStreamStep } from './data_stream_step';
+import { DataStreamStep, getNameFromTitle } from './data_stream_step';
import { ActionsProvider } from '../../state';
import { mockActions, mockState } from '../../mocks/state';
@@ -284,4 +284,57 @@ describe('DataStreamStep', () => {
expect(result.queryByTestId('generationModal')).toBeInTheDocument();
});
});
+
+ describe('when integrationSettings has an invalid generated name from title', () => {
+ describe.each(['123 abc', '1a'])('should render error for %s', (invalidTitle) => {
+ let result: RenderResult;
+ beforeEach(() => {
+ jest.clearAllMocks();
+ result = render(
+ ,
+ { wrapper }
+ );
+ });
+
+ it('should set empty name for invalid title', () => {
+ const input = result.getByTestId('nameInput');
+ expect(input).toHaveValue(''); // name is not set
+ });
+ });
+ });
+
+ describe('when integrationSettings has an valid generated name from title', () => {
+ describe.each(['abc 123', '$abc123', 'abc 123 abc', 'abc_123', 'abc_123_abc'])(
+ 'should render error for %s',
+ (validTitle) => {
+ let result: RenderResult;
+ beforeEach(() => {
+ jest.clearAllMocks();
+ result = render(
+ ,
+ { wrapper }
+ );
+ });
+
+ it('should auto-generate name from title', () => {
+ const input = result.getByTestId('nameInput');
+ expect(input).toHaveValue(getNameFromTitle(validTitle));
+ expect(mockActions.setIntegrationSettings).toHaveBeenCalledWith({
+ name: getNameFromTitle(validTitle),
+ title: validTitle,
+ });
+ });
+ }
+ );
+ });
});
diff --git a/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx
index d929dae7812e3..4c9e9270b9c71 100644
--- a/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx
+++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx
@@ -55,7 +55,8 @@ export const InputTypeOptions: Array> = [
const isValidName = (name: string) => NAME_REGEX_PATTERN.test(name);
const isValidDatastreamName = (name: string) => DATASTREAM_NAME_REGEX_PATTERN.test(name);
-const getNameFromTitle = (title: string) => title.toLowerCase().replaceAll(/[^a-z0-9]/g, '_');
+export const getNameFromTitle = (title: string) =>
+ title.toLowerCase().replaceAll(/[^a-z0-9]/g, '_');
interface DataStreamStepProps {
integrationSettings: State['integrationSettings'];
@@ -132,7 +133,7 @@ export const DataStreamStep = React.memo(
// Only executed once when the packageNames are loaded
if (packageNames != null && integrationSettings?.name == null && integrationSettings?.title) {
const generatedName = getNameFromTitle(integrationSettings.title);
- if (!packageNames.has(generatedName)) {
+ if (!packageNames.has(generatedName) && isValidName(generatedName)) {
setName(generatedName);
setIntegrationValues({ name: generatedName });
}
@@ -195,7 +196,7 @@ export const DataStreamStep = React.memo(
{
if (
attributes.underlyingMessages !== undefined &&
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts
index 322d71ef4c792..23e6c1e6a8bbf 100644
--- a/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts
@@ -85,7 +85,7 @@ describe('EcsGraph', () => {
throw Error(`getEcsGraph threw an error: ${error}`);
}
- expect(response.results).toStrictEqual(ecsMappingExpectedResults);
+ expect(response.results).toEqual(ecsMappingExpectedResults);
// Check if the functions were called
expect(handleEcsMapping).toHaveBeenCalled();
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts
index 30ef7d997a6bc..8eaf00960a3c5 100644
--- a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts
@@ -20,6 +20,7 @@ import { createDataStream } from './data_stream';
import { createFieldMapping } from './fields';
import { createPipeline } from './pipeline';
import { createReadme } from './readme_files';
+import { BuildIntegrationError } from '../lib/errors/build_integration_error';
const initialVersion = '1.0.0';
@@ -37,46 +38,56 @@ export async function buildPackage(integration: Integration): Promise {
configureNunjucks();
if (!isValidName(integration.name)) {
- throw new Error(
+ throw new BuildIntegrationError(
`Invalid integration name: ${integration.name}, Should only contain letters, numbers and underscores`
);
}
-
const workingDir = joinPath(getDataPath(), `automatic-import-${generateUniqueId()}`);
- const packageDirectoryName = `${integration.name}-${initialVersion}`;
- const packageDir = createDirectories(workingDir, integration, packageDirectoryName);
- const dataStreamsDir = joinPath(packageDir, 'data_stream');
- const fieldsPerDatastream = integration.dataStreams.map((dataStream) => {
- const dataStreamName = dataStream.name;
- if (!isValidDatastreamName(dataStreamName)) {
- throw new Error(
- `Invalid datastream name: ${dataStreamName}, Name must be at least 2 characters long and can only contain lowercase letters, numbers, and underscores`
- );
- }
- const specificDataStreamDir = joinPath(dataStreamsDir, dataStreamName);
+ try {
+ const packageDirectoryName = `${integration.name}-${initialVersion}`;
+ const packageDir = createDirectories(workingDir, integration, packageDirectoryName);
- const dataStreamFields = createDataStream(integration.name, specificDataStreamDir, dataStream);
- createAgentInput(specificDataStreamDir, dataStream.inputTypes, dataStream.celInput);
- createPipeline(specificDataStreamDir, dataStream.pipeline);
- const fields = createFieldMapping(
- integration.name,
- dataStreamName,
- specificDataStreamDir,
- dataStream.docs
- );
+ const dataStreamsDir = joinPath(packageDir, 'data_stream');
+ const fieldsPerDatastream = integration.dataStreams.map((dataStream) => {
+ const dataStreamName = dataStream.name;
+ if (!isValidDatastreamName(dataStreamName)) {
+ throw new Error(
+ `Invalid datastream name: ${dataStreamName}, Name must be at least 2 characters long and can only contain lowercase letters, numbers, and underscores`
+ );
+ }
+ const specificDataStreamDir = joinPath(dataStreamsDir, dataStreamName);
- return {
- datastream: dataStreamName,
- fields: mergeAndSortFields(fields, dataStreamFields),
- };
- });
+ const dataStreamFields = createDataStream(
+ integration.name,
+ specificDataStreamDir,
+ dataStream
+ );
+ createAgentInput(specificDataStreamDir, dataStream.inputTypes, dataStream.celInput);
+ createPipeline(specificDataStreamDir, dataStream.pipeline);
+ const fields = createFieldMapping(
+ integration.name,
+ dataStreamName,
+ specificDataStreamDir,
+ dataStream.docs
+ );
- createReadme(packageDir, integration.name, integration.dataStreams, fieldsPerDatastream);
- const zipBuffer = await createZipArchive(integration, workingDir, packageDirectoryName);
+ return {
+ datastream: dataStreamName,
+ fields: mergeAndSortFields(fields, dataStreamFields),
+ };
+ });
- removeDirSync(workingDir);
- return zipBuffer;
+ createReadme(packageDir, integration.name, integration.dataStreams, fieldsPerDatastream);
+ const zipBuffer = await createZipArchive(integration, workingDir, packageDirectoryName);
+
+ removeDirSync(workingDir);
+ return zipBuffer;
+ } catch (error) {
+ throw new BuildIntegrationError('Building the Integration failed');
+ } finally {
+ removeDirSync(workingDir);
+ }
}
export function isValidName(input: string): boolean {
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts
index 01e8b0d384dfe..dd6bc0c19ff5c 100644
--- a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts
@@ -89,17 +89,6 @@ describe('createDataStream', () => {
// dataStream files
expect(copySync).toHaveBeenCalledWith(expect.any(String), `${dataStreamPath}/fields`);
- // test files
- expect(ensureDirSync).toHaveBeenCalledWith(`${dataStreamPath}/_dev/test/pipeline`);
- expect(copySync).toHaveBeenCalledWith(
- expect.any(String),
- `${dataStreamPath}/_dev/test/pipeline/test-common-config.yml`
- );
- expect(createSync).toHaveBeenCalledWith(
- `${dataStreamPath}/_dev/test/pipeline/test-${packageName}-datastream-1.log`,
- samples
- );
-
// // Manifest files
expect(createSync).toHaveBeenCalledWith(`${dataStreamPath}/manifest.yml`, undefined);
expect(render).toHaveBeenCalledWith(`filestream_manifest.yml.njk`, expect.anything());
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts
index c6fa4e07a6dba..c44d8c9424636 100644
--- a/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts
@@ -27,8 +27,6 @@ export function createDataStream(
ensureDirSync(specificDataStreamDir);
const fields = createDataStreamFolders(specificDataStreamDir, pipelineDir);
- createPipelineTests(specificDataStreamDir, dataStream.rawSamples, packageName, dataStreamName);
-
const dataStreams: string[] = [];
for (const inputType of dataStream.inputTypes) {
let mappedValues = {
@@ -89,30 +87,6 @@ function loadFieldsFromFiles(sourcePath: string, files: string[]): Field[] {
});
}
-function createPipelineTests(
- specificDataStreamDir: string,
- rawSamples: string[],
- packageName: string,
- dataStreamName: string
-): void {
- const pipelineTestTemplatesDir = joinPath(__dirname, '../templates/pipeline_tests');
- const pipelineTestsDir = joinPath(specificDataStreamDir, '_dev/test/pipeline');
- ensureDirSync(pipelineTestsDir);
- const items = listDirSync(pipelineTestTemplatesDir);
- for (const item of items) {
- const s = joinPath(pipelineTestTemplatesDir, item);
- const d = joinPath(pipelineTestsDir, item.replaceAll('_', '-'));
- copySync(s, d);
- }
- const formattedPackageName = packageName.replace(/_/g, '-');
- const formattedDataStreamName = dataStreamName.replace(/_/g, '-');
- const testFileName = joinPath(
- pipelineTestsDir,
- `test-${formattedPackageName}-${formattedDataStreamName}.log`
- );
- createSync(testFileName, rawSamples.join('\n'));
-}
-
function prepareCelValues(mappedValues: object, celInput: CelInput | undefined) {
if (celInput != null) {
// Ready the program for printing with correct indentation
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/build_integration_error.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/build_integration_error.ts
new file mode 100644
index 0000000000000..6c04f974817bc
--- /dev/null
+++ b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/build_integration_error.ts
@@ -0,0 +1,20 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { KibanaResponseFactory } from '@kbn/core/server';
+import { ErrorThatHandlesItsOwnResponse } from './types';
+import { GenerationErrorCode } from '../../../common/constants';
+
+export class BuildIntegrationError extends Error implements ErrorThatHandlesItsOwnResponse {
+ private readonly errorCode: GenerationErrorCode = GenerationErrorCode.BUILD_INTEGRATION_ERROR;
+
+ public sendResponse(res: KibanaResponseFactory) {
+ return res.badRequest({
+ body: { message: this.message, attributes: { errorCode: this.errorCode } },
+ });
+ }
+}
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline_tests/test_common_config.yml b/x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline_tests/test_common_config.yml
deleted file mode 100644
index 772cb40587804..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline_tests/test_common_config.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-fields:
- tags:
- - preserve_original_event
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/docker_compose.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/docker_compose.yml.njk
deleted file mode 100644
index 74ebed9dd0a75..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/docker_compose.yml.njk
+++ /dev/null
@@ -1,3 +0,0 @@
-version: "{{ docker_compose_version }}"
-services: {% for service in services %}
- {{ service }}{% endfor %}
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_filestream.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_filestream.njk
deleted file mode 100644
index 642897a0fbfea..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_filestream.njk
+++ /dev/null
@@ -1,6 +0,0 @@
-{{package_name}}-{{data_stream_name}}-filestream:
- image: alpine
- volumes:
- - ./sample_logs:/sample_logs:ro
- - ${SERVICE_LOGS_DIR}:/var/log
- command: /bin/sh -c "cp /sample_logs/* /var/log/"
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_gcs.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_gcs.njk
deleted file mode 100644
index 3a1010d0b0bfb..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_gcs.njk
+++ /dev/null
@@ -1,7 +0,0 @@
-{{package_name}}-{{data_stream_name}}-gcs:
- image: fsouza/fake-gcs-server:latest
- command: -host=0.0.0.0 -public-host=elastic-package-service_{{package_name}}-{{data_stream_name}}-gcs_1 -port=4443 -scheme=http
- volumes:
- - ./sample_logs:/data
- ports:
- - 4443/tcp
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_logfile.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_logfile.njk
deleted file mode 100644
index 1393ef7cc1098..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_logfile.njk
+++ /dev/null
@@ -1,6 +0,0 @@
-{{package_name}}-{{data_stream_name}}-logfile:
- image: alpine
- volumes:
- - ./sample_logs:/sample_logs:ro
- - ${SERVICE_LOGS_DIR}:/var/log
- command: /bin/sh -c "cp /sample_logs/* /var/log/"
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_tcp.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_tcp.njk
deleted file mode 100644
index 0267c60d00d4d..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_tcp.njk
+++ /dev/null
@@ -1,6 +0,0 @@
-{{package_name}}-{{data_stream_name}}-tcp:
- image: docker.elastic.co/observability/stream:{{stream_version}}
- volumes:
- - ./sample_logs:/sample_logs:ro
- entrypoint: /bin/bash
- command: -c "/stream log --start-signal=SIGHUP --delay=5s --addr elastic-agent:9025 -p=tcp /sample_logs/{{package_name}}.log"
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_udp.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_udp.njk
deleted file mode 100644
index bdb8b5b91b8ff..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_udp.njk
+++ /dev/null
@@ -1,6 +0,0 @@
-{{package_name}}-{{data_stream_name}}-udp:
- image: docker.elastic.co/observability/stream:{{stream_version}}
- volumes:
- - ./sample_logs:/sample_logs:ro
- entrypoint: /bin/bash
- command: -c "/stream log --start-signal=SIGHUP --delay=5s --addr elastic-agent:9025 -p=udp /sample_logs/{{package_name}}.log"
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_filestream_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_filestream_config.yml.njk
deleted file mode 100644
index 3a861dfe3b7d1..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_filestream_config.yml.njk
+++ /dev/null
@@ -1,13 +0,0 @@
-service: {{package_name}}-{{data_stream_name}}-filestream
-input: filestream
-data_stream:
- vars:
- preserve_original_event: true
- paths:
- - '{% raw %}{{SERVICE_LOGS_DIR}}{% endraw %}/test-{{package_name}}-{{data_stream_name}}.log'
-numeric_keyword_fields:
- - log.file.device_id
- - log.file.inode
- - log.file.idxhi
- - log.file.idxlo
- - log.file.vol
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_gcs_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_gcs_config.yml.njk
deleted file mode 100644
index 3bdf39c42fac7..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_gcs_config.yml.njk
+++ /dev/null
@@ -1,10 +0,0 @@
-service: {{package_name}}-{{data_stream_name}}-gcs
-input: gcs
-data_stream:
- vars:
- project_id: testproject
- alternative_host: "http://{% raw %}{{Hostname}}:{{Port}}{% endraw %}"
- buckets: |
- - name: testbucket
- poll: true
- poll_interval: 15s
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_logfile_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_logfile_config.yml.njk
deleted file mode 100644
index d6d891cd7038b..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_logfile_config.yml.njk
+++ /dev/null
@@ -1,13 +0,0 @@
-service: {{package_name}}-{{data_stream_name}}-logfile
-input: logfile
-data_stream:
- vars:
- preserve_original_event: true
- paths:
- - '{% raw %}{{SERVICE_LOGS_DIR}}{% endraw %}/{{package_name}}-{{data_stream_name}}.log'
-numeric_keyword_fields:
- - log.file.device_id
- - log.file.inode
- - log.file.idxhi
- - log.file.idxlo
- - log.file.vol
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_tcp_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_tcp_config.yml.njk
deleted file mode 100644
index 1c5377a87e213..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_tcp_config.yml.njk
+++ /dev/null
@@ -1,7 +0,0 @@
-service: {{package_name}}-{{data_stream_name}}-tcp
-input: tcp
-data_stream:
- vars:
- preserve_original_event: true
- listen_address: 0.0.0.0
- listen_port: 9025
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_udp_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_udp_config.yml.njk
deleted file mode 100644
index 634f151b97198..0000000000000
--- a/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_udp_config.yml.njk
+++ /dev/null
@@ -1,7 +0,0 @@
-service: {{package_name}}-{{data_stream_name}}-udp
-input: udp
-data_stream:
- vars:
- preserve_original_event: true
- listen_address: 0.0.0.0
- listen_port: 9025
diff --git a/x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts
index 9f14f20816415..9eb051855ec0d 100644
--- a/x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts
+++ b/x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts
@@ -153,20 +153,46 @@ export function generateFields(mergedDocs: string): string {
return dump(fieldsStructure, { sortKeys: false });
}
+export function isObject(value: any): boolean {
+ return typeof value === 'object' && value !== null;
+}
+
+export function isEmptyValue(value: unknown): boolean {
+ if (value == null) return true;
+ if (isObject(value)) {
+ if (Array.isArray(value)) return value.length === 0;
+ return value && Object.keys(value).length === 0;
+ }
+ return false;
+}
+
+export function isUnsafeProperty(key: string, obj: Record): boolean {
+ return (
+ key === '__proto__' || key === 'constructor' || key === 'prototype' || !Object.hasOwn(obj, key)
+ );
+}
+
export function merge(
target: Record,
source: Record
): Record {
- const filteredTarget = filterOwnProperties(target);
+ const filteredTarget = Object.create(null);
+
+ for (const [key, targetValue] of Object.entries(target)) {
+ if (!isUnsafeProperty(key, target)) {
+ filteredTarget[key] = targetValue;
+ }
+ }
+
for (const [key, sourceValue] of Object.entries(source)) {
- if (!isBuiltInProperties(key, source)) {
+ if (!isUnsafeProperty(key, source)) {
const targetValue = filteredTarget[key];
+
if (Array.isArray(sourceValue)) {
- // Directly assign arrays
- filteredTarget[key] = sourceValue;
- } else if (isObject(sourceValue) && !Array.isArray(targetValue)) {
+ filteredTarget[key] = [...sourceValue];
+ } else if (isObject(sourceValue) && !Array.isArray(sourceValue)) {
if (!isObject(targetValue) || isEmptyValue(targetValue)) {
- filteredTarget[key] = merge({}, sourceValue);
+ filteredTarget[key] = merge(Object.create(null), sourceValue);
} else {
filteredTarget[key] = merge(targetValue, sourceValue);
}
@@ -178,36 +204,8 @@ export function merge(
}
}
}
- return filteredTarget;
-}
-
-function isEmptyValue(value: unknown): boolean {
- if (value == null) return true;
- if (isObject(value)) {
- if (Array.isArray(value)) return value.length === 0;
- return value && Object.keys(value).length === 0;
- }
- return false;
-}
-function isObject(value: any): boolean {
- return typeof value === 'object' && value !== null;
-}
-
-function isBuiltInProperties(key: string, obj: Record): boolean {
- return key === 'constructor' || !Object.prototype.hasOwnProperty.call(obj, key);
-}
-
-function filterOwnProperties(obj: Record): Record {
- const ownProps: Record = {};
-
- for (const key of Object.getOwnPropertyNames(obj)) {
- if (!isBuiltInProperties(key, obj)) {
- ownProps[key] = (obj as any)[key];
- }
- }
-
- return ownProps;
+ return filteredTarget;
}
export function mergeSamples(objects: any[]): string {
diff --git a/x-pack/platform/plugins/shared/cloud/common/types.ts b/x-pack/platform/plugins/shared/cloud/common/types.ts
index b3a32270af6cc..ffbf553ea33a0 100644
--- a/x-pack/platform/plugins/shared/cloud/common/types.ts
+++ b/x-pack/platform/plugins/shared/cloud/common/types.ts
@@ -8,3 +8,20 @@
export interface ElasticsearchConfigType {
elasticsearch_url?: string;
}
+
+export type SolutionType = 'search' | 'elasticsearch' | 'observability' | 'security';
+export interface CloudDataAttributes {
+ onboardingData: {
+ solutionType?: SolutionType;
+ token: string;
+ security?: CloudSecurityAnswer;
+ };
+}
+
+export interface CloudSecurityAnswer {
+ useCase: 'siem' | 'cloud' | 'edr' | 'other';
+ migration?: {
+ value: boolean;
+ type?: 'splunk' | 'other';
+ };
+}
diff --git a/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.ts b/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.ts
index 7a758f417f16c..cd1fe9d99f2d0 100644
--- a/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.ts
+++ b/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.ts
@@ -8,7 +8,7 @@
import { isDeepEqual } from 'react-use/lib/util';
import { Logger, SavedObjectsClientContract, SavedObjectsErrorHelpers } from '@kbn/core/server';
-import { CloudDataAttributes, CloudSecurityAnswer, SolutionType } from '../routes/types';
+import { CloudDataAttributes, CloudSecurityAnswer, SolutionType } from '../../common/types';
import { CLOUD_DATA_SAVED_OBJECT_TYPE } from '../saved_objects';
import { CLOUD_DATA_SAVED_OBJECT_ID } from '../routes/constants';
diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.ts b/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.ts
index c905e4b641c0c..2d9864cca843d 100644
--- a/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.ts
+++ b/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.ts
@@ -8,7 +8,7 @@
import { RouteOptions } from '.';
import { CLOUD_DATA_SAVED_OBJECT_ID } from './constants';
import { CLOUD_DATA_SAVED_OBJECT_TYPE } from '../saved_objects';
-import { CloudDataAttributes } from './types';
+import { CloudDataAttributes } from '../../common/types';
export const setGetCloudSolutionDataRoute = ({ router }: RouteOptions) => {
router.versioned
diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/types.ts b/x-pack/platform/plugins/shared/cloud/server/routes/types.ts
index 0b4cf36caf1e4..0b42629d5ad78 100644
--- a/x-pack/platform/plugins/shared/cloud/server/routes/types.ts
+++ b/x-pack/platform/plugins/shared/cloud/server/routes/types.ts
@@ -11,19 +11,3 @@ import { CustomRequestHandlerContext } from '@kbn/core/server';
* @internal
*/
export type CloudRequestHandlerContext = CustomRequestHandlerContext<{}>;
-export type SolutionType = 'search' | 'elasticsearch' | 'observability' | 'security';
-export interface CloudDataAttributes {
- onboardingData: {
- solutionType?: SolutionType;
- token: string;
- security?: CloudSecurityAnswer;
- };
-}
-
-export interface CloudSecurityAnswer {
- useCase: 'siem' | 'cloud' | 'edr' | 'other';
- migration?: {
- value: boolean;
- type?: 'splunk' | 'other';
- };
-}
diff --git a/x-pack/platform/plugins/shared/fleet/package.json b/x-pack/platform/plugins/shared/fleet/package.json
index bf91a6f0443c2..0efa137a0ac88 100644
--- a/x-pack/platform/plugins/shared/fleet/package.json
+++ b/x-pack/platform/plugins/shared/fleet/package.json
@@ -5,11 +5,11 @@
"private": true,
"license": "Elastic License 2.0",
"scripts": {
- "cypress_space_awareness": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../../x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/fleet/cypress.config.space_awareness.ts --ftr-config-file ../../../../../x-pack/test/fleet_cypress/cli_config.space_awareness",
+ "cypress_space_awareness": "node ../../../../../x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/fleet/cypress.config.space_awareness.ts --ftr-config-file ../../../../../x-pack/test/fleet_cypress/cli_config.space_awareness",
"cypress_space_awareness:open": "yarn cypress_space_awareness open",
"cypress_space_awareness:run": "yarn cypress_space_awareness run",
"cypress_space_awareness:run:reporter": "yarn cypress_space_awareness run --reporter ../../../../../node_modules/cypress-multi-reporters --reporter-options configFile=cypress/reporter_config.json",
- "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../../x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/fleet/cypress.config.ts --ftr-config-file ../../../../../x-pack/test/fleet_cypress/cli_config",
+ "cypress": "node ../../../../../x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/fleet/cypress.config.ts --ftr-config-file ../../../../../x-pack/test/fleet_cypress/cli_config",
"cypress:open": "yarn cypress open",
"cypress:run": "yarn cypress run",
"cypress:run:reporter": "yarn cypress run --reporter ../../../../../node_modules/cypress-multi-reporters --reporter-options configFile=cypress/reporter_config.json",
diff --git a/x-pack/platform/plugins/shared/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx b/x-pack/platform/plugins/shared/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx
index 93ca4b03af458..94783aaa77f49 100644
--- a/x-pack/platform/plugins/shared/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx
+++ b/x-pack/platform/plugins/shared/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx
@@ -88,12 +88,12 @@ export const NextSteps = ({
});
const connectorCards = packagePolicy.inputs
- .filter((input) => !!input?.vars?.connector_id.value || !!input?.vars?.connector_name.value)
+ .filter((input) => !!input?.vars?.connector_id?.value || !!input?.vars?.connector_name?.value)
.map((input, index) => {
return (
{
application.navigateToApp(ELASTICSEARCH_PLUGIN_ID, {
- path: input?.vars?.connector_id.value
- ? `content/connectors/${input?.vars?.connector_id.value}`
+ path: input?.vars?.connector_id?.value
+ ? `content/connectors/${input?.vars?.connector_id?.value}`
: `content/connectors`,
});
}}
diff --git a/x-pack/platform/plugins/shared/fleet/server/services/epm/elasticsearch/transform/reauthorize.ts b/x-pack/platform/plugins/shared/fleet/server/services/epm/elasticsearch/transform/reauthorize.ts
index 03975fbb13aa4..9a15763b3ddd9 100644
--- a/x-pack/platform/plugins/shared/fleet/server/services/epm/elasticsearch/transform/reauthorize.ts
+++ b/x-pack/platform/plugins/shared/fleet/server/services/epm/elasticsearch/transform/reauthorize.ts
@@ -10,17 +10,16 @@ import type { Logger } from '@kbn/logging';
import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server';
import { sortBy, uniqBy } from 'lodash';
-import pMap from 'p-map';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import type { ErrorResponseBase } from '@elastic/elasticsearch/lib/api/types';
+import pMap from 'p-map';
+import { MAX_CONCURRENT_TRANSFORMS_OPERATIONS } from '../../../../constants';
import type { SecondaryAuthorizationHeader } from '../../../../../common/types/models/transform_api_key';
import { updateEsAssetReferences } from '../../packages/es_assets_reference';
import type { Installation } from '../../../../../common';
import { ElasticsearchAssetType, PACKAGES_SAVED_OBJECT_TYPE } from '../../../../../common';
-
import { retryTransientEsErrors } from '../retry';
-import { MAX_CONCURRENT_TRANSFORMS_OPERATIONS } from '../../../../constants';
interface FleetTransformMetadata {
fleet_transform_version?: string;
@@ -32,6 +31,7 @@ interface FleetTransformMetadata {
last_authorized_by?: string;
run_as_kibana_system?: boolean;
transformId: string;
+ unattended?: boolean;
}
const isErrorResponse = (arg: unknown): arg is ErrorResponseBase =>
@@ -43,6 +43,7 @@ async function reauthorizeAndStartTransform({
transformId,
secondaryAuth,
meta,
+ shouldStopBeforeStart,
}: {
esClient: ElasticsearchClient;
logger: Logger;
@@ -50,6 +51,7 @@ async function reauthorizeAndStartTransform({
secondaryAuth?: SecondaryAuthorizationHeader;
shouldInstallSequentially?: boolean;
meta?: object;
+ shouldStopBeforeStart?: boolean;
}): Promise<{ transformId: string; success: boolean; error: null | any }> {
try {
await retryTransientEsErrors(
@@ -71,6 +73,18 @@ async function reauthorizeAndStartTransform({
}
try {
+ // For unattended transforms, we need to stop the transform before starting it
+ // otherwise, starting transform will fail with a 409 error
+ if (shouldStopBeforeStart) {
+ await retryTransientEsErrors(
+ () =>
+ esClient.transform.stopTransform(
+ { transform_id: transformId, wait_for_completion: true },
+ { ignore: [404, 409] }
+ ),
+ { logger, additionalResponseStatuses: [400] }
+ );
+ }
const startedTransform = await retryTransientEsErrors(
() => esClient.transform.startTransform({ transform_id: transformId }, { ignore: [409] }),
{ logger, additionalResponseStatuses: [400] }
@@ -121,30 +135,23 @@ export async function handleTransformReauthorizeAndStart({
);
}
- const transformInfos = await pMap(
- transforms,
- ({ transformId }) =>
- retryTransientEsErrors(
- () =>
- esClient.transform.getTransform(
- {
- transform_id: transformId,
- },
- { ...(secondaryAuth ? secondaryAuth : {}), ignore: [404] }
- ),
- { logger, additionalResponseStatuses: [400] }
+ const transformInfos = await retryTransientEsErrors(
+ () =>
+ esClient.transform.getTransform(
+ {
+ transform_id: transforms.map((t) => t.transformId).join(','),
+ },
+ { ...(secondaryAuth ? secondaryAuth : {}), ignore: [404] }
),
- {
- concurrency: MAX_CONCURRENT_TRANSFORMS_OPERATIONS,
- }
+ { logger, additionalResponseStatuses: [400] }
);
-
- const transformsMetadata: FleetTransformMetadata[] = transformInfos
- .flat()
- .filter((t) => t.transforms !== undefined)
- .map((t) => {
- const transform = t.transforms?.[0];
- return { ...transform._meta, transformId: transform?.id };
+ const transformsMetadata: FleetTransformMetadata[] = transformInfos.transforms
+ .map((transform) => {
+ return {
+ ...transform._meta,
+ transformId: transform?.id,
+ unattended: Boolean(transform.settings?.unattended),
+ };
})
.filter((t) => t?.run_as_kibana_system === false);
@@ -160,13 +167,14 @@ export async function handleTransformReauthorizeAndStart({
(t) => t.order,
]);
- for (const { transformId, ...meta } of sortedTransformsMetadata) {
+ for (const { transformId, unattended, ...meta } of sortedTransformsMetadata) {
const authorizedTransform = await reauthorizeAndStartTransform({
esClient,
logger,
transformId,
secondaryAuth,
meta: { ...meta, last_authorized_by: username },
+ shouldStopBeforeStart: unattended,
});
authorizedTransforms.push(authorizedTransform);
@@ -175,13 +183,14 @@ export async function handleTransformReauthorizeAndStart({
// Else, create & start all the transforms at once for speed
authorizedTransforms = await pMap(
transformsMetadata,
- async ({ transformId, ...meta }) =>
+ async ({ transformId, unattended, ...meta }) =>
reauthorizeAndStartTransform({
esClient,
logger,
transformId,
secondaryAuth,
meta: { ...meta, last_authorized_by: username },
+ shouldStopBeforeStart: unattended,
}),
{
concurrency: MAX_CONCURRENT_TRANSFORMS_OPERATIONS,
diff --git a/x-pack/platform/plugins/shared/fleet/server/services/epm/filtered_packages.ts b/x-pack/platform/plugins/shared/fleet/server/services/epm/filtered_packages.ts
index 4f18f6fbfddb8..b2f02a20f6496 100644
--- a/x-pack/platform/plugins/shared/fleet/server/services/epm/filtered_packages.ts
+++ b/x-pack/platform/plugins/shared/fleet/server/services/epm/filtered_packages.ts
@@ -10,7 +10,7 @@ import { FLEET_SERVER_PACKAGE } from '../../../common/constants';
export function getFilteredSearchPackages() {
const shouldFilterFleetServer = appContextService.getConfig()?.internal?.fleetServerStandalone;
- const filtered: string[] = ['profiler_collector', 'profiler_symbolizer'];
+ const filtered: string[] = ['profiler_collector', 'profiler_symbolizer', 'elastic_connectors'];
// Do not allow to search for Fleet server integration if configured to use standalone fleet server
if (shouldFilterFleetServer) {
filtered.push(FLEET_SERVER_PACKAGE);
@@ -22,7 +22,7 @@ export function getFilteredSearchPackages() {
}
export function getFilteredInstallPackages() {
- const filtered: string[] = [];
+ const filtered: string[] = ['elastic_connectors'];
const excludePackages = appContextService.getConfig()?.internal?.registry?.excludePackages ?? [];
diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx
index f021055dd2934..566663a65bb76 100644
--- a/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx
+++ b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx
@@ -8,7 +8,7 @@
import { EuiPageTemplate } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
-import { css } from '@emotion/react/dist/emotion-react.cjs';
+import { css } from '@emotion/react';
export const EmptyList = ({ addDatabaseButton }: { addDatabaseButton: JSX.Element }) => {
return (
diff --git a/x-pack/platform/plugins/shared/lens/public/shared_components/dataview_picker/trigger.test.tsx b/x-pack/platform/plugins/shared/lens/public/shared_components/dataview_picker/trigger.test.tsx
index fcc7ccf2bba1d..7ce360628b853 100644
--- a/x-pack/platform/plugins/shared/lens/public/shared_components/dataview_picker/trigger.test.tsx
+++ b/x-pack/platform/plugins/shared/lens/public/shared_components/dataview_picker/trigger.test.tsx
@@ -56,8 +56,8 @@ describe('TriggerButton', () => {
isMissingCurrent
/>
);
- // EUI danger red: rgb(171, 35, 28)
- expect(screen.getByTestId('test-id')).toHaveStyle({ color: 'rgb(171, 35, 28)' });
+ // EUI danger red: rgb(167, 22, 39)
+ expect(screen.getByTestId('test-id')).toHaveStyle({ color: 'rgb(167, 22, 39)' });
});
});
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/layers/vector_layer/mvt_vector_layer/__snapshots__/mvt_vector_layer.test.tsx.snap b/x-pack/platform/plugins/shared/maps/public/classes/layers/vector_layer/mvt_vector_layer/__snapshots__/mvt_vector_layer.test.tsx.snap
index faae8892a2a85..033db51142764 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/layers/vector_layer/mvt_vector_layer/__snapshots__/mvt_vector_layer.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/maps/public/classes/layers/vector_layer/mvt_vector_layer/__snapshots__/mvt_vector_layer.test.tsx.snap
@@ -4,8 +4,8 @@ exports[`getLayerIcon Layers with non-elasticsearch sources should display icon
{
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
@@ -155,7 +155,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#D36086',
+ color: '#61A2FF',
},
type: 'STATIC',
},
@@ -231,7 +231,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
lineColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
@@ -308,7 +308,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
@@ -387,7 +387,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#D36086',
+ color: '#61A2FF',
},
type: 'STATIC',
},
@@ -457,7 +457,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
lineColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
@@ -536,7 +536,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
@@ -615,7 +615,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
fillColor: {
options: {
- color: '#D36086',
+ color: '#61A2FF',
},
type: 'STATIC',
},
@@ -685,7 +685,7 @@ describe('createLayerDescriptor', () => {
...getDefaultStaticProperties(),
lineColor: {
options: {
- color: '#6092C0',
+ color: '#A6EDEA',
},
type: 'STATIC',
},
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/color_palettes.test.ts b/x-pack/platform/plugins/shared/maps/public/classes/styles/color_palettes.test.ts
index d5a6ea694b3e0..707c33ce3994e 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/color_palettes.test.ts
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/color_palettes.test.ts
@@ -15,21 +15,21 @@ import {
describe('getColorPalette', () => {
test('Should create RGB color ramp', () => {
expect(getColorPalette('Blues')).toEqual([
- '#ecf1f7',
- '#d9e3ef',
- '#c5d5e7',
- '#b2c7df',
- '#9eb9d8',
- '#8bacd0',
- '#769fc8',
- '#6092c0',
+ '#e4eefd',
+ '#d3e3fe',
+ '#c1d8fe',
+ '#afceff',
+ '#9dc3ff',
+ '#8bb8ff',
+ '#77adff',
+ '#61a2ff',
]);
});
});
describe('getColorRampCenterColor', () => {
test('Should get center color from color ramp', () => {
- expect(getColorRampCenterColor('Blues')).toBe('#9eb9d8');
+ expect(getColorRampCenterColor('Blues')).toBe('#9dc3ff');
});
});
@@ -37,47 +37,47 @@ describe('getOrdinalMbColorRampStops', () => {
test('Should create color stops', () => {
expect(getOrdinalMbColorRampStops('Blues', 0, 1000, false)).toEqual([
0,
- '#ecf1f7',
+ '#e4eefd',
125,
- '#d9e3ef',
+ '#d3e3fe',
250,
- '#c5d5e7',
+ '#c1d8fe',
375,
- '#b2c7df',
+ '#afceff',
500,
- '#9eb9d8',
+ '#9dc3ff',
625,
- '#8bacd0',
+ '#8bb8ff',
750,
- '#769fc8',
+ '#77adff',
875,
- '#6092c0',
+ '#61a2ff',
]);
});
test('Should create inverted color stops', () => {
expect(getOrdinalMbColorRampStops('Blues', 0, 1000, true)).toEqual([
0,
- '#6092c0',
+ '#61a2ff',
125,
- '#769fc8',
+ '#77adff',
250,
- '#8bacd0',
+ '#8bb8ff',
375,
- '#9eb9d8',
+ '#9dc3ff',
500,
- '#b2c7df',
+ '#afceff',
625,
- '#c5d5e7',
+ '#c1d8fe',
750,
- '#d9e3ef',
+ '#d3e3fe',
875,
- '#ecf1f7',
+ '#e4eefd',
]);
});
- test('Should snap to end of color stops for identical range', () => {
- expect(getOrdinalMbColorRampStops('Blues', 23, 23, false)).toEqual([23, '#6092c0']);
+ test('xShould snap to end of color stops for identical range', () => {
+ expect(getOrdinalMbColorRampStops('Blues', 23, 23, false)).toEqual([23, '#61a2ff']);
});
});
@@ -92,15 +92,15 @@ describe('getPercentilesMbColorRampStops', () => {
];
expect(getPercentilesMbColorRampStops('Blues', percentiles, false)).toEqual([
5567.83,
- '#e0e8f2',
+ '#dae8fd',
8069,
- '#c2d2e6',
+ '#bed6fe',
9581.13,
- '#a2bcd9',
+ '#a1c5ff',
11145.5,
- '#82a7cd',
+ '#83b3ff',
16958.18,
- '#6092c0',
+ '#61a2ff',
]);
});
@@ -114,15 +114,15 @@ describe('getPercentilesMbColorRampStops', () => {
];
expect(getPercentilesMbColorRampStops('Blues', percentiles, true)).toEqual([
5567.83,
- '#6092c0',
+ '#61a2ff',
8069,
- '#82a7cd',
+ '#83b3ff',
9581.13,
- '#a2bcd9',
+ '#a1c5ff',
11145.5,
- '#c2d2e6',
+ '#bed6fe',
16958.18,
- '#e0e8f2',
+ '#dae8fd',
]);
});
});
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap b/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap
index 85de0cc0f7e30..cb3676cdeba48 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap
@@ -13,14 +13,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#ecf1f7",
- "#d9e3ef",
- "#c5d5e7",
- "#b2c7df",
- "#9eb9d8",
- "#8bacd0",
- "#769fc8",
- "#6092c0",
+ "#e4eefd",
+ "#d3e3fe",
+ "#c1d8fe",
+ "#afceff",
+ "#9dc3ff",
+ "#8bb8ff",
+ "#77adff",
+ "#61a2ff",
],
"title": "",
"type": "gradient",
@@ -29,14 +29,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#e6f1ee",
- "#cce4de",
- "#b3d6cd",
- "#9ac8bd",
- "#80bbae",
- "#65ad9e",
- "#47a08f",
- "#209280",
+ "#e1f3ee",
+ "#cbece1",
+ "#b5e6d3",
+ "#9fdfc6",
+ "#87d8b9",
+ "#6dd1ac",
+ "#50c99f",
+ "#24c292",
],
"title": "",
"type": "gradient",
@@ -45,14 +45,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#e0e4eb",
- "#c3c9d4",
- "#a8afbc",
- "#8e95a3",
- "#757c8a",
- "#5e6471",
- "#494d58",
- "#343741",
+ "#d5dce8",
+ "#b6c0d3",
+ "#98a5bc",
+ "#7b8aa4",
+ "#61718b",
+ "#485872",
+ "#324058",
+ "#1d2a3e",
],
"title": "",
"type": "gradient",
@@ -61,14 +61,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#fdeae5",
- "#f9d5cc",
- "#f4c0b4",
- "#eeab9c",
- "#e79685",
- "#df816e",
- "#d66c58",
- "#cc5642",
+ "#fae9e9",
+ "#fcd8d6",
+ "#fec8c3",
+ "#feb7b0",
+ "#fda69e",
+ "#fc968d",
+ "#f9847b",
+ "#f6726a",
],
"title": "",
"type": "gradient",
@@ -77,14 +77,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#f9eac5",
- "#f6d9af",
- "#f3c89a",
- "#efb785",
- "#eba672",
- "#e89361",
- "#e58053",
- "#e7664c",
+ "#ffdad5",
+ "#ffccc6",
+ "#ffbeb6",
+ "#ffafa6",
+ "#fea097",
+ "#fc9188",
+ "#f98279",
+ "#f6726a",
],
"title": "",
"type": "gradient",
@@ -93,14 +93,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#209280",
- "#3aa38d",
- "#54b399",
- "#95b978",
- "#df9352",
- "#e7664c",
- "#da5e47",
- "#cc5642",
+ "#24c292",
+ "#69d5b2",
+ "#aee8d2",
+ "#d5e0ab",
+ "#fed1a3",
+ "#ffc9c2",
+ "#fb9e96",
+ "#f6726a",
],
"title": "",
"type": "gradient",
@@ -109,14 +109,14 @@ exports[`HeatmapStyleEditor is rendered 1`] = `
Object {
"getPalette": [Function],
"palette": Array [
- "#6092c0",
- "#84a9cd",
- "#a8bfda",
- "#cad7e8",
- "#f5d9b1",
- "#efb785",
- "#eb8f69",
- "#e7664c",
+ "#61a2ff",
+ "#85b6ff",
+ "#a8caff",
+ "#c8deff",
+ "#ffccc6",
+ "#ffafa6",
+ "#fb9188",
+ "#f6726a",
],
"title": "",
"type": "gradient",
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap
index 691327928eb67..9c9a417f97bf5 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap
@@ -16,7 +16,7 @@ exports[`should render 1`] = `
}
defaultStaticStyleOptions={
Object {
- "color": "#54B399",
+ "color": "#16C5C0",
}
}
disabled={false}
@@ -38,23 +38,23 @@ exports[`should render 1`] = `
styleProperty={
StaticColorProperty {
"_options": Object {
- "color": "#54B399",
+ "color": "#16C5C0",
},
"_styleName": "fillColor",
}
}
swatches={
Array [
- "#54B399",
- "#6092C0",
- "#D36086",
- "#9170B8",
- "#CA8EAE",
- "#D6BF57",
- "#B9A888",
- "#DA8B45",
- "#AA6556",
- "#E7664C",
+ "#16C5C0",
+ "#A6EDEA",
+ "#61A2FF",
+ "#BFDBFF",
+ "#EE72A6",
+ "#FFC7DB",
+ "#F6726A",
+ "#FFC9C2",
+ "#EAAE01",
+ "#FCD883",
]
}
/>
@@ -75,7 +75,7 @@ exports[`should render 1`] = `
}
defaultStaticStyleOptions={
Object {
- "color": "#41937c",
+ "color": "#119793",
}
}
disabled={false}
@@ -97,23 +97,23 @@ exports[`should render 1`] = `
styleProperty={
StaticColorProperty {
"_options": Object {
- "color": "#41937c",
+ "color": "#119793",
},
"_styleName": "lineColor",
}
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
@@ -256,16 +256,16 @@ exports[`should render 1`] = `
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
@@ -351,16 +351,16 @@ exports[`should render 1`] = `
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
@@ -420,7 +420,7 @@ exports[`should render with no style fields 1`] = `
}
defaultStaticStyleOptions={
Object {
- "color": "#54B399",
+ "color": "#16C5C0",
}
}
disabled={false}
@@ -431,23 +431,23 @@ exports[`should render with no style fields 1`] = `
styleProperty={
StaticColorProperty {
"_options": Object {
- "color": "#54B399",
+ "color": "#16C5C0",
},
"_styleName": "fillColor",
}
}
swatches={
Array [
- "#54B399",
- "#6092C0",
- "#D36086",
- "#9170B8",
- "#CA8EAE",
- "#D6BF57",
- "#B9A888",
- "#DA8B45",
- "#AA6556",
- "#E7664C",
+ "#16C5C0",
+ "#A6EDEA",
+ "#61A2FF",
+ "#BFDBFF",
+ "#EE72A6",
+ "#FFC7DB",
+ "#F6726A",
+ "#FFC9C2",
+ "#EAAE01",
+ "#FCD883",
]
}
/>
@@ -468,7 +468,7 @@ exports[`should render with no style fields 1`] = `
}
defaultStaticStyleOptions={
Object {
- "color": "#41937c",
+ "color": "#119793",
}
}
disabled={false}
@@ -479,23 +479,23 @@ exports[`should render with no style fields 1`] = `
styleProperty={
StaticColorProperty {
"_options": Object {
- "color": "#41937c",
+ "color": "#119793",
},
"_styleName": "lineColor",
}
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
@@ -616,16 +616,16 @@ exports[`should render with no style fields 1`] = `
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
@@ -700,16 +700,16 @@ exports[`should render with no style fields 1`] = `
}
swatches={
Array [
- "#41937c",
- "#4379aa",
- "#c83868",
- "#7751a4",
- "#ba6b95",
- "#c9ad31",
- "#a69168",
- "#c57127",
- "#885145",
- "#e1401f",
+ "#119793",
+ "#7ce4e0",
+ "#2e84ff",
+ "#8cbeff",
+ "#e94489",
+ "#ff94ba",
+ "#f3443a",
+ "#ff9c8f",
+ "#b78801",
+ "#fbc851",
"#000",
"#FFF",
]
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/legend/extract_color_from_style_property.test.ts b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/legend/extract_color_from_style_property.test.ts
index aeeeff361d5a0..7d65839824430 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/legend/extract_color_from_style_property.test.ts
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/legend/extract_color_from_style_property.test.ts
@@ -137,7 +137,7 @@ describe('dynamic', () => {
fieldMetaOptions,
} as ColorDynamicOptions,
} as ColorDynamicStylePropertyDescriptor;
- expect(extractColorFromStyleProperty(colorStyleProperty, defaultColor)).toBe('#9eb9d8');
+ expect(extractColorFromStyleProperty(colorStyleProperty, defaultColor)).toBe('#9dc3ff');
});
});
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap
index f94b63e02163d..5896333afd0ac 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap
@@ -62,7 +62,7 @@ exports[`renderLegendDetailRow categorical Should render categorical legend with
key="0"
>
{
-1,
'rgba(0,0,0,0)',
0,
- '#ecf1f7',
+ '#e4eefd',
12.5,
- '#d9e3ef',
+ '#d3e3fe',
25,
- '#c5d5e7',
+ '#c1d8fe',
37.5,
- '#b2c7df',
+ '#afceff',
50,
- '#9eb9d8',
+ '#9dc3ff',
62.5,
- '#8bacd0',
+ '#8bb8ff',
75,
- '#769fc8',
+ '#77adff',
87.5,
- '#6092c0',
+ '#61a2ff',
]);
});
});
@@ -612,9 +612,9 @@ describe('get mapbox color expression (via internal _getMbColor)', () => {
'match',
['to-string', ['get', 'foobar']],
'US',
- '#54B399',
+ '#16C5C0',
'CN',
- '#6092C0',
+ '#A6EDEA',
'grey',
]);
});
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style.test.js b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style.test.js
index 1bbaad11534b0..eae517f34ff98 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style.test.js
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style.test.js
@@ -103,7 +103,7 @@ describe('getDescriptorWithUpdatedStyleProps', () => {
expect(hasChanges).toBe(true);
expect(nextStyleDescriptor.properties[VECTOR_STYLES.LINE_COLOR]).toEqual({
options: {
- color: '#41937c',
+ color: '#119793',
},
type: 'STATIC',
});
diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style_defaults.test.ts b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style_defaults.test.ts
index 856ae869e0bab..65d6ba9c6d941 100644
--- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style_defaults.test.ts
+++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/vector_style_defaults.test.ts
@@ -19,13 +19,13 @@ import { getDefaultStaticProperties } from './vector_style_defaults';
describe('getDefaultStaticProperties', () => {
test('Should use first color in DEFAULT_*_COLORS when no colors are used on the map', () => {
const styleProperties = getDefaultStaticProperties([]);
- expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#54B399');
- expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#41937c');
+ expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#16C5C0');
+ expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#119793');
});
test('Should next color in DEFAULT_*_COLORS when colors are used on the map', () => {
const styleProperties = getDefaultStaticProperties(['#54B399']);
- expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#6092C0');
- expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#4379aa');
+ expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#16C5C0');
+ expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#119793');
});
});
diff --git a/x-pack/platform/plugins/shared/maps/ui_tests/tests/full_screen_mode.spec.ts b/x-pack/platform/plugins/shared/maps/ui_tests/tests/full_screen_mode.spec.ts
index 861baafc7e8c3..07a179ad5116a 100644
--- a/x-pack/platform/plugins/shared/maps/ui_tests/tests/full_screen_mode.spec.ts
+++ b/x-pack/platform/plugins/shared/maps/ui_tests/tests/full_screen_mode.spec.ts
@@ -22,7 +22,7 @@ test.describe(
test.beforeEach(async ({ browserAuth, pageObjects }) => {
await browserAuth.loginAsViewer();
await pageObjects.maps.gotoNewMap();
- await pageObjects.renderable.waitForRender();
+ await pageObjects.maps.waitForRenderComplete();
});
test('Full screen mode', async ({ page }) => {
@@ -33,16 +33,16 @@ test.describe(
const baseMapBtn = page.getByRole('button', { name: 'Basemap' });
await expect(fullScreenBtn).toBeVisible();
- await expect(exitFullScreenBtn).not.toBeVisible();
+ await expect(exitFullScreenBtn).toBeHidden();
await expect(visibleChrome).toBeVisible();
- await expect(hiddenChrome).not.toBeVisible();
+ await expect(hiddenChrome).toBeHidden();
await expect(baseMapBtn).toBeVisible();
await fullScreenBtn.click();
- await expect(fullScreenBtn).not.toBeVisible();
+ await expect(fullScreenBtn).toBeHidden();
await expect(exitFullScreenBtn).toBeVisible();
- await expect(visibleChrome).not.toBeVisible();
+ await expect(visibleChrome).toBeHidden();
await expect(hiddenChrome).toBeVisible();
await expect(baseMapBtn).toBeVisible();
diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx
index 772fe59965130..b38c15f328196 100644
--- a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx
+++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx
@@ -54,23 +54,23 @@ describe('NER output', () => {
describe('getClassColor', () => {
test('returns the correct color for class PER', () => {
- expect(getClassColor('PER', true)).toBe('#f1d86f');
+ expect(getClassColor('PER', true)).toBe('#ffe0f5');
});
test('returns the correct color for class LOC', () => {
- expect(getClassColor('LOC', true)).toBe('#79aad9');
+ expect(getClassColor('LOC', true)).toBe('#bfffff');
});
test('returns the correct color for class ORG', () => {
- expect(getClassColor('ORG', true)).toBe('#6dccb1');
+ expect(getClassColor('ORG', true)).toBe('#45ded9');
});
test('returns the correct color for class MISC', () => {
- expect(getClassColor('MISC', true)).toBe('#f5a35c');
+ expect(getClassColor('MISC', true)).toBe('#ffe2db');
});
test('returns the default color for an unknown class', () => {
- expect(getClassColor('UNKNOWN', true)).toBe('#f1d86f');
+ expect(getClassColor('UNKNOWN', true)).toBe('#ffe0f5');
});
});
});
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/common/types.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/common/types.ts
index 210eb08b31e1a..e0f353b252564 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/common/types.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/common/types.ts
@@ -63,6 +63,7 @@ export interface Conversation {
last_updated: string;
token_count?: TokenCount;
};
+ systemMessage?: string;
messages: Message[];
labels: Record;
numeric_labels: Record;
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts
index 7fab15137d933..e737d534f3367 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts
@@ -12,7 +12,7 @@ import { ObservabilityAIAssistantTelemetryEventType } from '../telemetry_event_t
export interface ChatFeedback {
feedback: Feedback;
- conversation: Omit, 'conversation'> & {
+ conversation: Omit, 'conversation'> & {
conversation: Omit;
};
}
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.test.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.test.ts
index 64fcdda7612ae..d760e2dc996ba 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.test.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.test.ts
@@ -32,13 +32,7 @@ const mockChatService: MockedChatService = {
hasFunction: jest.fn().mockReturnValue(false),
hasRenderFunction: jest.fn().mockReturnValue(true),
renderFunction: jest.fn(),
- getSystemMessage: jest.fn().mockReturnValue({
- '@timestamp': new Date().toISOString(),
- message: {
- content: 'system',
- role: MessageRole.System,
- },
- }),
+ getSystemMessage: jest.fn().mockReturnValue('system'),
getScopes: jest.fn(),
};
@@ -88,11 +82,11 @@ describe('useChat', () => {
});
});
- it('returns the initial messages including the system message', () => {
+ it('returns the initial messages', () => {
const { messages } = hookResult.result.current;
- expect(messages.length).toBe(2);
- expect(messages[0].message.role).toBe('system');
- expect(messages[1].message.content).toBe('hello');
+ expect(messages.length).toBe(1);
+ expect(messages[0].message.role).toBe(MessageRole.User);
+ expect(messages[0].message.content).toBe('hello');
});
it('sets chatState to ready', () => {
@@ -166,8 +160,7 @@ describe('useChat', () => {
});
it('shows an empty list of messages', () => {
- expect(hookResult.result.current.messages.length).toBe(1);
- expect(hookResult.result.current.messages[0].message.role).toBe(MessageRole.System);
+ expect(hookResult.result.current.messages.length).toBe(0);
});
it('aborts the running request', () => {
@@ -187,7 +180,7 @@ describe('useChat', () => {
});
});
- expect(hookResult.result.current.messages[2].message.content).toBe('good');
+ expect(hookResult.result.current.messages[1].message.content).toBe('good');
});
});
@@ -222,7 +215,7 @@ describe('useChat', () => {
subject.complete();
});
- expect(hookResult.result.current.messages[2].message.content).toBe('goodbye');
+ expect(hookResult.result.current.messages[1].message.content).toBe('goodbye');
expect(hookResult.result.current.state).toBe(ChatState.Ready);
});
});
@@ -242,7 +235,7 @@ describe('useChat', () => {
});
it('shows the partial message and sets chatState to aborted', () => {
- expect(hookResult.result.current.messages[2].message.content).toBe('good');
+ expect(hookResult.result.current.messages[1].message.content).toBe('good');
expect(hookResult.result.current.state).toBe(ChatState.Aborted);
});
@@ -285,7 +278,7 @@ describe('useChat', () => {
});
it('shows the partial message and sets chatState to error', () => {
- expect(hookResult.result.current.messages[2].message.content).toBe('good');
+ expect(hookResult.result.current.messages[1].message.content).toBe('good');
expect(hookResult.result.current.state).toBe(ChatState.Error);
});
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.ts
index 86aeb8f519e87..f05ea83a4894b 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/hooks/use_chat.ts
@@ -30,13 +30,6 @@ export enum ChatState {
Aborted = 'aborted',
}
-function getWithSystemMessage(messages: Message[], systemMessage: Message) {
- return [
- systemMessage,
- ...messages.filter((message) => message.message.role !== MessageRole.System),
- ];
-}
-
export interface UseChatResult {
messages: Message[];
setMessages: (messages: Message[]) => void;
@@ -160,7 +153,8 @@ function useChatWithoutContext({
const next$ = chatService.complete({
getScreenContexts: () => service.getScreenContexts(),
connectorId,
- messages: getWithSystemMessage(nextMessages, systemMessage),
+ messages: nextMessages,
+ systemMessage,
persist,
disableFunctions: disableFunctions ?? false,
signal: abortControllerRef.current.signal,
@@ -275,8 +269,8 @@ function useChatWithoutContext({
}, []);
const memoizedMessages = useMemo(() => {
- return getWithSystemMessage(messages.concat(pendingMessages ?? []), systemMessage);
- }, [systemMessage, messages, pendingMessages]);
+ return messages.concat(pendingMessages ?? []);
+ }, [messages, pendingMessages]);
const setMessagesWithAbort = useCallback((nextMessages: Message[]) => {
abortControllerRef.current.abort();
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/mock.tsx b/x-pack/platform/plugins/shared/observability_ai_assistant/public/mock.tsx
index 7be61a65e263d..b71e74b1aa1fa 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/mock.tsx
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/mock.tsx
@@ -13,7 +13,7 @@ import type {
ChatCompletionChunkEvent,
StreamingChatResponseEventWithoutError,
} from '../common/conversation_complete';
-import { MessageRole, ScreenContextActionDefinition } from '../common/types';
+import { ScreenContextActionDefinition } from '../common/types';
import type { ObservabilityAIAssistantAPIClient } from './api';
import type {
ObservabilityAIAssistantChatService,
@@ -40,13 +40,7 @@ export const mockChatService: ObservabilityAIAssistantChatService = {
),
hasFunction: () => true,
hasRenderFunction: () => true,
- getSystemMessage: () => ({
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: 'System',
- },
- }),
+ getSystemMessage: () => 'System',
getScopes: jest.fn(),
};
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/complete.test.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/complete.test.ts
index dd69c8e309989..b9d2d66d34b38 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/complete.test.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/complete.test.ts
@@ -28,14 +28,8 @@ const client = {
const connectorId = 'foo';
+const systemMessage = 'System message';
const messages: Message[] = [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: 'System message',
- },
- },
{
'@timestamp': new Date().toISOString(),
message: {
@@ -97,6 +91,7 @@ describe('complete', () => {
client,
connectorId,
getScreenContexts: () => [],
+ systemMessage,
messages,
persist: false,
disableFunctions: false,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.test.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.test.ts
index f059196f2e681..27e4c747b9df6 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.test.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.test.ts
@@ -83,6 +83,7 @@ describe('createChatService', () => {
function chat({ signal }: { signal: AbortSignal } = { signal: new AbortController().signal }) {
return service.chat('my_test', {
signal,
+ systemMessage: 'system',
messages: [],
connectorId: '',
scopes: ['observability'],
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.ts
index e3ccb38319896..a9e268ffbecd0 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_chat_service.ts
@@ -25,7 +25,7 @@ import {
} from 'rxjs';
import { BehaviorSubject } from 'rxjs';
import type { AssistantScope } from '@kbn/ai-assistant-common';
-import { ChatCompletionChunkEvent, Message, MessageRole } from '../../common';
+import { ChatCompletionChunkEvent } from '../../common';
import {
StreamingChatResponseEventType,
type BufferFlushEvent,
@@ -186,7 +186,6 @@ class ChatService {
async initialize() {
this.functionRegistry = new Map();
- const systemMessages: string[] = [];
const scopePromise = this.apiClient('GET /internal/observability_ai_assistant/functions', {
signal: this.abortSignal,
params: {
@@ -196,7 +195,7 @@ class ChatService {
},
}).then(({ functionDefinitions, systemMessage }) => {
functionDefinitions.forEach((fn) => this.functionRegistry.set(fn.name, fn));
- systemMessages.push(systemMessage);
+ this.systemMessage = systemMessage;
});
await Promise.all([
@@ -210,8 +209,6 @@ class ChatService {
}),
]);
- this.systemMessage = systemMessages.join('\n');
-
this.functions$.next(this.getFunctions());
}
@@ -278,24 +275,17 @@ class ChatService {
return this.renderFunctionRegistry.has(name);
};
- public getSystemMessage = (): Message => {
- return {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: this.systemMessage,
- },
- };
- };
+ public getSystemMessage = (): string => this.systemMessage;
public chat: ObservabilityAIAssistantChatService['chat'] = (
name: string,
- { connectorId, messages, functionCall, functions, signal }
+ { connectorId, systemMessage, messages, functionCall, functions, signal }
) => {
return this.callStreamingApi('POST /internal/observability_ai_assistant/chat', {
params: {
body: {
name,
+ systemMessage,
messages,
connectorId,
functionCall,
@@ -316,6 +306,7 @@ class ChatService {
getScreenContexts,
connectorId,
conversationId,
+ systemMessage,
messages,
persist,
disableFunctions,
@@ -327,6 +318,7 @@ class ChatService {
getScreenContexts,
connectorId,
conversationId,
+ systemMessage,
messages,
persist,
disableFunctions,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_mock_chat_service.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_mock_chat_service.ts
index 0559d65a14a81..38a3dc2b08a93 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_mock_chat_service.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/service/create_mock_chat_service.ts
@@ -7,7 +7,7 @@
import type { DeeplyMockedKeys } from '@kbn/utility-types-jest';
import { BehaviorSubject } from 'rxjs';
-import { FunctionDefinition, MessageRole } from '../../common';
+import { FunctionDefinition } from '../../common';
import type { ObservabilityAIAssistantChatService } from '../types';
type MockedChatService = DeeplyMockedKeys;
@@ -22,13 +22,7 @@ export const createMockChatService = (): MockedChatService => {
hasFunction: jest.fn().mockReturnValue(false),
hasRenderFunction: jest.fn().mockReturnValue(true),
renderFunction: jest.fn(),
- getSystemMessage: jest.fn().mockReturnValue({
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: 'system',
- },
- }),
+ getSystemMessage: jest.fn().mockReturnValue('system'),
getScopes: jest.fn(),
};
return mockChatService;
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/storybook_mock.tsx b/x-pack/platform/plugins/shared/observability_ai_assistant/public/storybook_mock.tsx
index 004ad25aa4a86..5f2b70b1af99b 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/storybook_mock.tsx
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/storybook_mock.tsx
@@ -9,7 +9,7 @@ import { noop } from 'lodash';
import React from 'react';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { AssistantScope } from '@kbn/ai-assistant-common';
-import { ChatCompletionChunkEvent, FunctionDefinition, MessageRole } from '.';
+import { ChatCompletionChunkEvent, FunctionDefinition } from '.';
import type { StreamingChatResponseEventWithoutError } from '../common/conversation_complete';
import type { ObservabilityAIAssistantAPIClient } from './api';
import type { ObservabilityAIAssistantChatService, ObservabilityAIAssistantService } from './types';
@@ -30,13 +30,7 @@ export const createStorybookChatService = (): ObservabilityAIAssistantChatServic
),
hasFunction: () => true,
hasRenderFunction: () => true,
- getSystemMessage: () => ({
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: 'System',
- },
- }),
+ getSystemMessage: () => 'System',
functions$: new BehaviorSubject(
[]
) as ObservabilityAIAssistantChatService['functions$'],
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/types.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/types.ts
index 72517df5bffbc..9c4223705e9a8 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/types.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/types.ts
@@ -49,6 +49,7 @@ export interface ObservabilityAIAssistantChatService {
chat: (
name: string,
options: {
+ systemMessage: string;
messages: Message[];
connectorId: string;
functions?: Array>;
@@ -61,6 +62,7 @@ export interface ObservabilityAIAssistantChatService {
getScreenContexts: () => ObservabilityAIAssistantScreenContext[];
conversationId?: string;
connectorId: string;
+ systemMessage?: string;
messages: Message[];
persist: boolean;
disableFunctions:
@@ -79,7 +81,7 @@ export interface ObservabilityAIAssistantChatService {
}) => FunctionDefinition[];
functions$: BehaviorSubject;
hasFunction: (name: string) => boolean;
- getSystemMessage: () => Message;
+ getSystemMessage: () => string;
hasRenderFunction: (name: string) => boolean;
renderFunction: (
name: string,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/config.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/config.ts
index 2f36d27889c14..6669c991fe2bd 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/config.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/config.ts
@@ -11,6 +11,7 @@ export const config = schema.object({
enabled: schema.boolean({ defaultValue: true }),
scope: schema.maybe(schema.oneOf([schema.literal('observability'), schema.literal('search')])),
enableKnowledgeBase: schema.boolean({ defaultValue: true }),
+ disableKbSemanticTextMigration: schema.boolean({ defaultValue: false }),
});
export type ObservabilityAIAssistantConfig = TypeOf;
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts
index d87ded0cd2c5a..f3565f0bb36b1 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts
@@ -100,20 +100,14 @@ export async function getRelevantFieldNames({
await chat('get_relevant_dataset_names', {
signal,
stream: true,
- messages: [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: `You are a helpful assistant for Elastic Observability.
+ systemMessage: `You are a helpful assistant for Elastic Observability.
Your task is to create a list of field names that are relevant
to the conversation, using ONLY the list of fields and
types provided in the last user message. DO NOT UNDER ANY
CIRCUMSTANCES include fields not mentioned in this list.`,
- },
- },
- // remove the system message and the function request
- ...messages.slice(1, -1),
+ messages: [
+ // remove the function request
+ ...messages.filter((msg) => !msg.message?.function_call),
{
'@timestamp': new Date().toISOString(),
message: {
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/plugin.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/plugin.ts
index 7ff878bfa7a9d..fd2e8d0d4b45e 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/plugin.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/plugin.ts
@@ -31,7 +31,8 @@ import { registerFunctions } from './functions';
import { recallRankingEvent } from './analytics/recall_ranking';
import { initLangtrace } from './service/client/instrumentation/init_langtrace';
import { aiAssistantCapabilities } from '../common/capabilities';
-import { registerMigrateKnowledgeBaseEntriesTask } from './service/task_manager_definitions/register_migrate_knowledge_base_entries_task';
+import { registerAndScheduleKbSemanticTextMigrationTask } from './service/task_manager_definitions/register_kb_semantic_text_migration_task';
+import { updateExistingIndexAssets } from './service/create_or_update_index_assets';
export class ObservabilityAIAssistantPlugin
implements
@@ -128,14 +129,22 @@ export class ObservabilityAIAssistantPlugin
config: this.config,
}));
- registerMigrateKnowledgeBaseEntriesTask({
+ // Update existing index assets (mappings, templates, etc). This will not create assets if they do not exist.
+ updateExistingIndexAssets({ logger: this.logger.get('index_assets'), core }).catch((e) =>
+ this.logger.error(`Index assets could not be updated: ${e.message}`)
+ );
+
+ // register task to migrate knowledge base entries to include semantic_text field
+ registerAndScheduleKbSemanticTextMigrationTask({
core,
taskManager: plugins.taskManager,
- logger: this.logger,
+ logger: this.logger.get('kb_semantic_text_migration_task'),
config: this.config,
- }).catch((e) => {
- this.logger.error(`Knowledge base migration was not successfully: ${e.message}`);
- });
+ }).catch((e) =>
+ this.logger.error(
+ `Knowledge base semantic_text migration task could not be registered: ${e.message}`
+ )
+ );
service.register(registerFunctions);
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/chat/route.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/chat/route.ts
index 1ca0eb9d1dc39..23e7a70cecb31 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/chat/route.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/chat/route.ts
@@ -135,6 +135,7 @@ const chatRoute = createObservabilityAIAssistantServerRoute({
body: t.intersection([
t.type({
name: t.string,
+ systemMessage: t.string,
messages: t.array(messageRt),
connectorId: t.string,
functions: t.array(functionRt),
@@ -149,7 +150,7 @@ const chatRoute = createObservabilityAIAssistantServerRoute({
const { params } = resources;
const {
- body: { name, messages, connectorId, functions, functionCall },
+ body: { name, systemMessage, messages, connectorId, functions, functionCall },
} = params;
const { client, simulateFunctionCalling, signal, isCloudEnabled } = await initializeChatRequest(
@@ -158,6 +159,7 @@ const chatRoute = createObservabilityAIAssistantServerRoute({
const response$ = client.chat(name, {
stream: true,
+ systemMessage,
messages,
connectorId,
signal,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/conversations/route.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/conversations/route.ts
index e320376bc7357..cd2bb5b6331cd 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/conversations/route.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/conversations/route.ts
@@ -6,10 +6,23 @@
*/
import { notImplemented } from '@hapi/boom';
import * as t from 'io-ts';
-import { Conversation } from '../../../common/types';
+import { Conversation, MessageRole } from '../../../common/types';
import { createObservabilityAIAssistantServerRoute } from '../create_observability_ai_assistant_server_route';
import { conversationCreateRt, conversationUpdateRt } from '../runtime_types';
+// backwards compatibility for messages with system role
+const getConversationWithoutSystemMessages = (conversation: Conversation) => {
+ if (!conversation.systemMessage) {
+ conversation.systemMessage =
+ conversation.messages.find((message) => message.message.role === 'system')?.message
+ ?.content ?? '';
+ }
+ conversation.messages = conversation.messages.filter(
+ (message) => message.message.role !== MessageRole.System
+ );
+ return conversation;
+};
+
const getConversationRoute = createObservabilityAIAssistantServerRoute({
endpoint: 'GET /internal/observability_ai_assistant/conversation/{conversationId}',
params: t.type({
@@ -31,7 +44,9 @@ const getConversationRoute = createObservabilityAIAssistantServerRoute({
throw notImplemented();
}
- return client.get(params.path.conversationId);
+ const conversation = await client.get(params.path.conversationId);
+ // conversation without system messages
+ return getConversationWithoutSystemMessages(conversation);
},
});
@@ -56,7 +71,12 @@ const findConversationsRoute = createObservabilityAIAssistantServerRoute({
throw notImplemented();
}
- return client.find({ query: params?.body?.query });
+ const conversations = await client.find({ query: params?.body?.query });
+
+ return {
+ // conversations without system messages
+ conversations: conversations.map(getConversationWithoutSystemMessages),
+ };
},
});
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts
index 846a05797f975..ffdf9939ad7de 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts
@@ -10,9 +10,11 @@ import { connectorRoutes } from './connectors/route';
import { conversationRoutes } from './conversations/route';
import { functionRoutes } from './functions/route';
import { knowledgeBaseRoutes } from './knowledge_base/route';
+import { topLevelRoutes } from './top_level/route';
export function getGlobalObservabilityAIAssistantServerRouteRepository() {
return {
+ ...topLevelRoutes,
...chatRoutes,
...conversationRoutes,
...connectorRoutes,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/knowledge_base/route.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/knowledge_base/route.ts
index 1597d43ce52b9..e9c7078c0062e 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/knowledge_base/route.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/knowledge_base/route.ts
@@ -101,7 +101,7 @@ const resetKnowledgeBase = createObservabilityAIAssistantServerRoute({
});
const semanticTextMigrationKnowledgeBase = createObservabilityAIAssistantServerRoute({
- endpoint: 'POST /internal/observability_ai_assistant/kb/semantic_text_migration',
+ endpoint: 'POST /internal/observability_ai_assistant/kb/migrations/kb_semantic_text',
security: {
authz: {
requiredPrivileges: ['ai_assistant'],
@@ -114,7 +114,7 @@ const semanticTextMigrationKnowledgeBase = createObservabilityAIAssistantServerR
throw notImplemented();
}
- return client.migrateKnowledgeBaseToSemanticText();
+ return client.reIndexKnowledgeBaseAndPopulateSemanticTextField();
},
});
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/runtime_types.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/runtime_types.ts
index 68f91f7e09858..cfa0410364efb 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/runtime_types.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/runtime_types.ts
@@ -57,21 +57,26 @@ const tokenCountRt = t.type({
total: t.number,
});
-export const baseConversationRt: t.Type = t.type({
- '@timestamp': t.string,
- conversation: t.intersection([
- t.type({
- title: t.string,
- }),
- t.partial({
- token_count: tokenCountRt,
- }),
- ]),
- messages: t.array(messageRt),
- labels: t.record(t.string, t.string),
- numeric_labels: t.record(t.string, t.number),
- public: toBooleanRt,
-});
+export const baseConversationRt: t.Type = t.intersection([
+ t.type({
+ '@timestamp': t.string,
+ conversation: t.intersection([
+ t.type({
+ title: t.string,
+ }),
+ t.partial({
+ token_count: tokenCountRt,
+ }),
+ ]),
+ messages: t.array(messageRt),
+ labels: t.record(t.string, t.string),
+ numeric_labels: t.record(t.string, t.number),
+ public: toBooleanRt,
+ }),
+ t.partial({
+ systemMessage: t.string,
+ }),
+]);
export const assistantScopeType = t.union([
t.literal('observability'),
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/top_level/route.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/top_level/route.ts
new file mode 100644
index 0000000000000..dc817f378263f
--- /dev/null
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/routes/top_level/route.ts
@@ -0,0 +1,28 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createOrUpdateIndexAssets } from '../../service/create_or_update_index_assets';
+import { createObservabilityAIAssistantServerRoute } from '../create_observability_ai_assistant_server_route';
+
+const createOrUpdateIndexAssetsRoute = createObservabilityAIAssistantServerRoute({
+ endpoint: 'POST /internal/observability_ai_assistant/index_assets',
+ security: {
+ authz: {
+ requiredPrivileges: ['ai_assistant'],
+ },
+ },
+ handler: async (resources): Promise => {
+ return createOrUpdateIndexAssets({
+ logger: resources.logger,
+ core: resources.plugins.core.setup,
+ });
+ },
+});
+
+export const topLevelRoutes = {
+ ...createOrUpdateIndexAssetsRoute,
+};
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.test.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.test.ts
index 83cc9d9e60762..63861061408d4 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.test.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.test.ts
@@ -44,7 +44,7 @@ interface ChunkDelta {
type LlmSimulator = ReturnType;
-const EXPECTED_STORED_SYSTEM_MESSAGE = `system`;
+const EXPECTED_STORED_SYSTEM_MESSAGE = `this is a system message`;
const nextTick = () => {
return new Promise(process.nextTick);
@@ -185,7 +185,7 @@ describe('Observability AI Assistant client', () => {
knowledgeBaseServiceMock.getUserInstructions.mockResolvedValue([]);
- functionClientMock.getInstructions.mockReturnValue(['system']);
+ functionClientMock.getInstructions.mockReturnValue([EXPECTED_STORED_SYSTEM_MESSAGE]);
functionClientMock.getAdhocInstructions.mockReturnValue([]);
return new ObservabilityAIAssistantClient({
@@ -208,18 +208,6 @@ describe('Observability AI Assistant client', () => {
});
}
- function system(content: string | Omit): Message {
- return merge(
- {
- '@timestamp': new Date().toString(),
- message: {
- role: MessageRole.System,
- },
- },
- typeof content === 'string' ? { message: { content } } : content
- );
- }
-
function user(content: string | Omit): Message {
return merge(
{
@@ -286,7 +274,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
persist: true,
@@ -313,6 +301,8 @@ describe('Observability AI Assistant client', () => {
expect.objectContaining({
connectorId: 'foo',
stream: false,
+ system:
+ 'You are a helpful assistant for Elastic Observability. Assume the following message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you.',
functionCalling: 'auto',
toolChoice: expect.objectContaining({
function: 'title_conversation',
@@ -346,6 +336,7 @@ describe('Observability AI Assistant client', () => {
{
connectorId: 'foo',
stream: true,
+ system: EXPECTED_STORED_SYSTEM_MESSAGE,
messages: expect.arrayContaining([
{ role: 'user', content: 'How many alerts do I have?' },
]),
@@ -497,14 +488,8 @@ describe('Observability AI Assistant client', () => {
user: {
name: 'johndoe',
},
+ systemMessage: EXPECTED_STORED_SYSTEM_MESSAGE,
messages: [
- {
- '@timestamp': expect.any(String),
- message: {
- content: EXPECTED_STORED_SYSTEM_MESSAGE,
- role: MessageRole.System,
- },
- },
{
'@timestamp': expect.any(String),
message: {
@@ -567,10 +552,7 @@ describe('Observability AI Assistant client', () => {
labels: {},
numeric_labels: {},
public: false,
- messages: [
- system('This is a system message'),
- user('How many alerts do I have?'),
- ],
+ messages: [user('How many alerts do I have?')],
},
},
],
@@ -585,7 +567,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
conversationId: 'my-conversation-id',
@@ -645,14 +627,8 @@ describe('Observability AI Assistant client', () => {
user: {
name: 'johndoe',
},
+ systemMessage: EXPECTED_STORED_SYSTEM_MESSAGE,
messages: [
- {
- '@timestamp': expect.any(String),
- message: {
- content: EXPECTED_STORED_SYSTEM_MESSAGE,
- role: MessageRole.System,
- },
- },
{
'@timestamp': expect.any(String),
message: {
@@ -694,7 +670,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
title: 'My predefined title',
@@ -784,7 +760,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
title: 'My predefined title',
@@ -845,13 +821,6 @@ describe('Observability AI Assistant client', () => {
signal: expect.any(AbortSignal),
connectorId: 'foo',
messages: [
- {
- '@timestamp': expect.any(String),
- message: {
- role: MessageRole.System,
- content: EXPECTED_STORED_SYSTEM_MESSAGE,
- },
- },
{
'@timestamp': expect.any(String),
message: {
@@ -916,6 +885,7 @@ describe('Observability AI Assistant client', () => {
{
connectorId: 'foo',
stream: true,
+ system: EXPECTED_STORED_SYSTEM_MESSAGE,
messages: expect.arrayContaining([
{ role: 'user', content: 'How many alerts do I have?' },
]),
@@ -983,13 +953,6 @@ describe('Observability AI Assistant client', () => {
expect(
(internalUserEsClientMock.index.mock.lastCall![0] as any).document.messages
).toEqual([
- {
- '@timestamp': expect.any(String),
- message: {
- content: EXPECTED_STORED_SYSTEM_MESSAGE,
- role: MessageRole.System,
- },
- },
{
'@timestamp': expect.any(String),
message: {
@@ -1077,6 +1040,7 @@ describe('Observability AI Assistant client', () => {
{
connectorId: 'foo',
stream: true,
+ system: EXPECTED_STORED_SYSTEM_MESSAGE,
messages: expect.arrayContaining([
{ role: 'user', content: 'How many alerts do I have?' },
]),
@@ -1221,7 +1185,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
persist: false,
@@ -1346,7 +1310,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
title: 'My predefined title',
@@ -1424,7 +1388,7 @@ describe('Observability AI Assistant client', () => {
const stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
persist: false,
@@ -1512,7 +1476,7 @@ describe('Observability AI Assistant client', () => {
stream = observableIntoStream(
await client.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('How many alerts do I have?')],
+ messages: [user('How many alerts do I have?')],
functionClient: functionClientMock,
signal: new AbortController().signal,
title: 'My predefined title',
@@ -1577,7 +1541,7 @@ describe('Observability AI Assistant client', () => {
client
.complete({
connectorId: 'foo',
- messages: [system('This is a system message'), user('A user message to cause completion')],
+ messages: [user('A user message to cause completion')],
functionClient: functionClientMock,
signal: new AbortController().signal,
title: 'My predefined title',
@@ -1586,9 +1550,7 @@ describe('Observability AI Assistant client', () => {
.subscribe(() => {}); // To trigger call to chat
await nextTick();
- expect(chatSpy.mock.calls[0][1].messages[0].message.content).toEqual(
- EXPECTED_STORED_SYSTEM_MESSAGE
- );
+ expect(chatSpy.mock.calls[0][1].systemMessage).toEqual(EXPECTED_STORED_SYSTEM_MESSAGE);
});
describe('when executing an action', () => {
@@ -1605,10 +1567,7 @@ describe('Observability AI Assistant client', () => {
const complete$ = await client.complete({
connectorId: 'foo',
- messages: [
- system('This is a system message'),
- user('Can you call the my_action function?'),
- ],
+ messages: [user('Can you call the my_action function?')],
functionClient: new ChatFunctionClient([
{
actions: [
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
index 3885057fd28c5..bb2064a3dbb6b 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
@@ -14,7 +14,6 @@ import { context } from '@opentelemetry/api';
import { last, merge, omit } from 'lodash';
import {
catchError,
- combineLatest,
defer,
filter,
forkJoin,
@@ -56,7 +55,6 @@ import {
type Message,
KnowledgeBaseType,
KnowledgeBaseEntryRole,
- MessageRole,
} from '../../../common/types';
import { withoutTokenCountEvents } from '../../../common/utils/without_token_count_events';
import { CONTEXT_FUNCTION_NAME } from '../../functions/context';
@@ -64,7 +62,6 @@ import type { ChatFunctionClient } from '../chat_function_client';
import { KnowledgeBaseService, RecalledEntry } from '../knowledge_base_service';
import { getAccessQuery } from '../util/get_access_query';
import { getSystemMessageFromInstructions } from '../util/get_system_message_from_instructions';
-import { replaceSystemMessage } from '../util/replace_system_message';
import { failOnNonExistingFunctionCall } from './operators/fail_on_non_existing_function_call';
import { getContextFunctionRequestIfNeeded } from './get_context_function_request_if_needed';
import { LangTracer } from './instrumentation/lang_tracer';
@@ -75,9 +72,9 @@ import { extractTokenCount } from './operators/extract_token_count';
import { getGeneratedTitle } from './operators/get_generated_title';
import { instrumentAndCountTokens } from './operators/instrument_and_count_tokens';
import {
- runSemanticTextKnowledgeBaseMigration,
- scheduleSemanticTextMigration,
-} from '../task_manager_definitions/register_migrate_knowledge_base_entries_task';
+ reIndexKnowledgeBaseAndPopulateSemanticTextField,
+ scheduleKbSemanticTextMigrationTask,
+} from '../task_manager_definitions/register_kb_semantic_text_migration_task';
import { ObservabilityAIAssistantPluginStartDependencies } from '../../types';
import { ObservabilityAIAssistantConfig } from '../../config';
import { getElserModelId } from '../knowledge_base_service/get_elser_model_id';
@@ -215,28 +212,6 @@ export class ObservabilityAIAssistantClient {
const registeredAdhocInstructions = functionClient.getAdhocInstructions();
const allAdHocInstructions = adHocInstructions.concat(registeredAdhocInstructions);
- // from the initial messages, override any system message with
- // the one that is based on the instructions (registered, request, kb)
- const messagesWithUpdatedSystemMessage$ = userInstructions$.pipe(
- map((userInstructions) => {
- // this is what we eventually store in the conversation
- const messagesWithUpdatedSystemMessage = replaceSystemMessage(
- getSystemMessageFromInstructions({
- applicationInstructions: functionClient.getInstructions(),
- userInstructions,
- adHocInstructions: allAdHocInstructions,
- availableFunctionNames: functionClient
- .getFunctions()
- .map((fn) => fn.definition.name),
- }),
- initialMessages
- );
-
- return messagesWithUpdatedSystemMessage;
- }),
- shareReplay()
- );
-
// if it is:
// - a new conversation
// - no predefined title is given
@@ -246,35 +221,39 @@ export class ObservabilityAIAssistantClient {
const title$ =
predefinedTitle || isConversationUpdate || !persist
? of(predefinedTitle || '').pipe(shareReplay())
- : messagesWithUpdatedSystemMessage$.pipe(
- switchMap((messages) =>
- getGeneratedTitle({
- messages,
- logger: this.dependencies.logger,
- chat: (name, chatParams) =>
- this.chat(name, {
- ...chatParams,
- simulateFunctionCalling,
- connectorId,
- signal,
- stream: false,
- }),
- tracer: completeTracer,
- })
- ),
- shareReplay()
- );
+ : getGeneratedTitle({
+ messages: initialMessages,
+ logger: this.dependencies.logger,
+ chat: (name, chatParams) =>
+ this.chat(name, {
+ ...chatParams,
+ simulateFunctionCalling,
+ connectorId,
+ signal,
+ stream: false,
+ }),
+ tracer: completeTracer,
+ }).pipe(shareReplay());
+
+ const systemMessage$ = userInstructions$.pipe(
+ map((userInstructions) => {
+ return getSystemMessageFromInstructions({
+ applicationInstructions: functionClient.getInstructions(),
+ userInstructions,
+ adHocInstructions: allAdHocInstructions,
+ availableFunctionNames: functionClient.getFunctions().map((fn) => fn.definition.name),
+ });
+ }),
+ shareReplay()
+ );
// we continue the conversation here, after resolving both the materialized
// messages and the knowledge base instructions
- const nextEvents$ = combineLatest([
- messagesWithUpdatedSystemMessage$,
- userInstructions$,
- ]).pipe(
- switchMap(([messagesWithUpdatedSystemMessage, userInstructions]) => {
+ const nextEvents$ = forkJoin([systemMessage$, userInstructions$]).pipe(
+ switchMap(([systemMessage, userInstructions]) => {
// if needed, inject a context function request here
const contextRequest = functionClient.hasFunction(CONTEXT_FUNCTION_NAME)
- ? getContextFunctionRequestIfNeeded(messagesWithUpdatedSystemMessage)
+ ? getContextFunctionRequestIfNeeded(initialMessages)
: undefined;
return mergeOperator(
@@ -283,14 +262,12 @@ export class ObservabilityAIAssistantClient {
// and add it to the conversation
...(contextRequest ? [of(contextRequest)] : []),
continueConversation({
- messages: [
- ...messagesWithUpdatedSystemMessage,
- ...(contextRequest ? [contextRequest.message] : []),
- ],
+ messages: [...initialMessages, ...(contextRequest ? [contextRequest.message] : [])],
chat: (name, chatParams) => {
// inject a chat function with predefined parameters
return this.chat(name, {
...chatParams,
+ systemMessage,
signal,
simulateFunctionCalling,
connectorId,
@@ -319,7 +296,6 @@ export class ObservabilityAIAssistantClient {
nextEvents$,
// wait until all dependencies have completed
forkJoin([
- messagesWithUpdatedSystemMessage$,
// get just the new messages
nextEvents$.pipe(withoutTokenCountEvents(), extractMessages()),
// count all the token count events emitted during completion
@@ -329,101 +305,100 @@ export class ObservabilityAIAssistantClient {
).pipe(extractTokenCount()),
// get just the title, and drop the token count events
title$.pipe(filter((value): value is string => typeof value === 'string')),
+ systemMessage$,
]).pipe(
- switchMap(
- ([messagesWithUpdatedSystemMessage, addedMessages, tokenCountResult, title]) => {
- const initialMessagesWithAddedMessages =
- messagesWithUpdatedSystemMessage.concat(addedMessages);
-
- const lastMessage = last(initialMessagesWithAddedMessages);
-
- // if a function request is at the very end, close the stream to consumer
- // without persisting or updating the conversation. we need to wait
- // on the function response to have a valid conversation
- const isFunctionRequest = !!lastMessage?.message.function_call?.name;
-
- if (!persist || isFunctionRequest) {
- return of();
- }
-
- if (isConversationUpdate) {
- return from(this.getConversationWithMetaFields(conversationId))
- .pipe(
- switchMap((conversation) => {
- if (!conversation) {
- return throwError(() => createConversationNotFoundError());
- }
-
- const persistedTokenCount = conversation._source?.conversation
- .token_count ?? {
- prompt: 0,
- completion: 0,
- total: 0,
- };
-
- return from(
- this.update(
- conversationId,
-
- merge(
- {},
-
- // base conversation without messages
- omit(conversation._source, 'messages'),
-
- // update messages
- { messages: initialMessagesWithAddedMessages },
-
- // update token count
- {
- conversation: {
- title: title || conversation._source?.conversation.title,
- token_count: {
- prompt: persistedTokenCount.prompt + tokenCountResult.prompt,
- completion:
- persistedTokenCount.completion + tokenCountResult.completion,
- total: persistedTokenCount.total + tokenCountResult.total,
- },
+ switchMap(([addedMessages, tokenCountResult, title, systemMessage]) => {
+ const initialMessagesWithAddedMessages = initialMessages.concat(addedMessages);
+
+ const lastMessage = last(initialMessagesWithAddedMessages);
+
+ // if a function request is at the very end, close the stream to consumer
+ // without persisting or updating the conversation. we need to wait
+ // on the function response to have a valid conversation
+ const isFunctionRequest = !!lastMessage?.message.function_call?.name;
+
+ if (!persist || isFunctionRequest) {
+ return of();
+ }
+
+ if (isConversationUpdate) {
+ return from(this.getConversationWithMetaFields(conversationId))
+ .pipe(
+ switchMap((conversation) => {
+ if (!conversation) {
+ return throwError(() => createConversationNotFoundError());
+ }
+
+ const persistedTokenCount = conversation._source?.conversation
+ .token_count ?? {
+ prompt: 0,
+ completion: 0,
+ total: 0,
+ };
+
+ return from(
+ this.update(
+ conversationId,
+
+ merge(
+ {},
+
+ // base conversation without messages
+ omit(conversation._source, 'messages'),
+
+ // update messages and system message
+ { messages: initialMessagesWithAddedMessages, systemMessage },
+
+ // update token count
+ {
+ conversation: {
+ title: title || conversation._source?.conversation.title,
+ token_count: {
+ prompt: persistedTokenCount.prompt + tokenCountResult.prompt,
+ completion:
+ persistedTokenCount.completion + tokenCountResult.completion,
+ total: persistedTokenCount.total + tokenCountResult.total,
},
- }
- )
+ },
+ }
)
- );
- })
- )
- .pipe(
- map((conversation): ConversationUpdateEvent => {
- return {
- conversation: conversation.conversation,
- type: StreamingChatResponseEventType.ConversationUpdate,
- };
- })
- );
- }
-
- return from(
- this.create({
- '@timestamp': new Date().toISOString(),
- conversation: {
- title,
- id: conversationId,
- token_count: tokenCountResult,
- },
- public: !!isPublic,
- labels: {},
- numeric_labels: {},
- messages: initialMessagesWithAddedMessages,
- })
- ).pipe(
- map((conversation): ConversationCreateEvent => {
- return {
- conversation: conversation.conversation,
- type: StreamingChatResponseEventType.ConversationCreate,
- };
- })
- );
+ )
+ );
+ })
+ )
+ .pipe(
+ map((conversation): ConversationUpdateEvent => {
+ return {
+ conversation: conversation.conversation,
+ type: StreamingChatResponseEventType.ConversationUpdate,
+ };
+ })
+ );
}
- )
+
+ return from(
+ this.create({
+ '@timestamp': new Date().toISOString(),
+ conversation: {
+ title,
+ id: conversationId,
+ token_count: tokenCountResult,
+ },
+ public: !!isPublic,
+ labels: {},
+ numeric_labels: {},
+ systemMessage,
+ messages: initialMessagesWithAddedMessages,
+ })
+ ).pipe(
+ map((conversation): ConversationCreateEvent => {
+ return {
+ conversation: conversation.conversation,
+ type: StreamingChatResponseEventType.ConversationCreate,
+ };
+ })
+ );
+ })
)
);
@@ -466,6 +441,7 @@ export class ObservabilityAIAssistantClient {
chat(
name: string,
{
+ systemMessage,
messages,
connectorId,
functions,
@@ -475,6 +451,7 @@ export class ObservabilityAIAssistantClient {
tracer,
stream,
}: {
+ systemMessage?: string;
messages: Message[];
connectorId: string;
functions?: Array<{ name: string; description: string; parameters?: CompatibleJSONSchema }>;
@@ -508,9 +485,8 @@ export class ObservabilityAIAssistantClient {
const options = {
connectorId,
- messages: convertMessagesForInference(
- messages.filter((message) => message.message.role !== MessageRole.System)
- ),
+ system: systemMessage,
+ messages: convertMessagesForInference(messages),
toolChoice,
tools,
functionCalling: (simulateFunctionCalling ? 'simulated' : 'auto') as FunctionCallingMode,
@@ -546,7 +522,7 @@ export class ObservabilityAIAssistantClient {
}
}
- find = async (options?: { query?: string }): Promise<{ conversations: Conversation[] }> => {
+ find = async (options?: { query?: string }): Promise => {
const response = await this.dependencies.esClient.asInternalUser.search({
index: resourceNames.aliases.conversations,
allow_no_indices: true,
@@ -566,9 +542,7 @@ export class ObservabilityAIAssistantClient {
size: 100,
});
- return {
- conversations: response.hits.hits.map((hit) => hit._source!),
- };
+ return response.hits.hits.map((hit) => hit._source!);
};
update = async (
@@ -686,12 +660,11 @@ export class ObservabilityAIAssistantClient {
core
.getStartServices()
- .then(([_, pluginsStart]) => {
- logger.debug('Schedule semantic text migration task');
- return scheduleSemanticTextMigration(pluginsStart);
- })
+ .then(([_, pluginsStart]) =>
+ scheduleKbSemanticTextMigrationTask({ taskManager: pluginsStart.taskManager, logger })
+ )
.catch((error) => {
- logger.error(`Failed to run semantic text migration task: ${error}`);
+ logger.error(`Failed to schedule semantic text migration task: ${error}`);
});
return res;
@@ -702,8 +675,8 @@ export class ObservabilityAIAssistantClient {
return this.dependencies.knowledgeBaseService.reset(esClient);
};
- migrateKnowledgeBaseToSemanticText = () => {
- return runSemanticTextKnowledgeBaseMigration({
+ reIndexKnowledgeBaseAndPopulateSemanticTextField = () => {
+ return reIndexKnowledgeBaseAndPopulateSemanticTextField({
esClient: this.dependencies.esClient,
logger: this.dependencies.logger,
config: this.dependencies.config,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/continue_conversation.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/continue_conversation.ts
index ba19aca714eb4..a78f0b4aa70be 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/continue_conversation.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/continue_conversation.ts
@@ -35,8 +35,6 @@ import { withoutTokenCountEvents } from '../../../../common/utils/without_token_
import type { ChatFunctionClient } from '../../chat_function_client';
import type { AutoAbortedChatFunction } from '../../types';
import { createServerSideFunctionResponseError } from '../../util/create_server_side_function_response_error';
-import { getSystemMessageFromInstructions } from '../../util/get_system_message_from_instructions';
-import { replaceSystemMessage } from '../../util/replace_system_message';
import { LangTracer } from '../instrumentation/lang_tracer';
import { catchFunctionNotFoundError } from './catch_function_not_found_error';
import { extractMessages } from './extract_messages';
@@ -213,20 +211,7 @@ export function continueConversation({
disableFunctions,
});
- const registeredAdhocInstructions = functionClient.getAdhocInstructions();
- const allAdHocInstructions = adHocInstructions.concat(registeredAdhocInstructions);
-
- const messagesWithUpdatedSystemMessage = replaceSystemMessage(
- getSystemMessageFromInstructions({
- applicationInstructions: functionClient.getInstructions(),
- userInstructions,
- adHocInstructions: allAdHocInstructions,
- availableFunctionNames: definitions.map((def) => def.name),
- }),
- initialMessages
- );
-
- const lastMessage = last(messagesWithUpdatedSystemMessage)?.message;
+ const lastMessage = last(initialMessages)?.message;
const isUserMessage = lastMessage?.role === MessageRole.User;
return executeNextStep().pipe(handleEvents());
@@ -239,7 +224,7 @@ export function continueConversation({
: 'user_message';
return chat(operationName, {
- messages: messagesWithUpdatedSystemMessage,
+ messages: initialMessages,
functions: definitions,
tracer,
connectorId,
@@ -314,7 +299,7 @@ export function continueConversation({
args: lastMessage.function_call!.arguments,
chat,
functionClient,
- messages: messagesWithUpdatedSystemMessage,
+ messages: initialMessages,
signal,
logger,
tracer,
@@ -337,7 +322,7 @@ export function continueConversation({
return EMPTY;
}
return continueConversation({
- messages: messagesWithUpdatedSystemMessage.concat(extractedMessages),
+ messages: initialMessages.concat(extractedMessages),
chat,
functionCallsLeft: nextFunctionCallsLeft,
functionClient,
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts
index 42453f8d407b6..776881378ce99 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts
@@ -92,10 +92,9 @@ describe('getGeneratedTitle', () => {
await lastValueFrom(title$);
const [name, params] = chatSpy.mock.calls[0];
-
expect(name).toEqual('generate_title');
- expect(params.messages.length).toBe(2);
- expect(params.messages[1].message.content).toContain('A message');
+ expect(params.messages.length).toBe(1);
+ expect(params.messages[0].message.content).toContain('A message');
});
it('strips quotes from the title', async () => {
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.ts
index 3f1b9f43cd35f..20d6c1217aa6d 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/get_generated_title.ts
@@ -36,23 +36,16 @@ export function getGeneratedTitle({
}): Observable {
return from(
chat('generate_title', {
+ systemMessage:
+ 'You are a helpful assistant for Elastic Observability. Assume the following message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you.',
messages: [
- {
- '@timestamp': new Date().toString(),
- message: {
- role: MessageRole.System,
- content: `You are a helpful assistant for Elastic Observability. Assume the following message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you.`,
- },
- },
{
'@timestamp': new Date().toISOString(),
message: {
role: MessageRole.User,
- content: messages
- .filter((msg) => msg.message.role !== MessageRole.System)
- .reduce((acc, curr) => {
- return `${acc} ${curr.message.role}: ${curr.message.content}`;
- }, 'Generate a title, using the title_conversation_function, based on the following conversation:\n\n'),
+ content: messages.reduce((acc, curr) => {
+ return `${acc} ${curr.message.role}: ${curr.message.content}`;
+ }, 'Generate a title, using the title_conversation_function, based on the following conversation:\n\n'),
},
},
],
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/create_or_update_index_assets.ts
similarity index 65%
rename from x-pack/platform/plugins/shared/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts
rename to x-pack/platform/plugins/shared/observability_ai_assistant/server/service/create_or_update_index_assets.ts
index b56628ce4b7ee..85a0e9ba8e42a 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/create_or_update_index_assets.ts
@@ -6,13 +6,39 @@
*/
import { createConcreteWriteIndex, getDataStreamAdapter } from '@kbn/alerting-plugin/server';
-import type { CoreSetup, Logger } from '@kbn/core/server';
+import type { CoreSetup, ElasticsearchClient, Logger } from '@kbn/core/server';
import type { ObservabilityAIAssistantPluginStartDependencies } from '../types';
import { conversationComponentTemplate } from './conversation_component_template';
import { kbComponentTemplate } from './kb_component_template';
import { resourceNames } from '.';
-export async function setupConversationAndKbIndexAssets({
+export async function updateExistingIndexAssets({
+ logger,
+ core,
+}: {
+ logger: Logger;
+ core: CoreSetup;
+}) {
+ const [coreStart] = await core.getStartServices();
+ const { asInternalUser } = coreStart.elasticsearch.client;
+
+ const hasKbIndex = await asInternalUser.indices.exists({
+ index: resourceNames.aliases.kb,
+ });
+
+ const hasConversationIndex = await asInternalUser.indices.exists({
+ index: resourceNames.aliases.conversations,
+ });
+
+ if (!hasKbIndex && !hasConversationIndex) {
+ logger.debug('Index assets do not exist. Aborting updating index assets');
+ return;
+ }
+
+ await createOrUpdateIndexAssets({ logger, core });
+}
+
+export async function createOrUpdateIndexAssets({
logger,
core,
}: {
@@ -56,7 +82,7 @@ export async function setupConversationAndKbIndexAssets({
alias: conversationAliasName,
pattern: `${conversationAliasName}*`,
basePattern: `${conversationAliasName}*`,
- name: `${conversationAliasName}-000001`,
+ name: resourceNames.concreteIndexName.conversations,
template: resourceNames.indexTemplate.conversations,
},
dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts: false }),
@@ -86,20 +112,7 @@ export async function setupConversationAndKbIndexAssets({
});
// Knowledge base: write index
- const kbAliasName = resourceNames.aliases.kb;
- await createConcreteWriteIndex({
- esClient: asInternalUser,
- logger,
- totalFieldsLimit: 10000,
- indexPatterns: {
- alias: kbAliasName,
- pattern: `${kbAliasName}*`,
- basePattern: `${kbAliasName}*`,
- name: `${kbAliasName}-000001`,
- template: resourceNames.indexTemplate.kb,
- },
- dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts: false }),
- });
+ await createKbConcreteIndex({ logger, esClient: coreStart.elasticsearch.client });
logger.info('Successfully set up index assets');
} catch (error) {
@@ -107,3 +120,28 @@ export async function setupConversationAndKbIndexAssets({
logger.debug(error);
}
}
+
+export async function createKbConcreteIndex({
+ logger,
+ esClient,
+}: {
+ logger: Logger;
+ esClient: {
+ asInternalUser: ElasticsearchClient;
+ };
+}) {
+ const kbAliasName = resourceNames.aliases.kb;
+ return createConcreteWriteIndex({
+ esClient: esClient.asInternalUser,
+ logger,
+ totalFieldsLimit: 10000,
+ indexPatterns: {
+ alias: kbAliasName,
+ pattern: `${kbAliasName}*`,
+ basePattern: `${kbAliasName}*`,
+ name: resourceNames.concreteIndexName.kb,
+ template: resourceNames.indexTemplate.kb,
+ },
+ dataStreamAdapter: getDataStreamAdapter({ useDataStreamForAlerts: false }),
+ });
+}
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/index.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/index.ts
index dcd79f5d57873..adc7ea2822747 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/index.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/index.ts
@@ -17,7 +17,7 @@ import { ObservabilityAIAssistantClient } from './client';
import { KnowledgeBaseService } from './knowledge_base_service';
import type { RegistrationCallback, RespondFunctionResources } from './types';
import { ObservabilityAIAssistantConfig } from '../config';
-import { setupConversationAndKbIndexAssets } from './setup_conversation_and_kb_index_assets';
+import { createOrUpdateIndexAssets } from './create_or_update_index_assets';
function getResourceName(resource: string) {
return `.kibana-observability-ai-assistant-${resource}`;
@@ -40,11 +40,15 @@ export const resourceNames = {
conversations: getResourceName('index-template-conversations'),
kb: getResourceName('index-template-kb'),
},
+ concreteIndexName: {
+ conversations: getResourceName('conversations-000001'),
+ kb: getResourceName('kb-000001'),
+ },
};
const createIndexAssetsOnce = once(
(logger: Logger, core: CoreSetup) =>
- pRetry(() => setupConversationAndKbIndexAssets({ logger, core }))
+ pRetry(() => createOrUpdateIndexAssets({ logger, core }))
);
export class ObservabilityAIAssistantService {
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/index.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/index.ts
index a73be984920c4..aea384b4c0aa6 100644
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/index.ts
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/index.ts
@@ -28,6 +28,11 @@ import {
import { recallFromSearchConnectors } from './recall_from_search_connectors';
import { ObservabilityAIAssistantPluginStartDependencies } from '../../types';
import { ObservabilityAIAssistantConfig } from '../../config';
+import {
+ isKnowledgeBaseIndexWriteBlocked,
+ isSemanticTextUnsupportedError,
+} from './reindex_knowledge_base';
+import { scheduleKbSemanticTextMigrationTask } from '../task_manager_definitions/register_kb_semantic_text_migration_task';
interface Dependencies {
core: CoreSetup;
@@ -406,7 +411,9 @@ export class KnowledgeBaseService {
}
try {
- await this.dependencies.esClient.asInternalUser.index({
+ await this.dependencies.esClient.asInternalUser.index<
+ Omit & { namespace: string }
+ >({
index: resourceNames.aliases.kb,
id,
document: {
@@ -418,10 +425,40 @@ export class KnowledgeBaseService {
},
refresh: 'wait_for',
});
+ this.dependencies.logger.debug(`Entry added to knowledge base`);
} catch (error) {
+ this.dependencies.logger.debug(`Failed to add entry to knowledge base ${error}`);
if (isInferenceEndpointMissingOrUnavailable(error)) {
throwKnowledgeBaseNotReady(error.body);
}
+
+ if (isSemanticTextUnsupportedError(error)) {
+ this.dependencies.core
+ .getStartServices()
+ .then(([_, pluginsStart]) => {
+ return scheduleKbSemanticTextMigrationTask({
+ taskManager: pluginsStart.taskManager,
+ logger: this.dependencies.logger,
+ runSoon: true,
+ });
+ })
+ .catch((e) => {
+ this.dependencies.logger.error(
+ `Failed to schedule knowledge base semantic text migration task: ${e}`
+ );
+ });
+
+ throw serverUnavailable(
+ 'The knowledge base is currently being re-indexed. Please try again later'
+ );
+ }
+
+ if (isKnowledgeBaseIndexWriteBlocked(error)) {
+ throw new Error(
+ `Writes to the knowledge base are currently blocked due to an Elasticsearch write index block. This is most likely due to an ongoing re-indexing operation. Please try again later. Error: ${error.message}`
+ );
+ }
+
throw error;
}
};
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/reindex_knowledge_base.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/reindex_knowledge_base.ts
new file mode 100644
index 0000000000000..7b65576a1e6da
--- /dev/null
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/reindex_knowledge_base.ts
@@ -0,0 +1,113 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { errors as EsErrors } from '@elastic/elasticsearch';
+import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
+import { Logger } from '@kbn/logging';
+import { resourceNames } from '..';
+import { createKbConcreteIndex } from '../create_or_update_index_assets';
+
+export async function reIndexKnowledgeBase({
+ logger,
+ esClient,
+}: {
+ logger: Logger;
+ esClient: {
+ asInternalUser: ElasticsearchClient;
+ };
+}): Promise {
+ logger.debug('Initiating knowledge base re-indexing...');
+
+ try {
+ const originalIndex = resourceNames.concreteIndexName.kb;
+ const tempIndex = `${resourceNames.aliases.kb}-000002`;
+
+ const indexSettingsResponse = await esClient.asInternalUser.indices.getSettings({
+ index: originalIndex,
+ });
+
+ const indexSettings = indexSettingsResponse[originalIndex].settings;
+ const createdVersion = parseInt(indexSettings?.index?.version?.created ?? '', 10);
+
+ // Check if the index was created before version 8.11
+ const versionThreshold = 8110000; // Version 8.11.0
+ if (createdVersion >= versionThreshold) {
+ logger.warn(
+ `Knowledge base index "${originalIndex}" was created in version ${createdVersion}, and does not require re-indexing. Semantic text field is already supported. Aborting`
+ );
+ return;
+ }
+
+ logger.info(
+ `Knowledge base index was created in ${createdVersion} and must be re-indexed in order to support semantic_text field. Re-indexing now...`
+ );
+
+ // Create temporary index
+ logger.debug(`Creating temporary index "${tempIndex}"...`);
+ await esClient.asInternalUser.indices.delete({ index: tempIndex }, { ignore: [404] });
+ await esClient.asInternalUser.indices.create({ index: tempIndex });
+
+ // Perform reindex to temporary index
+ logger.debug(`Re-indexing knowledge base to temporary index "${tempIndex}"...`);
+ await esClient.asInternalUser.reindex({
+ body: {
+ source: { index: originalIndex },
+ dest: { index: tempIndex },
+ },
+ refresh: true,
+ wait_for_completion: true,
+ });
+
+ // Delete and re-create original index
+ logger.debug(`Deleting original index "${originalIndex}" and re-creating it...`);
+ await esClient.asInternalUser.indices.delete({ index: originalIndex });
+ await createKbConcreteIndex({ logger, esClient });
+
+ // Perform reindex back to original index
+ logger.debug(`Re-indexing knowledge base back to original index "${originalIndex}"...`);
+ await esClient.asInternalUser.reindex({
+ body: {
+ source: { index: tempIndex },
+ dest: { index: originalIndex },
+ },
+ refresh: true,
+ wait_for_completion: true,
+ });
+
+ // Delete temporary index
+ logger.debug(`Deleting temporary index "${tempIndex}"...`);
+ await esClient.asInternalUser.indices.delete({ index: tempIndex });
+
+ logger.info(
+ 'Re-indexing knowledge base completed successfully. Semantic text field is now supported.'
+ );
+ } catch (error) {
+ throw new Error(`Failed to reindex knowledge base: ${error.message}`);
+ }
+}
+
+export function isKnowledgeBaseIndexWriteBlocked(error: any) {
+ return (
+ error instanceof EsErrors.ResponseError &&
+ error.message.includes(
+ `cluster_block_exception: index [${resourceNames.concreteIndexName.kb}] blocked`
+ )
+ );
+}
+
+export function isSemanticTextUnsupportedError(error: Error) {
+ const semanticTextUnsupportedError =
+ 'The [sparse_vector] field type is not supported on indices created on versions 8.0 to 8.10';
+
+ const isSemanticTextUnspported =
+ error instanceof EsErrors.ResponseError &&
+ (error.message.includes(semanticTextUnsupportedError) ||
+ // @ts-expect-error
+ error.meta?.body?.error?.caused_by?.reason.includes(semanticTextUnsupportedError));
+
+ return isSemanticTextUnspported;
+}
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_kb_semantic_text_migration_task.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_kb_semantic_text_migration_task.ts
new file mode 100644
index 0000000000000..29dd1418b2818
--- /dev/null
+++ b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_kb_semantic_text_migration_task.ts
@@ -0,0 +1,228 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
+import pLimit from 'p-limit';
+import { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server';
+import type { CoreSetup, CoreStart, Logger } from '@kbn/core/server';
+import pRetry from 'p-retry';
+import { KnowledgeBaseEntry } from '../../../common';
+import { resourceNames } from '..';
+import { getElserModelStatus } from '../inference_endpoint';
+import { ObservabilityAIAssistantPluginStartDependencies } from '../../types';
+import { ObservabilityAIAssistantConfig } from '../../config';
+import { reIndexKnowledgeBase } from '../knowledge_base_service/reindex_knowledge_base';
+
+const TASK_ID = 'obs-ai-assistant:knowledge-base-migration-task-id';
+const TASK_TYPE = 'obs-ai-assistant:knowledge-base-migration';
+
+// This task will re-index all knowledge base entries without `semantic_text` field
+// to ensure the field is populated with the correct embeddings.
+// After the migration we will no longer need to use the `ml.tokens` field.
+export async function registerAndScheduleKbSemanticTextMigrationTask({
+ taskManager,
+ logger,
+ core,
+ config,
+}: {
+ taskManager: TaskManagerSetupContract;
+ logger: Logger;
+ core: CoreSetup;
+ config: ObservabilityAIAssistantConfig;
+}) {
+ const [coreStart, pluginsStart] = await core.getStartServices();
+
+ // register task
+ registerKbSemanticTextMigrationTask({ taskManager, logger, coreStart, config });
+
+ // schedule task
+ await scheduleKbSemanticTextMigrationTask({ taskManager: pluginsStart.taskManager, logger });
+}
+
+function registerKbSemanticTextMigrationTask({
+ taskManager,
+ logger,
+ coreStart,
+ config,
+}: {
+ taskManager: TaskManagerSetupContract;
+ logger: Logger;
+ coreStart: CoreStart;
+ config: ObservabilityAIAssistantConfig;
+}) {
+ try {
+ logger.debug(`Register task "${TASK_TYPE}"`);
+ taskManager.registerTaskDefinitions({
+ [TASK_TYPE]: {
+ title: 'Add support for semantic_text in Knowledge Base',
+ description: `This task will reindex the knowledge base and populate the semantic_text fields for all entries without it.`,
+ timeout: '1h',
+ maxAttempts: 5,
+ createTaskRunner() {
+ return {
+ async run() {
+ logger.debug(`Run task: "${TASK_TYPE}"`);
+ const esClient = coreStart.elasticsearch.client;
+
+ const hasKbIndex = await esClient.asInternalUser.indices.exists({
+ index: resourceNames.aliases.kb,
+ });
+
+ if (!hasKbIndex) {
+ logger.debug('Knowledge base index does not exist. Skipping migration.');
+ return;
+ }
+
+ if (config.disableKbSemanticTextMigration) {
+ logger.info(
+ 'Semantic text migration is disabled via config "xpack.observabilityAIAssistant.disableKbSemanticTextMigration=true". Skipping migration.'
+ );
+ return;
+ }
+
+ await reIndexKnowledgeBaseAndPopulateSemanticTextField({ esClient, logger, config });
+ },
+ };
+ },
+ },
+ });
+ } catch (error) {
+ logger.error(`Failed to register task "${TASK_TYPE}". Error: ${error}`);
+ }
+}
+
+export async function scheduleKbSemanticTextMigrationTask({
+ taskManager,
+ logger,
+ runSoon = false,
+}: {
+ taskManager: ObservabilityAIAssistantPluginStartDependencies['taskManager'];
+ logger: Logger;
+ runSoon?: boolean;
+}) {
+ logger.debug('Schedule migration task');
+ await taskManager.ensureScheduled({
+ id: TASK_ID,
+ taskType: TASK_TYPE,
+ scope: ['aiAssistant'],
+ params: {},
+ state: {},
+ });
+
+ if (runSoon) {
+ logger.debug('Run migration task soon');
+ await taskManager.runSoon(TASK_ID);
+ }
+}
+
+export async function reIndexKnowledgeBaseAndPopulateSemanticTextField({
+ esClient,
+ logger,
+ config,
+}: {
+ esClient: { asInternalUser: ElasticsearchClient };
+ logger: Logger;
+ config: ObservabilityAIAssistantConfig;
+}) {
+ logger.debug('Starting migration...');
+
+ try {
+ await reIndexKnowledgeBase({ logger, esClient });
+ await populateSemanticTextFieldRecursively({ esClient, logger, config });
+ } catch (e) {
+ logger.error(`Migration failed: ${e.message}`);
+ }
+
+ logger.debug('Migration succeeded');
+}
+
+async function populateSemanticTextFieldRecursively({
+ esClient,
+ logger,
+ config,
+}: {
+ esClient: { asInternalUser: ElasticsearchClient };
+ logger: Logger;
+ config: ObservabilityAIAssistantConfig;
+}) {
+ logger.debug('Populating semantic_text field for entries without it');
+
+ const response = await esClient.asInternalUser.search({
+ size: 100,
+ track_total_hits: true,
+ index: [resourceNames.aliases.kb],
+ query: {
+ bool: {
+ must_not: {
+ exists: {
+ field: 'semantic_text',
+ },
+ },
+ },
+ },
+ _source: {
+ excludes: ['ml.tokens'],
+ },
+ });
+
+ if (response.hits.hits.length === 0) {
+ logger.debug('No remaining entries to migrate');
+ return;
+ }
+
+ logger.debug(`Found ${response.hits.hits.length} entries to migrate`);
+
+ await waitForModel({ esClient, logger, config });
+
+ // Limit the number of concurrent requests to avoid overloading the cluster
+ const limiter = pLimit(10);
+ const promises = response.hits.hits.map((hit) => {
+ return limiter(() => {
+ if (!hit._source || !hit._id) {
+ return;
+ }
+
+ return esClient.asInternalUser.update({
+ refresh: 'wait_for',
+ index: resourceNames.aliases.kb,
+ id: hit._id,
+ body: {
+ doc: {
+ ...hit._source,
+ semantic_text: hit._source.text,
+ },
+ },
+ });
+ });
+ });
+
+ await Promise.all(promises);
+
+ logger.debug(`Populated ${promises.length} entries`);
+ await populateSemanticTextFieldRecursively({ esClient, logger, config });
+}
+
+async function waitForModel({
+ esClient,
+ logger,
+ config,
+}: {
+ esClient: { asInternalUser: ElasticsearchClient };
+ logger: Logger;
+ config: ObservabilityAIAssistantConfig;
+}) {
+ return pRetry(
+ async () => {
+ const { ready } = await getElserModelStatus({ esClient, logger, config });
+ if (!ready) {
+ logger.debug('Elser model is not yet ready. Retrying...');
+ throw new Error('Elser model is not yet ready');
+ }
+ },
+ { retries: 30, factor: 2, maxTimeout: 30_000 }
+ );
+}
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts
deleted file mode 100644
index b75074dc7ea54..0000000000000
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
-import pLimit from 'p-limit';
-import { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server';
-import type { CoreSetup, Logger } from '@kbn/core/server';
-import pRetry from 'p-retry';
-import { KnowledgeBaseEntry } from '../../../common';
-import { resourceNames } from '..';
-import { getElserModelStatus } from '../inference_endpoint';
-import { ObservabilityAIAssistantPluginStartDependencies } from '../../types';
-import { ObservabilityAIAssistantConfig } from '../../config';
-import { setupConversationAndKbIndexAssets } from '../setup_conversation_and_kb_index_assets';
-
-const TASK_ID = 'obs-ai-assistant:knowledge-base-migration-task-id';
-const TASK_TYPE = 'obs-ai-assistant:knowledge-base-migration';
-
-// This task will re-index all knowledge base entries without `semantic_text` field
-// to ensure the field is populated with the correct embeddings.
-// After the migration we will no longer need to use the `ml.tokens` field.
-export async function registerMigrateKnowledgeBaseEntriesTask({
- taskManager,
- logger,
- core,
- config,
-}: {
- taskManager: TaskManagerSetupContract;
- logger: Logger;
- core: CoreSetup;
- config: ObservabilityAIAssistantConfig;
-}) {
- const [coreStart, pluginsStart] = await core.getStartServices();
-
- try {
- logger.debug(`Register task "${TASK_TYPE}"`);
- taskManager.registerTaskDefinitions({
- [TASK_TYPE]: {
- title: 'Migrate AI Assistant Knowledge Base',
- description: `Migrates AI Assistant knowledge base entries`,
- timeout: '1h',
- maxAttempts: 5,
- createTaskRunner() {
- return {
- async run() {
- logger.debug(`Run task: "${TASK_TYPE}"`);
- const esClient = coreStart.elasticsearch.client;
-
- const hasKbIndex = await esClient.asInternalUser.indices.exists({
- index: resourceNames.aliases.kb,
- });
-
- if (!hasKbIndex) {
- logger.debug(
- 'Knowledge base index does not exist. Skipping semantic text migration.'
- );
- return;
- }
-
- // update fields and mappings
- await setupConversationAndKbIndexAssets({ logger, core });
-
- // run migration
- await runSemanticTextKnowledgeBaseMigration({ esClient, logger, config });
- },
- };
- },
- },
- });
- } catch (error) {
- logger.error(`Failed to register task "${TASK_TYPE}". Error: ${error}`);
- }
-
- try {
- logger.debug(`Scheduled task: "${TASK_TYPE}"`);
- await scheduleSemanticTextMigration(pluginsStart);
- } catch (error) {
- logger.error(`Failed to schedule task "${TASK_TYPE}". Error: ${error}`);
- }
-}
-
-export function scheduleSemanticTextMigration(
- pluginsStart: ObservabilityAIAssistantPluginStartDependencies
-) {
- return pluginsStart.taskManager.ensureScheduled({
- id: TASK_ID,
- taskType: TASK_TYPE,
- scope: ['aiAssistant'],
- params: {},
- state: {},
- });
-}
-
-export async function runSemanticTextKnowledgeBaseMigration({
- esClient,
- logger,
- config,
-}: {
- esClient: { asInternalUser: ElasticsearchClient };
- logger: Logger;
- config: ObservabilityAIAssistantConfig;
-}) {
- logger.debug('Knowledge base migration: Running migration');
-
- try {
- const response = await esClient.asInternalUser.search({
- size: 100,
- track_total_hits: true,
- index: [resourceNames.aliases.kb],
- query: {
- bool: {
- must_not: {
- exists: {
- field: 'semantic_text',
- },
- },
- },
- },
- _source: {
- excludes: ['ml.tokens'],
- },
- });
-
- if (response.hits.hits.length === 0) {
- logger.debug('Knowledge base migration: No remaining entries to migrate');
- return;
- }
-
- logger.debug(`Knowledge base migration: Found ${response.hits.hits.length} entries to migrate`);
-
- await waitForModel({ esClient, logger, config });
-
- // Limit the number of concurrent requests to avoid overloading the cluster
- const limiter = pLimit(10);
- const promises = response.hits.hits.map((hit) => {
- return limiter(() => {
- if (!hit._source || !hit._id) {
- return;
- }
-
- return esClient.asInternalUser.update({
- refresh: 'wait_for',
- index: resourceNames.aliases.kb,
- id: hit._id,
- body: {
- doc: {
- ...hit._source,
- semantic_text: hit._source.text,
- },
- },
- });
- });
- });
-
- await Promise.all(promises);
- logger.debug(`Knowledge base migration: Migrated ${promises.length} entries`);
- await runSemanticTextKnowledgeBaseMigration({ esClient, logger, config });
- } catch (e) {
- logger.error(`Knowledge base migration failed: ${e.message}`);
- }
-}
-
-async function waitForModel({
- esClient,
- logger,
- config,
-}: {
- esClient: { asInternalUser: ElasticsearchClient };
- logger: Logger;
- config: ObservabilityAIAssistantConfig;
-}) {
- return pRetry(
- async () => {
- const { ready } = await getElserModelStatus({ esClient, logger, config });
- if (!ready) {
- logger.debug('Elser model is not yet ready. Retrying...');
- throw new Error('Elser model is not yet ready');
- }
- },
- { retries: 30, factor: 2, maxTimeout: 30_000 }
- );
-}
diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/util/replace_system_message.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/util/replace_system_message.ts
deleted file mode 100644
index c8c3b251c53e5..0000000000000
--- a/x-pack/platform/plugins/shared/observability_ai_assistant/server/service/util/replace_system_message.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { Message, MessageRole } from '../../../common';
-
-export function replaceSystemMessage(systemMessage: string, messages: Message[]): Message[] {
- return [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: systemMessage,
- },
- },
- ...messages.filter((msg) => msg.message.role !== MessageRole.System),
- ];
-}
diff --git a/x-pack/platform/plugins/shared/osquery/package.json b/x-pack/platform/plugins/shared/osquery/package.json
index bccc1894467f1..6f3738ee94b0c 100644
--- a/x-pack/platform/plugins/shared/osquery/package.json
+++ b/x-pack/platform/plugins/shared/osquery/package.json
@@ -7,13 +7,13 @@
"scripts": {
"cypress:burn": "yarn cypress:run --env burn=2 --headed",
"cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2",
- "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config",
+ "cypress": "node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config",
"cypress:open": "yarn cypress open",
"cypress:run": "yarn cypress run",
- "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/serverless_cli_config",
+ "cypress:serverless": "node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/serverless_cli_config",
"cypress:serverless:open": "yarn cypress:serverless open",
"cypress:serverless:run": "yarn cypress:serverless run",
- "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/serverless_cypress_qa.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts",
+ "cypress:qa:serverless": "node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../../x-pack/platform/plugins/shared/osquery/cypress/serverless_cypress_qa.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts",
"cypress:qa:serverless:run": "yarn cypress:qa:serverless run",
"nyc": "../../../../../node_modules/.bin/nyc report --reporter=text-summary",
"junit:merge": "../../../../../node_modules/.bin/mochawesome-merge ../../../../../target/kibana-osquery/cypress/results/mochawesome*.json > ../../../../../target/kibana-osquery/cypress/results/output.json && ../../../../../node_modules/.bin/marge ../../../../../target/kibana-osquery/cypress/results/output.json --reportDir ../../../../../target/kibana-osquery/cypress/results && yarn junit:transform && mkdir -p ../../../../../target/junit && cp ../../../../../target/kibana-osquery/cypress/results/*.xml ../../../../../target/junit/",
@@ -21,4 +21,4 @@
"openapi:generate": "node scripts/openapi/generate",
"openapi:bundle": "node scripts/openapi/bundle"
}
-}
+}
\ No newline at end of file
diff --git a/x-pack/platform/plugins/shared/security/public/account_management/user_profile/user_profile.test.tsx b/x-pack/platform/plugins/shared/security/public/account_management/user_profile/user_profile.test.tsx
index af3a5dce4ead3..141bb04f4be6b 100644
--- a/x-pack/platform/plugins/shared/security/public/account_management/user_profile/user_profile.test.tsx
+++ b/x-pack/platform/plugins/shared/security/public/account_management/user_profile/user_profile.test.tsx
@@ -71,7 +71,7 @@ describe('useUserProfileForm', () => {
"avatarType": "initials",
"data": Object {
"avatar": Object {
- "color": "#D36086",
+ "color": "#61A2FF",
"imageUrl": "",
"initials": "fn",
},
diff --git a/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap
index f59b9c5a4c7ca..e1061a099af31 100644
--- a/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts"`;
+exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts"`;
-exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts"`;
+exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts"`;
diff --git a/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap
index cac755dbefa00..9d33edbcd8dd2 100644
--- a/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts
We hit an authentication error
Try logging in again, and if the problem persists, contact your system administrator.
"`;
+exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts
We hit an authentication error
Try logging in again, and if the problem persists, contact your system administrator.
"`;
-exports[`UnauthenticatedPage renders as expected with custom title 1`] = `"My Company NameMockedFonts
We hit an authentication error
Try logging in again, and if the problem persists, contact your system administrator.
"`;
+exports[`UnauthenticatedPage renders as expected with custom title 1`] = `"My Company NameMockedFonts
We hit an authentication error
Try logging in again, and if the problem persists, contact your system administrator.
"`;
diff --git a/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap
index 7d6b24e6ba2e7..69b47c49417eb 100644
--- a/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap
+++ b/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts
You do not have permission to access the requested page
Either go back to the previous page or log in as a different user.
"`;
+exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts
You do not have permission to access the requested page
Either go back to the previous page or log in as a different user.
"`;
-exports[`ResetSessionPage renders as expected with custom page title 1`] = `"My Company NameMockedFonts
You do not have permission to access the requested page
Either go back to the previous page or log in as a different user.
"`;
+exports[`ResetSessionPage renders as expected with custom page title 1`] = `"My Company NameMockedFonts
You do not have permission to access the requested page
Either go back to the previous page or log in as a different user.
"`;
diff --git a/x-pack/platform/plugins/shared/spaces/public/management/components/customize_space/customize_space.test.tsx b/x-pack/platform/plugins/shared/spaces/public/management/components/customize_space/customize_space.test.tsx
index bea3dbe7b39ca..7b91fdec32135 100644
--- a/x-pack/platform/plugins/shared/spaces/public/management/components/customize_space/customize_space.test.tsx
+++ b/x-pack/platform/plugins/shared/spaces/public/management/components/customize_space/customize_space.test.tsx
@@ -78,7 +78,7 @@ test('updates identifier, initials and color when name is changed', () => {
id: 'space-2',
name: 'Space 2',
initials: 'S2',
- color: '#9170B8',
+ color: '#BFDBFF',
});
});
diff --git a/x-pack/platform/plugins/shared/spaces/public/management/create_space/create_space_page.test.tsx b/x-pack/platform/plugins/shared/spaces/public/management/create_space/create_space_page.test.tsx
index 14413b0b2f47b..6e07b39c1591c 100644
--- a/x-pack/platform/plugins/shared/spaces/public/management/create_space/create_space_page.test.tsx
+++ b/x-pack/platform/plugins/shared/spaces/public/management/create_space/create_space_page.test.tsx
@@ -107,7 +107,7 @@ describe('ManageSpacePage', () => {
name: 'New Space Name',
description: 'some description',
initials: 'NS',
- color: '#AA6556',
+ color: '#EAAE01',
imageUrl: '',
disabledFeatures: [],
solution: 'oblt',
diff --git a/x-pack/platform/plugins/shared/spaces/public/management/edit_space/edit_space_general_tab.test.tsx b/x-pack/platform/plugins/shared/spaces/public/management/edit_space/edit_space_general_tab.test.tsx
index 353c64b835c0e..ac3e84f8d4c4c 100644
--- a/x-pack/platform/plugins/shared/spaces/public/management/edit_space/edit_space_general_tab.test.tsx
+++ b/x-pack/platform/plugins/shared/spaces/public/management/edit_space/edit_space_general_tab.test.tsx
@@ -205,7 +205,7 @@ describe('EditSpaceSettings', () => {
name: 'Updated Name Of Space',
initials: 'UN',
imageUrl: '',
- color: '#D6BF57',
+ color: '#FFC7DB',
});
});
@@ -284,7 +284,7 @@ describe('EditSpaceSettings', () => {
expect(updateSpaceSpy).toHaveBeenCalledWith({
...spaceToUpdate,
name: 'Updated Existing Space',
- color: '#D6BF57',
+ color: '#FFC7DB',
initials: 'UE',
imageUrl: '',
});
diff --git a/x-pack/platform/plugins/shared/spaces/public/space_avatar/space_avatar_internal.test.tsx b/x-pack/platform/plugins/shared/spaces/public/space_avatar/space_avatar_internal.test.tsx
index b42208c965a40..e7f5cda518b05 100644
--- a/x-pack/platform/plugins/shared/spaces/public/space_avatar/space_avatar_internal.test.tsx
+++ b/x-pack/platform/plugins/shared/spaces/public/space_avatar/space_avatar_internal.test.tsx
@@ -19,7 +19,7 @@ test('renders without crashing', () => {
const wrapper = shallow();
expect(wrapper).toMatchInlineSnapshot(`
{
const wrapper = shallow();
expect(wrapper).toMatchInlineSnapshot(`
setIsPopoverOpen(true), [setIsPopoverOpen]);
- const closePopover = useCallback(() => setIsPopoverOpen(false), [setIsPopoverOpen]);
+ const togglePopover = useCallback(() => {
+ setIsPopoverOpen((prev) => {
+ const newState = !prev;
+ if (!newState) focusTrapButtonRef.current?.blur();
+ return newState;
+ });
+ }, []);
+ // const openPopover = useCallback(() => setIsPopoverOpen(true), [setIsPopoverOpen]);
+ const closePopover = useCallback(() => {
+ setIsPopoverOpen(false);
+ focusTrapButtonRef.current?.blur();
+ }, [setIsPopoverOpen]);
const isSnoozedUntil = snoozeSettings?.isSnoozedUntil;
const muteAll = snoozeSettings?.muteAll ?? false;
const isSnoozedIndefinitely = muteAll;
@@ -209,13 +219,13 @@ export const RulesListNotifyBadge: React.FunctionComponent
{formattedSnoozeText}
);
- }, [isLoading, isDisabled, snoozeButtonAriaLabel, openPopover, formattedSnoozeText]);
+ }, [isLoading, isDisabled, snoozeButtonAriaLabel, togglePopover, formattedSnoozeText]);
const scheduledSnoozeButton = useMemo(() => {
return (
@@ -228,13 +238,13 @@ export const RulesListNotifyBadge: React.FunctionComponent
{formattedSnoozeText}
);
- }, [isLoading, isDisabled, snoozeButtonAriaLabel, openPopover, formattedSnoozeText]);
+ }, [isLoading, isDisabled, snoozeButtonAriaLabel, togglePopover, formattedSnoozeText]);
const unsnoozedButton = useMemo(() => {
// This show on hover is needed because we need style sheets to achieve the
@@ -251,11 +261,11 @@ export const RulesListNotifyBadge: React.FunctionComponent
);
- }, [showOnHover, isLoading, isDisabled, snoozeButtonAriaLabel, isPopoverOpen, openPopover]);
+ }, [showOnHover, isLoading, isDisabled, snoozeButtonAriaLabel, isPopoverOpen, togglePopover]);
const onApplyUnsnooze = useCallback(
async (scheduleIds?: string[]) => {
@@ -286,11 +296,11 @@ export const RulesListNotifyBadge: React.FunctionComponent
);
- }, [isLoading, isDisabled, snoozeButtonAriaLabel, openPopover]);
+ }, [isLoading, isDisabled, snoozeButtonAriaLabel, togglePopover]);
const button = useMemo(() => {
if (!isSnoozeValid) {
diff --git a/x-pack/solutions/observability/packages/alert_details/README.md b/x-pack/solutions/observability/packages/alert-details/README.md
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/README.md
rename to x-pack/solutions/observability/packages/alert-details/README.md
diff --git a/x-pack/solutions/observability/packages/alert_details/index.ts b/x-pack/solutions/observability/packages/alert-details/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/index.ts
rename to x-pack/solutions/observability/packages/alert-details/index.ts
diff --git a/x-pack/solutions/observability/packages/alert_details/jest.config.js b/x-pack/solutions/observability/packages/alert-details/jest.config.js
similarity index 96%
rename from x-pack/solutions/observability/packages/alert_details/jest.config.js
rename to x-pack/solutions/observability/packages/alert-details/jest.config.js
index b7c6f40e5bd51..ccdc72ec05af7 100644
--- a/x-pack/solutions/observability/packages/alert_details/jest.config.js
+++ b/x-pack/solutions/observability/packages/alert-details/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/alert_details'],
+ roots: ['/x-pack/solutions/observability/packages/alert-details'],
};
diff --git a/x-pack/solutions/observability/packages/alert_details/kibana.jsonc b/x-pack/solutions/observability/packages/alert-details/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/kibana.jsonc
rename to x-pack/solutions/observability/packages/alert-details/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/alert_details/package.json b/x-pack/solutions/observability/packages/alert-details/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/package.json
rename to x-pack/solutions/observability/packages/alert-details/package.json
diff --git a/x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx b/x-pack/solutions/observability/packages/alert-details/src/components/alert_active_time_range_annotation.tsx
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx
rename to x-pack/solutions/observability/packages/alert-details/src/components/alert_active_time_range_annotation.tsx
diff --git a/x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx b/x-pack/solutions/observability/packages/alert-details/src/components/alert_annotation.tsx
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx
rename to x-pack/solutions/observability/packages/alert-details/src/components/alert_annotation.tsx
diff --git a/x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx b/x-pack/solutions/observability/packages/alert-details/src/components/alert_threshold_annotation.tsx
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx
rename to x-pack/solutions/observability/packages/alert-details/src/components/alert_threshold_annotation.tsx
diff --git a/x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx b/x-pack/solutions/observability/packages/alert-details/src/components/alert_threshold_time_range_rect.tsx
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx
rename to x-pack/solutions/observability/packages/alert-details/src/components/alert_threshold_time_range_rect.tsx
diff --git a/x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.test.tsx b/x-pack/solutions/observability/packages/alert-details/src/hooks/use_alerts_history.test.tsx
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.test.tsx
rename to x-pack/solutions/observability/packages/alert-details/src/hooks/use_alerts_history.test.tsx
diff --git a/x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts b/x-pack/solutions/observability/packages/alert-details/src/hooks/use_alerts_history.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts
rename to x-pack/solutions/observability/packages/alert-details/src/hooks/use_alerts_history.ts
diff --git a/x-pack/solutions/observability/packages/alert_details/tsconfig.json b/x-pack/solutions/observability/packages/alert-details/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/alert_details/tsconfig.json
rename to x-pack/solutions/observability/packages/alert-details/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/README.md b/x-pack/solutions/observability/packages/alerting-test-data/README.md
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/README.md
rename to x-pack/solutions/observability/packages/alerting-test-data/README.md
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/index.ts b/x-pack/solutions/observability/packages/alerting-test-data/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/index.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/index.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/jest.config.js b/x-pack/solutions/observability/packages/alerting-test-data/jest.config.js
similarity index 95%
rename from x-pack/solutions/observability/packages/alerting_test_data/jest.config.js
rename to x-pack/solutions/observability/packages/alerting-test-data/jest.config.js
index 6a296e9d22c0d..02b19c9b924e2 100644
--- a/x-pack/solutions/observability/packages/alerting_test_data/jest.config.js
+++ b/x-pack/solutions/observability/packages/alerting-test-data/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/alerting_test_data'],
+ roots: ['/x-pack/solutions/observability/packages/alerting-test-data'],
};
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/kibana.jsonc b/x-pack/solutions/observability/packages/alerting-test-data/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/kibana.jsonc
rename to x-pack/solutions/observability/packages/alerting-test-data/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/package.json b/x-pack/solutions/observability/packages/alerting-test-data/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/package.json
rename to x-pack/solutions/observability/packages/alerting-test-data/package.json
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/constants.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/constants.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/constants.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/constants.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_apm_error_count_threshold_rule.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_apm_error_count_threshold_rule.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_apm_failed_transaction_rate_rule.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_apm_failed_transaction_rate_rule.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_custom_threshold_rule.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_custom_threshold_rule.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_data_view.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_data_view.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_index_connector.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_index_connector.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_index_connector.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_index_connector.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/create_rule.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/create_rule.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/get_kibana_url.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/get_kibana_url.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/get_kibana_url.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/get_kibana_url.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/run.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/run.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/run.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/run.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count_groupby.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count_groupby.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count_nodata.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_log_count_nodata.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg_groupby.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg_groupby.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg_nodata.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/custom_threshold_metric_avg_nodata.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/index.ts b/x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/index.ts
rename to x-pack/solutions/observability/packages/alerting-test-data/src/scenarios/index.ts
diff --git a/x-pack/solutions/observability/packages/alerting_test_data/tsconfig.json b/x-pack/solutions/observability/packages/alerting-test-data/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/alerting_test_data/tsconfig.json
rename to x-pack/solutions/observability/packages/alerting-test-data/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/README.md b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/README.md
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/README.md
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/README.md
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/index.ts b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/index.ts
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/index.ts
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/jest.config.js b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/jest.config.js
similarity index 92%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/jest.config.js
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/jest.config.js
index 6941925a188e2..422d4c195600d 100644
--- a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/jest.config.js
+++ b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/get_padded_alert_time_range_util'],
+ roots: ['/x-pack/solutions/observability/packages/get-padded-alert-time-range-util'],
};
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/kibana.jsonc b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/kibana.jsonc
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/package.json b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/package.json
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/package.json
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/src/get_padded_alert_time_range.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/src/get_padded_alert_time_range.test.ts
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/src/get_padded_alert_time_range.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/src/get_padded_alert_time_range.ts
diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/tsconfig.json b/x-pack/solutions/observability/packages/get-padded-alert-time-range-util/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/get_padded_alert_time_range_util/tsconfig.json
rename to x-pack/solutions/observability/packages/get-padded-alert-time-range-util/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/kbn-scout-oblt/src/playwright/page_objects/custom_logs.ts b/x-pack/solutions/observability/packages/kbn-scout-oblt/src/playwright/page_objects/custom_logs.ts
index 6001bf086fed3..825d8475ce64a 100644
--- a/x-pack/solutions/observability/packages/kbn-scout-oblt/src/playwright/page_objects/custom_logs.ts
+++ b/x-pack/solutions/observability/packages/kbn-scout-oblt/src/playwright/page_objects/custom_logs.ts
@@ -104,8 +104,7 @@ export class CustomLogsPage {
async clickAdvancedSettingsButton() {
return this.page.testSubj
.locator('obltOnboardingCustomLogsAdvancedSettings')
- .getByRole('button')
- .first()
+ .locator('button.euiAccordion__button')
.click();
}
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/jest.config.js b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/jest.config.js
similarity index 87%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/jest.config.js
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/jest.config.js
index 3620ef5a1c254..fda41606e56b1 100644
--- a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/jest.config.js
+++ b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/jest.config.js
@@ -9,7 +9,7 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../../../../../..',
roots: [
- '/x-pack/solutions/observability/packages/observability_ai/observability_ai_common',
- '/x-pack/solutions/observability/packages/observability_ai/observability_ai_server',
+ '/x-pack/solutions/observability/packages/observability-ai/observability-ai-common',
+ '/x-pack/solutions/observability/packages/observability-ai/observability-ai-server',
],
};
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/kibana.jsonc b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/kibana.jsonc
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/package.json b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/package.json
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/package.json
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/root_cause_analysis/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/root_cause_analysis/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/tool_names.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/root_cause_analysis/tool_names.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/tool_names.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/root_cause_analysis/tool_names.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/tsconfig.json b/x-pack/solutions/observability/packages/observability-ai/observability-ai-common/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_common/tsconfig.json
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-common/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.js b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/jest.config.js
similarity index 92%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.js
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/jest.config.js
index 8aa1c2d673222..fff212e040dcc 100644
--- a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.js
+++ b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/jest.config.js
@@ -9,6 +9,6 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../../../../../..',
roots: [
- '/x-pack/solutions/observability/packages/observability_ai/observability_ai_server',
+ '/x-pack/solutions/observability/packages/observability-ai/observability-ai-server',
],
};
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/kibana.jsonc b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/kibana.jsonc
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/package.json b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/package.json
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/package.json
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_end_rca_process_tool.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_end_rca_process_tool.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_end_rca_process_tool.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_end_rca_process_tool.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_investigate_entity_tool.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_investigate_entity_tool.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_investigate_entity_tool.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_investigate_entity_tool.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_observe_tool.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_observe_tool.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_observe_tool.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/call_observe_tool.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/empty_assistant_message.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/empty_assistant_message.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/empty_assistant_message.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/empty_assistant_message.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/prompts/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/prompts/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/prompts/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/prompts/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/run_root_cause_analysis.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/run_root_cause_analysis.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/run_root_cause_analysis.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/run_root_cause_analysis.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/analyze_log_patterns/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/analyze_log_patterns/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/analyze_log_patterns/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/analyze_log_patterns/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_entity/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/describe_entity/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_entity/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/describe_entity/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_log_patterns/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/describe_log_patterns/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_log_patterns/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/describe_log_patterns/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/generate_timeline/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/generate_timeline/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/generate_timeline/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/generate_timeline/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/prompts.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/prompts.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/prompts.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/prompts.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/types.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/types.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/types.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/investigate_entity/types.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/observe_investigation_results/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/observe_investigation_results/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/observe_investigation_results/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/observe_investigation_results/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_final_report/index.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/write_final_report/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_final_report/index.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tasks/write_final_report/index.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tools.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tools.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tools.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/tools.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/types.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/types.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/types.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/types.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/call_tools.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/call_tools.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/call_tools.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/call_tools.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/chunk_output_calls.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/chunk_output_calls.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/chunk_output_calls.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/chunk_output_calls.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/format_entity.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/format_entity.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/format_entity.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/format_entity.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/get_previously_investigated_entities.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/get_previously_investigated_entities.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/get_previously_investigated_entities.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/get_previously_investigated_entities.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/serialize_knowledge_base_entries.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/serialize_knowledge_base_entries.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/serialize_knowledge_base_entries.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/serialize_knowledge_base_entries.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/stringify_summaries.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/stringify_summaries.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/stringify_summaries.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/stringify_summaries.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/to_blockquote.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/to_blockquote.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/to_blockquote.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/to_blockquote.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts
diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/tsconfig.json b/x-pack/solutions/observability/packages/observability-ai/observability-ai-server/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/observability_ai/observability_ai_server/tsconfig.json
rename to x-pack/solutions/observability/packages/observability-ai/observability-ai-server/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/utils_browser/chart/utils.ts b/x-pack/solutions/observability/packages/utils-browser/chart/utils.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/chart/utils.ts
rename to x-pack/solutions/observability/packages/utils-browser/chart/utils.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/hooks/use_abort_controller.ts b/x-pack/solutions/observability/packages/utils-browser/hooks/use_abort_controller.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/hooks/use_abort_controller.ts
rename to x-pack/solutions/observability/packages/utils-browser/hooks/use_abort_controller.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/hooks/use_abortable_async.ts b/x-pack/solutions/observability/packages/utils-browser/hooks/use_abortable_async.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/hooks/use_abortable_async.ts
rename to x-pack/solutions/observability/packages/utils-browser/hooks/use_abortable_async.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/hooks/use_date_range.ts b/x-pack/solutions/observability/packages/utils-browser/hooks/use_date_range.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/hooks/use_date_range.ts
rename to x-pack/solutions/observability/packages/utils-browser/hooks/use_date_range.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/hooks/use_local_storage.ts b/x-pack/solutions/observability/packages/utils-browser/hooks/use_local_storage.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/hooks/use_local_storage.ts
rename to x-pack/solutions/observability/packages/utils-browser/hooks/use_local_storage.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/hooks/use_theme.ts b/x-pack/solutions/observability/packages/utils-browser/hooks/use_theme.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/hooks/use_theme.ts
rename to x-pack/solutions/observability/packages/utils-browser/hooks/use_theme.ts
diff --git a/x-pack/solutions/observability/packages/utils_browser/jest.config.js b/x-pack/solutions/observability/packages/utils-browser/jest.config.js
similarity index 96%
rename from x-pack/solutions/observability/packages/utils_browser/jest.config.js
rename to x-pack/solutions/observability/packages/utils-browser/jest.config.js
index 3fa1852414d8d..fcbf23a4d887f 100644
--- a/x-pack/solutions/observability/packages/utils_browser/jest.config.js
+++ b/x-pack/solutions/observability/packages/utils-browser/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/utils_browser'],
+ roots: ['/x-pack/solutions/observability/packages/utils-browser'],
};
diff --git a/x-pack/solutions/observability/packages/utils_browser/kibana.jsonc b/x-pack/solutions/observability/packages/utils-browser/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/kibana.jsonc
rename to x-pack/solutions/observability/packages/utils-browser/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/utils_browser/package.json b/x-pack/solutions/observability/packages/utils-browser/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/package.json
rename to x-pack/solutions/observability/packages/utils-browser/package.json
diff --git a/x-pack/solutions/observability/packages/utils_browser/tsconfig.json b/x-pack/solutions/observability/packages/utils-browser/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/tsconfig.json
rename to x-pack/solutions/observability/packages/utils-browser/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/utils_browser/utils/ui_settings/get_timezone.ts b/x-pack/solutions/observability/packages/utils-browser/utils/ui_settings/get_timezone.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_browser/utils/ui_settings/get_timezone.ts
rename to x-pack/solutions/observability/packages/utils-browser/utils/ui_settings/get_timezone.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/array/join_by_key.test.ts b/x-pack/solutions/observability/packages/utils-common/array/join_by_key.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/array/join_by_key.test.ts
rename to x-pack/solutions/observability/packages/utils-common/array/join_by_key.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/array/join_by_key.ts b/x-pack/solutions/observability/packages/utils-common/array/join_by_key.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/array/join_by_key.ts
rename to x-pack/solutions/observability/packages/utils-common/array/join_by_key.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/entities/get_entity_kuery.ts b/x-pack/solutions/observability/packages/utils-common/entities/get_entity_kuery.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/entities/get_entity_kuery.ts
rename to x-pack/solutions/observability/packages/utils-common/entities/get_entity_kuery.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/format_value_for_kql.ts b/x-pack/solutions/observability/packages/utils-common/es/format_value_for_kql.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/format_value_for_kql.ts
rename to x-pack/solutions/observability/packages/utils-common/es/format_value_for_kql.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/entity_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/entity_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/entity_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/entity_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/exclude_frozen_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/exclude_frozen_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/exclude_frozen_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/exclude_frozen_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/exclude_tiers_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/exclude_tiers_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/exclude_tiers_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/exclude_tiers_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/kql_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/kql_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/kql_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/kql_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/range_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/range_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/range_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/range_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/es/queries/term_query.ts b/x-pack/solutions/observability/packages/utils-common/es/queries/term_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/es/queries/term_query.ts
rename to x-pack/solutions/observability/packages/utils-common/es/queries/term_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/format/integer.ts b/x-pack/solutions/observability/packages/utils-common/format/integer.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/format/integer.ts
rename to x-pack/solutions/observability/packages/utils-common/format/integer.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/jest.config.js b/x-pack/solutions/observability/packages/utils-common/jest.config.js
similarity index 96%
rename from x-pack/solutions/observability/packages/utils_server/jest.config.js
rename to x-pack/solutions/observability/packages/utils-common/jest.config.js
index ed77899c0323a..4e6eb0b3c4a1b 100644
--- a/x-pack/solutions/observability/packages/utils_server/jest.config.js
+++ b/x-pack/solutions/observability/packages/utils-common/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/utils_server'],
+ roots: ['/x-pack/solutions/observability/packages/utils-common'],
};
diff --git a/x-pack/solutions/observability/packages/utils_common/kibana.jsonc b/x-pack/solutions/observability/packages/utils-common/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/kibana.jsonc
rename to x-pack/solutions/observability/packages/utils-common/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/log_analysis/document_analysis.ts b/x-pack/solutions/observability/packages/utils-common/llm/log_analysis/document_analysis.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/log_analysis/document_analysis.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/log_analysis/document_analysis.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/log_analysis/highlight_patterns_from_regex.ts b/x-pack/solutions/observability/packages/utils-common/llm/log_analysis/highlight_patterns_from_regex.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/log_analysis/highlight_patterns_from_regex.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/log_analysis/highlight_patterns_from_regex.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/log_analysis/merge_sample_documents_with_field_caps.ts b/x-pack/solutions/observability/packages/utils-common/llm/log_analysis/merge_sample_documents_with_field_caps.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/log_analysis/merge_sample_documents_with_field_caps.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/log_analysis/merge_sample_documents_with_field_caps.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/log_analysis/sort_and_truncate_analyzed_fields.ts b/x-pack/solutions/observability/packages/utils-common/llm/log_analysis/sort_and_truncate_analyzed_fields.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/log_analysis/sort_and_truncate_analyzed_fields.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/log_analysis/sort_and_truncate_analyzed_fields.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/short_id_table.test.ts b/x-pack/solutions/observability/packages/utils-common/llm/short_id_table.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/short_id_table.test.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/short_id_table.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/llm/short_id_table.ts b/x-pack/solutions/observability/packages/utils-common/llm/short_id_table.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/llm/short_id_table.ts
rename to x-pack/solutions/observability/packages/utils-common/llm/short_id_table.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/ml/p_value_to_label.ts b/x-pack/solutions/observability/packages/utils-common/ml/p_value_to_label.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/ml/p_value_to_label.ts
rename to x-pack/solutions/observability/packages/utils-common/ml/p_value_to_label.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/flatten_object.test.ts b/x-pack/solutions/observability/packages/utils-common/object/flatten_object.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/flatten_object.test.ts
rename to x-pack/solutions/observability/packages/utils-common/object/flatten_object.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/flatten_object.ts b/x-pack/solutions/observability/packages/utils-common/object/flatten_object.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/flatten_object.ts
rename to x-pack/solutions/observability/packages/utils-common/object/flatten_object.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/merge_plain_object.test.ts b/x-pack/solutions/observability/packages/utils-common/object/merge_plain_object.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/merge_plain_object.test.ts
rename to x-pack/solutions/observability/packages/utils-common/object/merge_plain_object.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/merge_plain_objects.ts b/x-pack/solutions/observability/packages/utils-common/object/merge_plain_objects.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/merge_plain_objects.ts
rename to x-pack/solutions/observability/packages/utils-common/object/merge_plain_objects.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/unflatten_object.test.ts b/x-pack/solutions/observability/packages/utils-common/object/unflatten_object.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/unflatten_object.test.ts
rename to x-pack/solutions/observability/packages/utils-common/object/unflatten_object.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/object/unflatten_object.ts b/x-pack/solutions/observability/packages/utils-common/object/unflatten_object.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/object/unflatten_object.ts
rename to x-pack/solutions/observability/packages/utils-common/object/unflatten_object.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/package.json b/x-pack/solutions/observability/packages/utils-common/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/package.json
rename to x-pack/solutions/observability/packages/utils-common/package.json
diff --git a/x-pack/solutions/observability/packages/utils_common/tsconfig.json b/x-pack/solutions/observability/packages/utils-common/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_common/tsconfig.json
rename to x-pack/solutions/observability/packages/utils-common/tsconfig.json
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/analyze_documents.ts b/x-pack/solutions/observability/packages/utils-server/entities/analyze_documents.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/analyze_documents.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/analyze_documents.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/get_data_streams_for_entity.ts b/x-pack/solutions/observability/packages/utils-server/entities/get_data_streams_for_entity.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/get_data_streams_for_entity.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/get_data_streams_for_entity.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/get_entities_by_fuzzy_search.ts b/x-pack/solutions/observability/packages/utils-server/entities/get_entities_by_fuzzy_search.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/get_entities_by_fuzzy_search.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/get_entities_by_fuzzy_search.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/get_log_patterns.ts b/x-pack/solutions/observability/packages/utils-server/entities/get_log_patterns.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/get_log_patterns.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/get_log_patterns.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/signals/get_alerts_for_entity.ts b/x-pack/solutions/observability/packages/utils-server/entities/signals/get_alerts_for_entity.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/signals/get_alerts_for_entity.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/signals/get_alerts_for_entity.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/signals/get_anomalies_for_entity.ts b/x-pack/solutions/observability/packages/utils-server/entities/signals/get_anomalies_for_entity.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/signals/get_anomalies_for_entity.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/signals/get_anomalies_for_entity.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/entities/signals/get_slos_for_entity.ts b/x-pack/solutions/observability/packages/utils-server/entities/signals/get_slos_for_entity.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/entities/signals/get_slos_for_entity.ts
rename to x-pack/solutions/observability/packages/utils-server/entities/signals/get_slos_for_entity.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/client/create_observability_es_client.ts b/x-pack/solutions/observability/packages/utils-server/es/client/create_observability_es_client.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/client/create_observability_es_client.ts
rename to x-pack/solutions/observability/packages/utils-server/es/client/create_observability_es_client.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/esql_result_to_plain_objects.test.ts b/x-pack/solutions/observability/packages/utils-server/es/esql_result_to_plain_objects.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/esql_result_to_plain_objects.test.ts
rename to x-pack/solutions/observability/packages/utils-server/es/esql_result_to_plain_objects.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/esql_result_to_plain_objects.ts b/x-pack/solutions/observability/packages/utils-server/es/esql_result_to_plain_objects.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/esql_result_to_plain_objects.ts
rename to x-pack/solutions/observability/packages/utils-server/es/esql_result_to_plain_objects.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/queries/exclude_frozen_query.ts b/x-pack/solutions/observability/packages/utils-server/es/queries/exclude_frozen_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/queries/exclude_frozen_query.ts
rename to x-pack/solutions/observability/packages/utils-server/es/queries/exclude_frozen_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/queries/kql_query.ts b/x-pack/solutions/observability/packages/utils-server/es/queries/kql_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/queries/kql_query.ts
rename to x-pack/solutions/observability/packages/utils-server/es/queries/kql_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/queries/range_query.ts b/x-pack/solutions/observability/packages/utils-server/es/queries/range_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/queries/range_query.ts
rename to x-pack/solutions/observability/packages/utils-server/es/queries/range_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/queries/term_query.ts b/x-pack/solutions/observability/packages/utils-server/es/queries/term_query.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/queries/term_query.ts
rename to x-pack/solutions/observability/packages/utils-server/es/queries/term_query.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/README.md b/x-pack/solutions/observability/packages/utils-server/es/storage/README.md
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/README.md
rename to x-pack/solutions/observability/packages/utils-server/es/storage/README.md
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/get_schema_version.ts b/x-pack/solutions/observability/packages/utils-server/es/storage/get_schema_version.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/get_schema_version.ts
rename to x-pack/solutions/observability/packages/utils-server/es/storage/get_schema_version.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/index.ts b/x-pack/solutions/observability/packages/utils-server/es/storage/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/index.ts
rename to x-pack/solutions/observability/packages/utils-server/es/storage/index.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/index_adapter/index.ts b/x-pack/solutions/observability/packages/utils-server/es/storage/index_adapter/index.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/index_adapter/index.ts
rename to x-pack/solutions/observability/packages/utils-server/es/storage/index_adapter/index.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/index_adapter/integration_tests/index.test.ts b/x-pack/solutions/observability/packages/utils-server/es/storage/index_adapter/integration_tests/index.test.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/index_adapter/integration_tests/index.test.ts
rename to x-pack/solutions/observability/packages/utils-server/es/storage/index_adapter/integration_tests/index.test.ts
diff --git a/x-pack/solutions/observability/packages/utils_server/es/storage/types.ts b/x-pack/solutions/observability/packages/utils-server/es/storage/types.ts
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/es/storage/types.ts
rename to x-pack/solutions/observability/packages/utils-server/es/storage/types.ts
diff --git a/x-pack/solutions/observability/packages/utils_common/jest.config.js b/x-pack/solutions/observability/packages/utils-server/jest.config.js
similarity index 96%
rename from x-pack/solutions/observability/packages/utils_common/jest.config.js
rename to x-pack/solutions/observability/packages/utils-server/jest.config.js
index ab3e800cf586b..cb655f4858eab 100644
--- a/x-pack/solutions/observability/packages/utils_common/jest.config.js
+++ b/x-pack/solutions/observability/packages/utils-server/jest.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/utils_common'],
+ roots: ['/x-pack/solutions/observability/packages/utils-server'],
};
diff --git a/x-pack/solutions/observability/packages/utils_server/jest.integration.config.js b/x-pack/solutions/observability/packages/utils-server/jest.integration.config.js
similarity index 96%
rename from x-pack/solutions/observability/packages/utils_server/jest.integration.config.js
rename to x-pack/solutions/observability/packages/utils-server/jest.integration.config.js
index 4cda010dac65c..bc0723cc66c2e 100644
--- a/x-pack/solutions/observability/packages/utils_server/jest.integration.config.js
+++ b/x-pack/solutions/observability/packages/utils-server/jest.integration.config.js
@@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test/jest_integration',
rootDir: '../../../../..',
- roots: ['/x-pack/solutions/observability/packages/utils_server'],
+ roots: ['/x-pack/solutions/observability/packages/utils-server'],
};
diff --git a/x-pack/solutions/observability/packages/utils_server/kibana.jsonc b/x-pack/solutions/observability/packages/utils-server/kibana.jsonc
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/kibana.jsonc
rename to x-pack/solutions/observability/packages/utils-server/kibana.jsonc
diff --git a/x-pack/solutions/observability/packages/utils_server/package.json b/x-pack/solutions/observability/packages/utils-server/package.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/package.json
rename to x-pack/solutions/observability/packages/utils-server/package.json
diff --git a/x-pack/solutions/observability/packages/utils_server/tsconfig.json b/x-pack/solutions/observability/packages/utils-server/tsconfig.json
similarity index 100%
rename from x-pack/solutions/observability/packages/utils_server/tsconfig.json
rename to x-pack/solutions/observability/packages/utils-server/tsconfig.json
diff --git a/x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json b/x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json
index 6b8749fc1e5be..9194f96e78e61 100644
--- a/x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json
+++ b/x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json
@@ -5,7 +5,7 @@
"private": true,
"license": "Elastic License 2.0",
"scripts": {
- "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../observability/plugins/apm/ftr_e2e/cypress.config.ts --ftr-config-file ../../../../../test/apm_cypress/cli_config",
+ "cypress": "node ../../../../security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../observability/plugins/apm/ftr_e2e/cypress.config.ts --ftr-config-file ../../../../../test/apm_cypress/cli_config",
"cypress:open": "yarn cypress open",
"cypress:run": "yarn cypress run",
"cypress:run:headed": "yarn cypress run --headed",
diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap b/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap
index 09b48cc47b302..c1fb5292bf04a 100644
--- a/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap
+++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap
@@ -32,7 +32,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = `
transform="translate(0 80)"
>
@@ -136,15 +136,15 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = `
>
@@ -168,15 +168,15 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = `
>
@@ -210,70 +210,70 @@ exports[`Timeline VerticalLinesContainer should render with data 1`] = `
transform="translate(0 100)"
>
{
});
describe('colorTransformer()', () => {
it('should just work', () => {
- expect(colorTransformer(Color.color0)).toBe('#54B399');
+ expect(colorTransformer(Color.color0)).toBe('#16C5C0');
});
});
});
diff --git a/x-pack/solutions/observability/plugins/infra/public/alerting/common/components/threshold.test.tsx b/x-pack/solutions/observability/plugins/infra/public/alerting/common/components/threshold.test.tsx
index 754665c18adf3..69c00d1cd44fa 100644
--- a/x-pack/solutions/observability/plugins/infra/public/alerting/common/components/threshold.test.tsx
+++ b/x-pack/solutions/observability/plugins/infra/public/alerting/common/components/threshold.test.tsx
@@ -65,7 +65,7 @@ describe('Threshold', () => {
expect((Metric as jest.Mock).mock.calls[0][0].data[0][0]).toMatchInlineSnapshot(`
Object {
- "color": "#f8e9e9",
+ "color": "#FFE8E5",
"extra":
Alert when >= 7%
diff --git a/x-pack/solutions/observability/plugins/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap b/x-pack/solutions/observability/plugins/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap
index 0df66d4c3dca3..6d019d22e786a 100644
--- a/x-pack/solutions/observability/plugins/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap
+++ b/x-pack/solutions/observability/plugins/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap
@@ -6,7 +6,7 @@ Array [
"additionalFilters": undefined,
"annotations": Array [
Object {
- "color": "#BD271E",
+ "color": "#C61E25",
"icon": "alert",
"id": "metric_threshold_alert_start_annotation",
"key": Object {
@@ -17,7 +17,7 @@ Array [
"type": "manual",
},
Object {
- "color": "rgba(189,39,30,0.2)",
+ "color": "rgba(198,30,37,0.2)",
"id": "metric_threshold_active_alert_range_annotation",
"key": Object {
"endTimestamp": "2024-06-13T07:00:33.381Z",
diff --git a/x-pack/solutions/observability/plugins/infra/public/components/logs_deprecation_callout.tsx b/x-pack/solutions/observability/plugins/infra/public/components/logs_deprecation_callout.tsx
index f9cd6efb211b9..46f997e4d5be5 100644
--- a/x-pack/solutions/observability/plugins/infra/public/components/logs_deprecation_callout.tsx
+++ b/x-pack/solutions/observability/plugins/infra/public/components/logs_deprecation_callout.tsx
@@ -22,14 +22,14 @@ const pageConfigurations = {
dismissalStorageKey: 'log_stream_deprecation_callout_dismissed',
message: i18n.translate('xpack.infra.logsDeprecationCallout.stream.exploreWithDiscover', {
defaultMessage:
- 'Logs Stream and Logs Explorer are set to be deprecated. Switch to Discover which now includes their functionality plus more features, better performance, and more intuitive navigation. ',
+ 'Logs Stream and Logs Explorer are set to be deprecated. Switch to Discover and enable the new Observability solution for an improved logs experience.',
}),
},
settings: {
dismissalStorageKey: 'log_settings_deprecation_callout_dismissed',
message: i18n.translate('xpack.infra.logsDeprecationCallout.settings.exploreWithDiscover', {
defaultMessage:
- 'These settings only apply to the legacy Logs Stream app. Switch to Discover for the same functionality plus more features, better performance, and more intuitive navigation.',
+ 'These settings only apply to the legacy Logs Stream app. Switch to Discover and enable the new Observability solution for an improved logs experience.',
}),
},
};
diff --git a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/__snapshots__/conditional_tooltip.test.tsx.snap b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/__snapshots__/conditional_tooltip.test.tsx.snap
index a9a64f08f6834..b7a4ba9e24133 100644
--- a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/__snapshots__/conditional_tooltip.test.tsx.snap
+++ b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/__snapshots__/conditional_tooltip.test.tsx.snap
@@ -6,7 +6,7 @@ exports[`ConditionalToolTip renders correctly 1`] = `
style="min-width: 220px;"
>
host-01
diff --git a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.test.ts b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.test.ts
index 55628d208873d..573bcce14cf92 100644
--- a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.test.ts
+++ b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.test.ts
@@ -27,7 +27,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -44,7 +44,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:bytes,id:test-id,label:'rate(host.network.egress.bytes)',line_width:2,metrics:!((field:host.network.egress.bytes,id:test-id,type:max),(field:test-id,id:test-id,type:derivative,unit:'1s'),(field:test-id,id:test-id,type:positive_only)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}}/s)),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:bytes,id:test-id,label:'rate(host.network.egress.bytes)',line_width:2,metrics:!((field:host.network.egress.bytes,id:test-id,type:max),(field:test-id,id:test-id,type:derivative,unit:'1s'),(field:test-id,id:test-id,type:positive_only)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}}/s)),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -57,7 +57,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-10m,to:now))',
type: 'metrics',
},
@@ -71,7 +71,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'my-beats-*',filter:(language:kuery,query:'system.network.name:lo* and host.name : \"example-01\"'),id:test-id,index_pattern:'my-beats-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'my-beats-*',filter:(language:kuery,query:'system.network.name:lo* and host.name : \"example-01\"'),id:test-id,index_pattern:'my-beats-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -85,7 +85,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -99,7 +99,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0.5,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0.5,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -117,7 +117,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0.5,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:stacked,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metricbeat-*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metricbeat-*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0.5,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:stacked,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
@@ -130,7 +130,7 @@ describe('createTSVBLink()', () => {
app: 'visualize',
hash: '/create',
search: {
- _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metric*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metric*',interval:auto,series:!((axis_position:right,chart_type:line,color:#54B399,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
+ _a: "(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_min:0,axis_position:left,axis_scale:normal,default_index_pattern:'metric*',filter:(language:kuery,query:'host.name : \"example-01\"'),id:test-id,index_pattern:'metric*',interval:auto,series:!((axis_position:right,chart_type:line,color:#16C5C0,fill:0,formatter:percent,id:test-id,label:'avg(system.cpu.user.pct)',line_width:2,metrics:!((field:system.cpu.user.pct,id:test-id,type:avg)),point_size:0,separate_axis:0,split_mode:everything,stacked:none,value_template:{{value}})),show_grid:1,show_legend:1,time_field:'@timestamp',type:timeseries),title:example-01,type:metrics))",
_g: '(refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))',
type: 'metrics',
},
diff --git a/x-pack/solutions/observability/plugins/inventory/scripts/test/e2e.js b/x-pack/solutions/observability/plugins/inventory/scripts/test/e2e.js
index 5c0d897cc671d..6bd8d7ccfd83f 100644
--- a/x-pack/solutions/observability/plugins/inventory/scripts/test/e2e.js
+++ b/x-pack/solutions/observability/plugins/inventory/scripts/test/e2e.js
@@ -73,7 +73,6 @@ function runTests() {
env: {
...process.env,
CYPRESS_CLI_ARGS: JSON.stringify(cypressCliArgs),
- NODE_OPTIONS: '--openssl-legacy-provider',
},
encoding: 'utf8',
stdio: 'inherit',
diff --git a/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap
index 79c58c84a1f30..d810b965b3bd5 100644
--- a/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap
+++ b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap
@@ -15,7 +15,7 @@ Array [
],
"annotations": Array [
Object {
- "color": "#BD271E",
+ "color": "#C61E25",
"icon": "alert",
"id": "custom_threshold_alert_start_annotation",
"key": Object {
diff --git a/x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts b/x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts
index 858b48f1e05e0..7578a12ef41a8 100644
--- a/x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts
+++ b/x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts
@@ -509,6 +509,10 @@ function createNavTree({ streamsAvailable }: { streamsAvailable?: boolean }) {
},
],
},
+ {
+ id: 'monitoring',
+ link: 'monitoring',
+ },
{
link: 'integrations',
},
diff --git a/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx
index d472449f2e9d1..39ae85f14f2cd 100644
--- a/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx
+++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx
@@ -15,13 +15,12 @@ import {
XYBrushEvent,
} from '@elastic/charts';
import { timeFormatter } from '@elastic/charts/dist/utils/data/formatters';
-import { EuiFlexGroup, EuiFlexItem, EuiToolTip, EuiIcon } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiToolTip, EuiIcon, useEuiTheme } from '@elastic/eui';
import numeral from '@elastic/numeral';
import { i18n } from '@kbn/i18n';
import moment from 'moment';
-import React, { useContext } from 'react';
+import React from 'react';
import { useHistory } from 'react-router-dom';
-import { ThemeContext } from 'styled-components';
import { useChartThemes, FETCH_STATUS, useFetcher } from '@kbn/observability-shared-plugin/public';
import { useDatePickerContext } from '../../../../../hooks/use_date_picker_context';
import { SectionContainer } from '../section_container';
@@ -54,7 +53,7 @@ function formatTpmStat(value?: number) {
}
export function APMSection({ bucketSize }: Props) {
- const theme = useContext(ThemeContext);
+ const { euiTheme } = useEuiTheme();
const chartThemes = useChartThemes();
const history = useHistory();
const { forceUpdate, hasDataMap } = useHasData();
@@ -92,8 +91,6 @@ export function APMSection({ bucketSize }: Props) {
const isLoading = status === FETCH_STATUS.LOADING;
- const transactionsColor = theme.eui.euiColorVis1;
-
return (
}
isLoading={isLoading}
- color={transactionsColor}
+ // color={transactionsColor}
/>
@@ -164,7 +161,7 @@ export function APMSection({ bucketSize }: Props) {
yScaleType={ScaleType.Linear}
xAccessor={'x'}
yAccessors={['y']}
- color={transactionsColor}
+ color={euiTheme.colors.vis.euiColorVis0}
/>
string;
- color: number;
+ color: string;
}
export function MetricWithSparkline({ id, formatter, value, timeseries, color }: Props) {
const { baseTheme, sparklineTheme } = useChartThemes();
- const colors = baseTheme.colors?.vizColors ?? [];
if (!value) {
return (
@@ -53,7 +52,7 @@ export function MetricWithSparkline({ id, formatter, value, timeseries, color }:
data={timeseries}
xAccessor={'timestamp'}
yAccessors={[id]}
- color={colors[color] || '#006BB4'}
+ color={color}
/>
diff --git a/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx
index 99d526a66facd..660048bcb7e70 100644
--- a/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx
+++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx
@@ -12,6 +12,7 @@ import {
EuiBasicTableColumn,
EuiLoadingChart,
EuiTableSortingType,
+ useEuiTheme,
} from '@elastic/eui';
import numeral from '@elastic/numeral';
import { i18n } from '@kbn/i18n';
@@ -32,11 +33,6 @@ import { formatDuration } from './lib/format_duration';
import { MetricWithSparkline } from './metric_with_sparkline';
import type { BucketSize } from '../../../helpers/calculate_bucket_size';
-const COLOR_ORANGE = 7;
-const COLOR_BLUE = 1;
-const COLOR_GREEN = 0;
-const COLOR_PURPLE = 3;
-
interface Props {
bucketSize: BucketSize;
}
@@ -51,6 +47,7 @@ const bytesPerSecondFormatter = (value: NumberOrNull) =>
value === null ? '' : numeral(value).format('0b') + '/s';
export function MetricsSection({ bucketSize }: Props) {
+ const { euiTheme } = useEuiTheme();
const { forceUpdate, hasDataMap } = useHasData();
const { relativeStart, relativeEnd, absoluteStart, absoluteEnd, lastUpdated } =
useDatePickerContext();
@@ -141,7 +138,7 @@ export function MetricsSection({ bucketSize }: Props) {
value={value}
formatter={percentFormatter}
timeseries={record.timeseries}
- color={COLOR_ORANGE}
+ color={euiTheme.colors.vis.euiColorVis0}
/>
),
},
@@ -157,7 +154,7 @@ export function MetricsSection({ bucketSize }: Props) {
value={value}
formatter={numberFormatter}
timeseries={record.timeseries}
- color={COLOR_BLUE}
+ color={euiTheme.colors.vis.euiColorVis1}
/>
),
},
@@ -171,7 +168,7 @@ export function MetricsSection({ bucketSize }: Props) {
value={value}
formatter={bytesPerSecondFormatter}
timeseries={record.timeseries}
- color={COLOR_GREEN}
+ color={euiTheme.colors.vis.euiColorVis2}
/>
),
},
@@ -185,7 +182,7 @@ export function MetricsSection({ bucketSize }: Props) {
value={value}
formatter={bytesPerSecondFormatter}
timeseries={record.timeseries}
- color={COLOR_PURPLE}
+ color={euiTheme.colors.vis.euiColorVis3}
/>
),
},
diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts
index 7b078d4cb5fc9..b10c583a5bcdf 100644
--- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts
+++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts
@@ -73,7 +73,7 @@ type CompleteFunction = (params: CompleteFunctionParams) => Promise<{
}>;
export interface ChatClient {
- chat: (message: StringOrMessageList) => Promise;
+ chat: (message: StringOrMessageList, system: string) => Promise;
complete: CompleteFunction;
evaluate: (
{}: { conversationId?: string; messages: InnerMessage[]; errors: ChatCompletionErrorEvent[] },
@@ -349,11 +349,13 @@ export class KibanaClient {
async function chat(
name: string,
{
+ systemMessage,
messages,
functions,
functionCall,
connectorIdOverride,
}: {
+ systemMessage: string;
messages: Message[];
functions: FunctionDefinition[];
functionCall?: string;
@@ -367,6 +369,7 @@ export class KibanaClient {
const params: ObservabilityAIAssistantAPIClientRequestParamsOf<'POST /internal/observability_ai_assistant/chat'>['params']['body'] =
{
name,
+ systemMessage,
messages,
connectorId: connectorIdOverride || connectorId,
functions: functions.map((fn) => pick(fn, 'name', 'description', 'parameters')),
@@ -403,14 +406,14 @@ export class KibanaClient {
const results: EvaluationResult[] = [];
return {
- chat: async (message) => {
+ chat: async (message, systemMessage) => {
const messages = [
...this.getMessages(message).map((msg) => ({
message: msg,
'@timestamp': new Date().toISOString(),
})),
];
- return chat('chat', { messages, functions: [] });
+ return chat('chat', { systemMessage, messages, functions: [] });
},
complete: async ({
messages: messagesArg,
@@ -515,20 +518,14 @@ export class KibanaClient {
evaluate: async ({ messages, conversationId, errors }, criteria) => {
const message = await chat('evaluate', {
connectorIdOverride: evaluationConnectorId,
- messages: [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: `You are a critical assistant for evaluating conversations with the Elastic Observability AI Assistant,
+ systemMessage: `You are a critical assistant for evaluating conversations with the Elastic Observability AI Assistant,
which helps our users make sense of their Observability data.
Your goal is to verify whether a conversation between the user and the assistant matches the given criteria.
For each criterion, calculate a score. Explain your score, by describing what the assistant did right, and describing and quoting what the
assistant did wrong, where it could improve, and what the root cause was in case of a failure.`,
- },
- },
+ messages: [
{
'@timestamp': new Date().toString(),
message: {
diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts
index e2c0f97d14a0d..c2e5456bd9511 100644
--- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts
+++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts
@@ -21,13 +21,6 @@ import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public';
import { AlertDetailsContextualInsightsService } from '@kbn/observability-plugin/server/services';
const buildConversation = (contentMessage: string) => [
- {
- '@timestamp': expect.any(String),
- message: {
- role: MessageRole.System,
- content: '',
- },
- },
{
'@timestamp': expect.any(String),
message: {
diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts
index 207e4e9488354..5a11a5b9bfb97 100644
--- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts
+++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts
@@ -34,7 +34,6 @@ import {
import { concatenateChatCompletionChunks } from '@kbn/observability-ai-assistant-plugin/common/utils/concatenate_chat_completion_chunks';
import { CompatibleJSONSchema } from '@kbn/observability-ai-assistant-plugin/common/functions/types';
import { AlertDetailsContextualInsightsService } from '@kbn/observability-plugin/server/services';
-import { getSystemMessageFromInstructions } from '@kbn/observability-ai-assistant-plugin/server/service/util/get_system_message_from_instructions';
import { AdHocInstruction } from '@kbn/observability-ai-assistant-plugin/common/types';
import { EXECUTE_CONNECTOR_FUNCTION_NAME } from '@kbn/observability-ai-assistant-plugin/server/functions/execute_connector';
import { ObservabilityAIAssistantClient } from '@kbn/observability-ai-assistant-plugin/server';
@@ -315,18 +314,6 @@ If available, include the link of the conversation at the end of your answer.`
kibanaPublicUrl: (await resources.plugins.core.start()).http.basePath.publicBaseUrl,
instructions: [backgroundInstruction],
messages: [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: getSystemMessageFromInstructions({
- availableFunctionNames: functionClient.getFunctions().map((fn) => fn.definition.name),
- applicationInstructions: functionClient.getInstructions(),
- userInstructions: [],
- adHocInstructions: functionClient.getAdhocInstructions(),
- }),
- },
- },
{
'@timestamp': new Date().toISOString(),
message: {
diff --git a/x-pack/solutions/observability/plugins/observability_logs_explorer/common/translations.ts b/x-pack/solutions/observability/plugins/observability_logs_explorer/common/translations.ts
index 380bc3c3c5a26..bbfa477585780 100644
--- a/x-pack/solutions/observability/plugins/observability_logs_explorer/common/translations.ts
+++ b/x-pack/solutions/observability/plugins/observability_logs_explorer/common/translations.ts
@@ -33,7 +33,7 @@ export const deprecationBadgeDescription = i18n.translate(
'xpack.observabilityLogsExplorer.deprecationBadgeDescription',
{
defaultMessage:
- 'Logs Stream and Logs Explorer are set to be deprecated. Switch to Discover which now includes their functionality plus more features and better performance.',
+ 'Logs Stream and Logs Explorer are set to be deprecated. Switch to Discover and enable the new Observability solution for an improved logs experience.',
}
);
diff --git a/x-pack/solutions/observability/plugins/observability_onboarding/scripts/test/e2e.js b/x-pack/solutions/observability/plugins/observability_onboarding/scripts/test/e2e.js
index fd2da7b56fb68..e5c7901bb869e 100644
--- a/x-pack/solutions/observability/plugins/observability_onboarding/scripts/test/e2e.js
+++ b/x-pack/solutions/observability/plugins/observability_onboarding/scripts/test/e2e.js
@@ -80,7 +80,6 @@ function runTests() {
env: {
...process.env,
CYPRESS_CLI_ARGS: JSON.stringify(cypressCliArgs),
- NODE_OPTIONS: '--openssl-legacy-provider',
},
encoding: 'utf8',
stdio: 'inherit',
diff --git a/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/add_custom_integration.spec.ts b/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/add_custom_integration.spec.ts
index ad22d72cbe34b..e04abdec5e5cf 100644
--- a/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/add_custom_integration.spec.ts
+++ b/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/add_custom_integration.spec.ts
@@ -56,7 +56,7 @@ test.describe(
await customLogs.selectPlatform('windows');
await expect(customLogs.autoDownloadConfigurationToggle).toBeDisabled();
await expect(customLogs.windowsInstallElasticAgentDocLink).toBeVisible();
- await expect(customLogs.installCodeSnippet).not.toBeVisible();
+ await expect(customLogs.installCodeSnippet).toBeHidden();
await expect(
customLogs.configureElasticAgentStep.getByText('Step 2 is disabled')
).toBeVisible();
diff --git a/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/configuration.spec.ts b/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/configuration.spec.ts
index c3cd104b461a8..d3bbff71d7eca 100644
--- a/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/configuration.spec.ts
+++ b/x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/parallel_tests/custom_logs/configuration.spec.ts
@@ -47,7 +47,7 @@ test.describe(
test(`should allow updating Advanced Settings`, async ({ pageObjects: { customLogs } }) => {
await customLogs.getLogFilePathInputField(0).fill(logsFilePath);
- await expect(customLogs.advancedSettingsContent).not.toBeVisible();
+ await expect(customLogs.advancedSettingsContent).toBeHidden();
await customLogs.clickAdvancedSettingsButton();
await expect(
customLogs.advancedSettingsContent,
@@ -63,13 +63,13 @@ test.describe(
await customLogs.namespaceInput.fill('default');
await expect(customLogs.customConfigInput).toHaveValue('');
- await expect(customLogs.continueButton).not.toBeDisabled();
+ await expect(customLogs.continueButton).toBeEnabled();
await customLogs.clickAdvancedSettingsButton();
await expect(
customLogs.advancedSettingsContent,
'Advanced Settings should be closed'
- ).not.toBeVisible();
+ ).toBeHidden();
});
test('should validate Integration Name field', async ({
diff --git a/x-pack/solutions/observability/plugins/profiling/common/topn.test.ts b/x-pack/solutions/observability/plugins/profiling/common/topn.test.ts
index 036b298d9e794..3cc83f792f235 100644
--- a/x-pack/solutions/observability/plugins/profiling/common/topn.test.ts
+++ b/x-pack/solutions/observability/plugins/profiling/common/topn.test.ts
@@ -10,16 +10,16 @@ import { getCategoryColor } from './topn';
describe('topn', () => {
describe('getCategoryColor', () => {
const categories = [
- { category: 'elasticsearch', expectedColor: '#D6BF57' },
- { category: 'metricbeat', expectedColor: '#B9A888' },
- { category: 'auditbeat', expectedColor: '#E7664C' },
- { category: 'dockerd', expectedColor: '#B9A888' },
- { category: 'Other', expectedColor: '#CA8EAE' },
- { category: 'node', expectedColor: '#D36086' },
- { category: 'filebeat', expectedColor: '#54B399' },
- { category: 'containerd', expectedColor: '#DA8B45' },
- { category: 'C2 CompilerThre', expectedColor: '#6092C0' },
- { category: '[metrics]>worke', expectedColor: '#D6BF57' },
+ { category: 'elasticsearch', expectedColor: '#FFC7DB' },
+ { category: 'metricbeat', expectedColor: '#F6726A' },
+ { category: 'auditbeat', expectedColor: '#FCD883' },
+ { category: 'dockerd', expectedColor: '#F6726A' },
+ { category: 'Other', expectedColor: '#EE72A6' },
+ { category: 'node', expectedColor: '#61A2FF' },
+ { category: 'filebeat', expectedColor: '#16C5C0' },
+ { category: 'containerd', expectedColor: '#FFC9C2' },
+ { category: 'C2 CompilerThre', expectedColor: '#A6EDEA' },
+ { category: '[metrics]>worke', expectedColor: '#FFC7DB' },
];
const colors = euiPaletteColorBlind({
rotations: Math.ceil(categories.length / 10),
diff --git a/x-pack/solutions/observability/plugins/profiling/e2e/package.json b/x-pack/solutions/observability/plugins/profiling/e2e/package.json
index 2bc70d1057d20..65461757086e5 100644
--- a/x-pack/solutions/observability/plugins/profiling/e2e/package.json
+++ b/x-pack/solutions/observability/plugins/profiling/e2e/package.json
@@ -5,7 +5,7 @@
"private": true,
"license": "Elastic License 2.0",
"scripts": {
- "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../observability/plugins/profiling/e2e/cypress.config.ts --ftr-config-file ../../../../../test/profiling_cypress/cli_config",
+ "cypress": "node ../../../../security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../observability/plugins/profiling/e2e/cypress.config.ts --ftr-config-file ../../../../../test/profiling_cypress/cli_config",
"cypress:open": "yarn cypress open",
"cypress:run": "yarn cypress run",
"cypress:run:headed": "yarn cypress run --headed",
diff --git a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx
index 1b4a49bc81894..21b25ecc1cc6a 100644
--- a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx
+++ b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx
@@ -26,10 +26,8 @@ import { useFetcher } from '@kbn/observability-shared-plugin/public';
import { GetSLOResponse } from '@kbn/slo-schema';
import React, { useState } from 'react';
import { useFormContext } from 'react-hook-form';
-import { enableInspectEsQueries } from '@kbn/observability-plugin/common';
import { useKibana } from '../../../../../hooks/use_kibana';
import { useFetchSloInspect } from '../../../../../hooks/use_fetch_slo_inspect';
-import { usePluginContext } from '../../../../../hooks/use_plugin_context';
import { transformCreateSLOFormToCreateSLOInput } from '../../../helpers/process_slo_form_values';
import { CreateSLOForm } from '../../../types';
import { CodeBlockAccordion } from './code_block_accordion';
@@ -41,18 +39,7 @@ interface Props {
disabled: boolean;
}
-export function SLOInspectWrapper({ slo, disabled }: Props) {
- const {
- services: { uiSettings },
- } = useKibana();
-
- const { isDev } = usePluginContext();
- const isInspectorEnabled = uiSettings?.get(enableInspectEsQueries);
-
- return isDev || isInspectorEnabled ? : null;
-}
-
-function SLOInspect({ slo, disabled }: Props) {
+export function SLOInspect({ slo, disabled }: Props) {
const { share, http } = useKibana().services;
const { trigger, getValues } = useFormContext();
diff --git a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx
index ab0c7ff235fbf..ee307b9360d63 100644
--- a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx
+++ b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx
@@ -25,7 +25,7 @@ import {
} from '../helpers/process_slo_form_values';
import { CreateSLOForm } from '../types';
import { EquivalentApiRequest } from './common/equivalent_api_request';
-import { SLOInspectWrapper } from './common/slo_inspect/slo_inspect';
+import { SLOInspect } from './common/slo_inspect/slo_inspect';
export interface Props {
slo?: GetSLOResponse;
@@ -133,7 +133,7 @@ export function SloEditFormFooter({ slo, onSave }: Props) {
/>
-
diff --git a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx
index 00c4cbb471ee8..bae113ec59fe0 100644
--- a/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx
+++ b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx
@@ -9,7 +9,7 @@ import { ILicense } from '@kbn/licensing-plugin/common/types';
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock';
import { useFetchDataViews } from '@kbn/observability-plugin/public';
-import { HeaderMenuPortal } from '@kbn/observability-shared-plugin/public';
+import { HeaderMenuPortal, useFetcher } from '@kbn/observability-shared-plugin/public';
import { cleanup, fireEvent, waitFor } from '@testing-library/react';
import { createBrowserHistory } from 'history';
import React from 'react';
@@ -30,6 +30,7 @@ import { kibanaStartMock } from '../../utils/kibana_react.mock';
import { render } from '../../utils/test_helper';
import { SLO_EDIT_FORM_DEFAULT_VALUES } from './constants';
import { SloEditPage } from './slo_edit';
+import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
@@ -63,6 +64,7 @@ const useUpdateSloMock = useUpdateSlo as jest.Mock;
const useCreateRuleMock = useCreateRule as jest.Mock;
const useFetchApmSuggestionsMock = useFetchApmSuggestions as jest.Mock;
const usePermissionsMock = usePermissions as jest.Mock;
+const useFetcherMock = useFetcher as jest.Mock;
const HeaderMenuPortalMock = HeaderMenuPortal as jest.Mock;
HeaderMenuPortalMock.mockReturnValue(Portal node
);
@@ -144,6 +146,7 @@ const mockKibana = (license: ILicense | null = licenseMock) => {
licensing: {
license$: new BehaviorSubject(license),
},
+ share: sharePluginMock.createStartContract(),
},
});
};
@@ -221,6 +224,7 @@ describe('SLO Edit Page', () => {
},
});
licenseMock.hasAtLeast.mockReturnValue(true);
+ useFetcherMock.mockReturnValue({ data: undefined, isLoading: false });
});
afterEach(cleanup);
diff --git a/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx b/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx
index 723d2fc68bee1..d1b20cd5e7171 100644
--- a/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx
+++ b/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx
@@ -16,6 +16,7 @@ import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render as testLibRender } from '@testing-library/react';
import React from 'react';
+import { i18n } from '@kbn/i18n';
import type { SLORouteRepository } from '../../server/routes/get_slo_server_route_repository';
import { PluginContext } from '../context/plugin_context';
@@ -54,7 +55,13 @@ export const render = (component: React.ReactNode) => {
createExploratoryViewUrl: jest.fn(),
getAppDataView: jest.fn(),
- ExploratoryViewEmbeddable: () => Embeddable exploratory view
,
+ ExploratoryViewEmbeddable: () => (
+
+ {i18n.translate('xpack.slo.render.div.embeddableExploratoryViewLabel', {
+ defaultMessage: 'Embeddable exploratory view',
+ })}
+
+ ),
},
}}
>
diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts
index 7313d21dd3ffb..6492f518131c7 100644
--- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts
+++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts
@@ -218,21 +218,21 @@ describe('getConnectingTime', () => {
describe('Palettes', () => {
it('A colour palette comprising timing and mime type colours is correctly generated', () => {
expect(colourPalette).toEqual({
- blocked: '#b0c9e0',
- connect: '#c8b8dc',
- dns: '#aad9cc',
- font: '#d36086',
- html: '#6092c0',
- image: '#ca8eae',
- media: '#d6bf57',
- other: '#b9a888',
- receive: '#ebdfab',
- script: '#da8b45',
- send: '#f3b3a6',
- ssl: '#e5c7d7',
- stylesheet: '#9170b8',
- wait: '#e7664c',
- xhr: '#54b399',
+ blocked: '#d3f6f5',
+ connect: '#dfedff',
+ dns: '#8be2e0',
+ font: '#61a2ff',
+ html: '#a6edea',
+ image: '#ee72a6',
+ media: '#ffc7db',
+ other: '#f6726a',
+ receive: '#ffe3ed',
+ script: '#ffc9c2',
+ send: '#feecc1',
+ ssl: '#f7b9d3',
+ stylesheet: '#bfdbff',
+ wait: '#fcd883',
+ xhr: '#16c5c0',
});
});
});
@@ -250,7 +250,7 @@ describe('getSeriesAndDomain', () => {
Array [
Object {
"config": Object {
- "colour": "#b0c9e0",
+ "colour": "#d3f6f5",
"id": 0,
"isHighlighted": true,
},
@@ -260,7 +260,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#aad9cc",
+ "colour": "#8be2e0",
"id": 0,
"isHighlighted": true,
},
@@ -270,7 +270,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#c8b8dc",
+ "colour": "#dfedff",
"id": 0,
"isHighlighted": true,
},
@@ -280,7 +280,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#e5c7d7",
+ "colour": "#f7b9d3",
"id": 0,
"isHighlighted": true,
},
@@ -290,7 +290,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#f3b3a6",
+ "colour": "#feecc1",
"id": 0,
"isHighlighted": true,
},
@@ -300,7 +300,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#e7664c",
+ "colour": "#fcd883",
"id": 0,
"isHighlighted": true,
},
@@ -310,7 +310,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#9170b8",
+ "colour": "#bfdbff",
"id": 0,
"isHighlighted": true,
},
@@ -320,7 +320,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#b0c9e0",
+ "colour": "#d3f6f5",
"id": 1,
"isHighlighted": true,
},
@@ -330,7 +330,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#f3b3a6",
+ "colour": "#feecc1",
"id": 1,
"isHighlighted": true,
},
@@ -340,7 +340,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#e7664c",
+ "colour": "#fcd883",
"id": 1,
"isHighlighted": true,
},
@@ -350,7 +350,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#da8b45",
+ "colour": "#ffc9c2",
"id": 1,
"isHighlighted": true,
},
@@ -368,7 +368,7 @@ describe('getSeriesAndDomain', () => {
Array [
Object {
"config": Object {
- "colour": "#b0c9e0",
+ "colour": "#d3f6f5",
"id": 0,
"isHighlighted": true,
},
@@ -378,7 +378,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#aad9cc",
+ "colour": "#8be2e0",
"id": 0,
"isHighlighted": true,
},
@@ -388,7 +388,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#c8b8dc",
+ "colour": "#dfedff",
"id": 0,
"isHighlighted": true,
},
@@ -398,7 +398,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#e5c7d7",
+ "colour": "#f7b9d3",
"id": 0,
"isHighlighted": true,
},
@@ -408,7 +408,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#f3b3a6",
+ "colour": "#feecc1",
"id": 0,
"isHighlighted": true,
},
@@ -418,7 +418,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#e7664c",
+ "colour": "#fcd883",
"id": 0,
"isHighlighted": true,
},
@@ -428,7 +428,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#9170b8",
+ "colour": "#bfdbff",
"id": 0,
"isHighlighted": true,
},
@@ -438,7 +438,7 @@ describe('getSeriesAndDomain', () => {
},
Object {
"config": Object {
- "colour": "#da8b45",
+ "colour": "#ffc9c2",
"isHighlighted": true,
},
"x": 1,
diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts
index 3fdca50592ddd..6cb4a4cbe71cb 100644
--- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts
+++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts
@@ -24,9 +24,13 @@ export interface FetchJourneyStepsParams {
}
export async function fetchScreenshotBlockSet(params: string[]): Promise {
- return apiService.post(SYNTHETICS_API_URLS.JOURNEY_SCREENSHOT_BLOCKS, {
- hashes: params,
- });
+ const response = await apiService.post<{ result: ScreenshotBlockDoc[] }>(
+ SYNTHETICS_API_URLS.JOURNEY_SCREENSHOT_BLOCKS,
+ {
+ hashes: params,
+ }
+ );
+ return response.result;
}
export async function fetchBrowserJourney(
diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts
index e155e2f320584..292242a6e6ab2 100644
--- a/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts
+++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts
@@ -6,13 +6,9 @@
*/
import { schema } from '@kbn/config-schema';
-import { IKibanaResponse } from '@kbn/core-http-server';
-import { isRight } from 'fp-ts/Either';
-import * as t from 'io-ts';
import { getJourneyScreenshotBlocks } from '../../queries/get_journey_screenshot_blocks';
-import { ScreenshotBlockDoc } from '../../../common/runtime_types';
import { SYNTHETICS_API_URLS } from '../../../common/constants';
-import { RouteContext, SyntheticsRestApiRouteFactory } from '../types';
+import { SyntheticsRestApiRouteFactory } from '../types';
export const createJourneyScreenshotBlocksRoute: SyntheticsRestApiRouteFactory = () => ({
method: 'POST',
@@ -23,34 +19,16 @@ export const createJourneyScreenshotBlocksRoute: SyntheticsRestApiRouteFactory =
}),
},
writeAccess: false,
- handler: (routeProps) => {
- return journeyScreenshotBlocksHandler(routeProps);
- },
-});
-
-export const journeyScreenshotBlocksHandler = async ({
- response,
- request,
- syntheticsEsClient,
-}: RouteContext): Promise> => {
- const { hashes: blockIds } = request.body;
-
- if (!isStringArray(blockIds)) return response.badRequest();
+ handler: async ({ request, syntheticsEsClient }) => {
+ const { hashes: blockIds } = request.body;
- const result = await getJourneyScreenshotBlocks({
- blockIds,
- syntheticsEsClient,
- });
+ const result = await getJourneyScreenshotBlocks({
+ blockIds,
+ syntheticsEsClient,
+ });
- if (result.length === 0) {
- return response.notFound();
- }
-
- return response.ok({
- body: result,
- });
-};
-
-function isStringArray(data: unknown): data is string[] {
- return isRight(t.array(t.string).decode(data));
-}
+ return {
+ result,
+ };
+ },
+});
diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap
index a8f1a6bcfc335..d65adda95d21e 100644
--- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap
+++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap
@@ -697,7 +697,7 @@ exports[`DonutChart component renders a donut chart 1`] = `
class="euiFlexItem emotion-euiFlexItem-growZero"
>