Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions x-pack/plugins/enterprise_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,28 +237,28 @@ export class EnterpriseSearchPlugin implements Plugin {
* Register logs source configuration, used by LogStream components
* @see https://github.com/elastic/kibana/blob/main/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#with-a-source-configuration
*/
infra.defineInternalSourceConfiguration(ENTERPRISE_SEARCH_RELEVANCE_LOGS_SOURCE_ID, {
name: 'Enterprise Search Search Relevance Logs',
infra.logViews.defineInternalLogView(ENTERPRISE_SEARCH_RELEVANCE_LOGS_SOURCE_ID, {
logIndices: {
type: 'index_name',
indexName: 'logs-app_search.search_relevance_suggestions-*',
type: 'index_name',
},
name: 'Enterprise Search Search Relevance Logs',
});

infra.defineInternalSourceConfiguration(ENTERPRISE_SEARCH_AUDIT_LOGS_SOURCE_ID, {
name: 'Enterprise Search Audit Logs',
infra.logViews.defineInternalLogView(ENTERPRISE_SEARCH_AUDIT_LOGS_SOURCE_ID, {
logIndices: {
type: 'index_name',
indexName: 'logs-enterprise_search*',
type: 'index_name',
},
name: 'Enterprise Search Audit Logs',
});

infra.defineInternalSourceConfiguration(ENTERPRISE_SEARCH_ANALYTICS_LOGS_SOURCE_ID, {
name: 'Enterprise Search Behaviorial Analytics Logs',
infra.logViews.defineInternalLogView(ENTERPRISE_SEARCH_ANALYTICS_LOGS_SOURCE_ID, {
logIndices: {
type: 'index_name',
indexName: 'logs-elastic_analytics.events-*',
type: 'index_name',
},
name: 'Enterprise Search Behaviorial Analytics Logs',
});

/**
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/infra/common/log_views/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const logViewAttributesRT = rt.strict({
logIndices: logIndexReferenceRT,
logColumns: rt.array(logViewColumnConfigurationRT),
});

export type LogViewAttributes = rt.TypeOf<typeof logViewAttributesRT>;

export const logViewRT = rt.exact(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Logger,
SavedObjectsClientContract,
} from '@kbn/core/server';
import { LogView, LogViewAttributes } from '../../../common/log_views';
import { defaultLogViewAttributes, LogView, LogViewAttributes } from '../../../common/log_views';
import { LogViewsClient } from './log_views_client';
import { LogViewsServiceSetup, LogViewsServiceStart, LogViewsServiceStartDeps } from './types';

Expand All @@ -24,11 +24,11 @@ export class LogViewsService {
const { internalLogViews } = this;

return {
defineInternalLogView(logViewId: string, logViewAttributes: LogViewAttributes) {
defineInternalLogView(logViewId: string, logViewAttributes: Partial<LogViewAttributes>) {
internalLogViews.set(logViewId, {
id: logViewId,
origin: 'internal',
attributes: logViewAttributes,
attributes: { ...defaultLogViewAttributes, ...logViewAttributes },
updatedAt: Date.now(),
});
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/server/services/log_views/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface LogViewsServiceStartDeps {
}

export interface LogViewsServiceSetup {
defineInternalLogView(logViewId: string, logViewAttributes: LogViewAttributes): void;
defineInternalLogView(logViewId: string, logViewAttributes: Partial<LogViewAttributes>): void;
}

export interface LogViewsServiceStart {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const initInfraSource = (config: MonitoringConfig, infraPlugin: InfraPlug
ccs: CCS_REMOTE_PATTERN,
});

infraPlugin.defineInternalSourceConfiguration(INFRA_SOURCE_ID, {
infraPlugin.logViews.defineInternalLogView(INFRA_SOURCE_ID, {
name: 'Elastic Stack Logs',
logIndices: {
type: 'index_name',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/upgrade_assistant/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class UpgradeAssistantServerPlugin implements Plugin {

// We need to initialize the deprecation logs plugin so that we can
// navigate from this app to the observability app using a source_id.
infra?.defineInternalSourceConfiguration(DEPRECATION_LOGS_SOURCE_ID, {
infra?.logViews.defineInternalLogView(DEPRECATION_LOGS_SOURCE_ID, {
name: 'deprecationLogs',
description: 'deprecation logs',
logIndices: {
Expand Down