Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 150317-ad-hoc-when-empty
- Loading branch information
Showing
95 changed files
with
3,818 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/discover_log_explorer/.storybook/__mocks__/package_icon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { EuiIcon } from '@elastic/eui'; | ||
|
||
// Export mock package icon that doesn't trigger http requests | ||
export const PackageIcon = () => <EuiIcon type="package" style={{ marginRight: 8 }} />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
const defaultConfig = require('@kbn/storybook').defaultConfig; | ||
|
||
module.exports = { | ||
...defaultConfig, | ||
stories: ['../**/*.stories.mdx', ...defaultConfig.stories], | ||
webpackFinal: async (config) => { | ||
const originalConfig = await defaultConfig.webpackFinal(config); | ||
|
||
// Mock fleet plugin for PackageIcon component | ||
originalConfig.resolve.alias['@kbn/fleet-plugin/public'] = require.resolve( | ||
'./__mocks__/package_icon' | ||
); | ||
return originalConfig; | ||
}, | ||
}; |
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/discover_log_explorer/.storybook/preview.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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. | ||
*/ | ||
export const parameters = { | ||
docs: { | ||
source: { | ||
type: 'code', // without this, stories in mdx documents freeze the browser | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Discover Log Explorer | ||
|
||
This plugin registers a `log-explorer` profile using the Discover customization framework, offering several affordances specifically designed for log consumption. | ||
|
||
The plugin enhances the capabilities of Discover in the following ways: | ||
|
||
- **Dataset selector**: this customization on the Discover page replaces the DataViews picker with a Logs dataset selector built ad-hoc to provide a better experience when navigating throught all the available datasets. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const LOG_EXPLORER_PROFILE_ID = 'log-explorer'; |
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/discover_log_explorer/common/datasets/errors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* eslint-disable max-classes-per-file */ | ||
|
||
export class FindIntegrationsError extends Error { | ||
constructor(message: string) { | ||
super(message); | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
this.name = 'FindIntegrationsError'; | ||
} | ||
} | ||
|
||
export class FindDatasetsError extends Error { | ||
constructor(message: string) { | ||
super(message); | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
this.name = 'FindDatasetsError'; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/discover_log_explorer/common/datasets/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './types'; | ||
export { Dataset } from './models/dataset'; | ||
export { Integration } from './models/integration'; |
41 changes: 41 additions & 0 deletions
41
x-pack/plugins/discover_log_explorer/common/datasets/models/dataset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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 { DataViewSpec } from '@kbn/data-views-plugin/common'; | ||
import { DatasetId, DatasetType, IntegrationType } from '../types'; | ||
|
||
type IntegrationBase = Pick<IntegrationType, 'name' | 'version'>; | ||
|
||
export class Dataset { | ||
id: DatasetId; | ||
name: DatasetType['name']; | ||
title: DatasetType['title']; | ||
parentIntegration?: IntegrationBase; | ||
|
||
private constructor(dataset: DatasetType, parentIntegration?: IntegrationType) { | ||
this.id = `dataset-${dataset.name}` as DatasetId; | ||
this.name = dataset.name; | ||
this.title = dataset.title ?? dataset.name; | ||
this.parentIntegration = parentIntegration && { | ||
name: parentIntegration.name, | ||
version: parentIntegration.version, | ||
}; | ||
} | ||
|
||
toDataviewSpec(): DataViewSpec { | ||
// Invert the property because the API returns the index pattern as `name` and a readable name as `title` | ||
return { | ||
id: this.id, | ||
name: this.title, | ||
title: this.name, | ||
}; | ||
} | ||
|
||
public static create(dataset: DatasetType, parentIntegration?: IntegrationType) { | ||
return new Dataset(dataset, parentIntegration); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/discover_log_explorer/common/datasets/models/integration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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 { Dataset } from './dataset'; | ||
import { IntegrationId, IntegrationType } from '../types'; | ||
|
||
export class Integration { | ||
id: IntegrationId; | ||
name: IntegrationType['name']; | ||
status: IntegrationType['status']; | ||
version: IntegrationType['version']; | ||
datasets: Dataset[]; | ||
|
||
private constructor(integration: Integration) { | ||
this.id = integration.id; | ||
this.name = integration.name; | ||
this.status = integration.status; | ||
this.version = integration.version; | ||
this.datasets = integration.datasets; | ||
} | ||
|
||
public static create(integration: IntegrationType) { | ||
return new Integration({ | ||
...integration, | ||
id: `integration-${integration.name}-${integration.version}` as IntegrationId, | ||
datasets: integration.dataStreams.map((dataset) => Dataset.create(dataset, integration)), | ||
}); | ||
} | ||
} |
Oops, something went wrong.