Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into design/integratio…
Browse files Browse the repository at this point in the history
…ns-link
  • Loading branch information
cchaos committed Oct 25, 2021
2 parents 83a67cd + edc43c0 commit 3621c00
Show file tree
Hide file tree
Showing 177 changed files with 1,139 additions and 1,038 deletions.
4 changes: 0 additions & 4 deletions config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
# The URLs of the Elasticsearch instances to use for all your queries.
#elasticsearch.hosts: ["http://localhost:9200"]

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
Expand Down
1 change: 0 additions & 1 deletion docs/developer/advanced/running-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ If many other users will be interacting with your remote cluster, you'll want to
[source,bash]
----
kibana.index: '.{YourGitHubHandle}-kibana'
xpack.task_manager.index: '.{YourGitHubHandle}-task-manager-kibana'
----

==== Running remote clusters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) &gt; [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md)

## SavedObjectsServiceSetup.getKibanaIndex property

Returns the default index used for saved objects.

<b>Signature:</b>

```typescript
getKibanaIndex: () => string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Plugin() {
| Property | Type | Description |
| --- | --- | --- |
| [addClientWrapper](./kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | <code>(priority: number, id: string, factory: SavedObjectsClientWrapperFactory) =&gt; void</code> | Add a [client wrapper factory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) with the given priority. |
| [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md) | <code>() =&gt; string</code> | Returns the default index used for saved objects. |
| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | <code>&lt;Attributes = any&gt;(type: SavedObjectsType&lt;Attributes&gt;) =&gt; void</code> | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.<!-- -->See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. |
| [setClientFactoryProvider](./kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | <code>(clientFactoryProvider: SavedObjectsClientFactoryProvider) =&gt; void</code> | Set the default [factory provider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

```typescript
export declare type SharedGlobalConfig = RecursiveReadonly<{
kibana: Pick<KibanaConfigType, typeof SharedGlobalConfigKeys.kibana[number]>;
elasticsearch: Pick<ElasticsearchConfigType, typeof SharedGlobalConfigKeys.elasticsearch[number]>;
path: Pick<PathConfigType, typeof SharedGlobalConfigKeys.path[number]>;
savedObjects: Pick<SavedObjectsConfigType, typeof SharedGlobalConfigKeys.savedObjects[number]>;
Expand Down
3 changes: 0 additions & 3 deletions docs/settings/task-manager-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ Task Manager runs background tasks by polling for work on an interval. You can
| `xpack.task_manager.request_capacity`
| How many requests can Task Manager buffer before it rejects new requests. Defaults to 1000.

| `xpack.task_manager.index`
| The name of the index used to store task information. Defaults to `.kibana_task_manager`.

| `xpack.task_manager.max_workers`
| The maximum number of tasks that this Kibana instance will run simultaneously. Defaults to 10.
Starting in 8.0, it will not be possible to set the value greater than 100.
Expand Down
12 changes: 0 additions & 12 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,6 @@ is an alternative to `elasticsearch.username` and `elasticsearch.password`.
| `interpreter.enableInVisualize`
| Enables use of interpreter in Visualize. *Default: `true`*

|[[kibana-index]] `kibana.index:`
| deprecated:[7.11.0,This setting will be removed in 8.0.] Multitenancy by
changing `kibana.index` will not be supported starting in 8.0. See
https://ela.st/kbn-remove-legacy-multitenancy[8.0 Breaking Changes] for more
details.
+
{kib} uses an index in {es} to store saved searches, visualizations, and
dashboards. {kib} creates a new index if the index doesn’t already exist. If
you configure a custom index, the name must be lowercase, and conform to the
{es} {ref}/indices-create-index.html[index name limitations].
*Default: `".kibana"`*

| `data.autocomplete.valueSuggestions.timeout:` {ess-icon}
| Time in milliseconds to wait for autocomplete suggestions from {es}.
This value must be a whole number greater than zero. *Default: `"1000"`*
Expand Down
4 changes: 2 additions & 2 deletions docs/setup/upgrade/upgrade-migrations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ WARNING: The following instructions assumes {kib} is using the default index nam

Saved objects are stored in two indices:

* `.kibana_{kibana_version}_001`, or if the `kibana.index` configuration setting is set `.{kibana.index}_{kibana_version}_001`. E.g. for Kibana v7.12.0 `.kibana_7.12.0_001`.
* `.kibana_task_manager_{kibana_version}_001`, or if the `xpack.tasks.index` configuration setting is set `.{xpack.tasks.index}_{kibana_version}_001` E.g. for Kibana v7.12.0 `.kibana_task_manager_7.12.0_001`.
* `.kibana_{kibana_version}_001`, e.g. for Kibana v7.12.0 `.kibana_7.12.0_001`.
* `.kibana_task_manager_{kibana_version}_001`, e.g. for Kibana v7.12.0 `.kibana_task_manager_7.12.0_001`.

The index aliases `.kibana` and `.kibana_task_manager` will always point to
the most up-to-date saved object indices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This has three major benefits:

[IMPORTANT]
==============================================
Task definitions for alerts and actions are stored in the index specified by <<task-manager-settings, `xpack.task_manager.index`>>. The default is `.kibana_task_manager`.
Task definitions for alerts and actions are stored in the index called `.kibana_task_manager`.
You must have at least one replica of this index for production deployments.
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pageLoadAssetSize:
expressionShape: 34008
interactiveSetup: 80000
expressionTagcloud: 27505
securitySolution: 231753
securitySolution: 273763
customIntegrations: 28810
expressionMetricVis: 23121
visTypeMetric: 23332
Expand Down
1 change: 0 additions & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { Action } from 'history';
import { ApiResponse } from '@elastic/elasticsearch/lib/Transport';
import Boom from '@hapi/boom';
import { ConfigDeprecationProvider } from '@kbn/config';
import { ConfigPath } from '@kbn/config';
import { DetailedPeerCertificate } from 'tls';
import { EnvironmentMode } from '@kbn/config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { mockCoreContext } from '../core_context.mock';
import { config as RawElasticsearchConfig } from '../elasticsearch/elasticsearch_config';
import { config as RawHttpConfig } from '../http/http_config';
import { config as RawLoggingConfig } from '../logging/logging_config';
import { config as RawKibanaConfig } from '../kibana_config';
import { savedObjectsConfig as RawSavedObjectsConfig } from '../saved_objects/saved_objects_config';
import { httpServiceMock } from '../http/http_service.mock';
import { metricsServiceMock } from '../metrics/metrics_service.mock';
Expand All @@ -40,8 +39,6 @@ describe('CoreUsageDataService', () => {
return new BehaviorSubject(RawLoggingConfig.schema.validate({}));
} else if (path === 'savedObjects') {
return new BehaviorSubject(RawSavedObjectsConfig.schema.validate({}));
} else if (path === 'kibana') {
return new BehaviorSubject(RawKibanaConfig.schema.validate({}));
}
return new BehaviorSubject({});
};
Expand Down
34 changes: 7 additions & 27 deletions src/core/server/core_usage_data/core_usage_data_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import type {
} from './types';
import { isConfigured } from './is_configured';
import { ElasticsearchServiceStart } from '../elasticsearch';
import { KibanaConfigType } from '../kibana_config';
import { coreUsageStatsType } from './core_usage_stats';
import { LEGACY_URL_ALIAS_TYPE } from '../saved_objects/object_types';
import { CORE_USAGE_STATS_TYPE } from './constants';
Expand All @@ -56,6 +55,8 @@ export interface StartDeps {
exposedConfigsToUsage: ExposedConfigsToUsage;
}

const kibanaIndex = '.kibana';

/**
* Because users can configure their Saved Object to any arbitrary index name,
* we need to map customized index names back to a "standard" index name.
Expand All @@ -74,19 +75,6 @@ const kibanaOrTaskManagerIndex = (index: string, kibanaConfigIndex: string) => {
return index === kibanaConfigIndex ? '.kibana' : '.kibana_task_manager';
};

/**
* This is incredibly hacky... The config service doesn't allow you to determine
* whether or not a config value has been changed from the default value, and the
* default value is defined in legacy code.
*
* This will be going away in 8.0, so please look away for a few months
*
* @param index The `kibana.index` setting from the `kibana.yml`
*/
const isCustomIndex = (index: string) => {
return index !== '.kibana';
};

export class CoreUsageDataService
implements CoreService<InternalCoreUsageDataSetup, CoreUsageDataStart>
{
Expand All @@ -98,7 +86,6 @@ export class CoreUsageDataService
private soConfig?: SavedObjectsConfigType;
private stop$: Subject<void>;
private opsMetrics?: OpsMetrics;
private kibanaConfig?: KibanaConfigType;
private coreUsageStatsClient?: CoreUsageStatsClient;
private deprecatedConfigPaths: ChangedDeprecatedPaths = { set: [], unset: [] };
private incrementUsageCounter: CoreIncrementUsageCounter = () => {}; // Initially set to noop
Expand Down Expand Up @@ -133,8 +120,8 @@ export class CoreUsageDataService
.getTypeRegistry()
.getAllTypes()
.reduce((acc, type) => {
const index = type.indexPattern ?? this.kibanaConfig!.index;
return index != null ? acc.add(index) : acc;
const index = type.indexPattern ?? kibanaIndex;
return acc.add(index);
}, new Set<string>())
.values()
).map((index) => {
Expand All @@ -150,7 +137,7 @@ export class CoreUsageDataService
.then(({ body }) => {
const stats = body[0];
return {
alias: kibanaOrTaskManagerIndex(index, this.kibanaConfig!.index),
alias: kibanaOrTaskManagerIndex(index, kibanaIndex),
docsCount: stats['docs.count'] ? parseInt(stats['docs.count'], 10) : 0,
docsDeleted: stats['docs.deleted'] ? parseInt(stats['docs.deleted'], 10) : 0,
storeSizeBytes: stats['store.size'] ? parseInt(stats['store.size'], 10) : 0,
Expand All @@ -167,7 +154,7 @@ export class CoreUsageDataService
// Note: this agg can be changed to use `savedObjectsRepository.find` in the future after `filters` is supported.
// See src/core/server/saved_objects/service/lib/aggregations/aggs_types/bucket_aggs.ts for supported aggregations.
const { body: resp } = await elasticsearch.client.asInternalUser.search({
index: this.kibanaConfig!.index,
index: kibanaIndex,
body: {
track_total_hits: true,
query: { match: { type: LEGACY_URL_ALIAS_TYPE } },
Expand Down Expand Up @@ -313,7 +300,7 @@ export class CoreUsageDataService
},

savedObjects: {
customIndex: isCustomIndex(this.kibanaConfig!.index),
customIndex: false,
maxImportPayloadBytes: this.soConfig.maxImportPayloadBytes.getValueInBytes(),
maxImportExportSize: this.soConfig.maxImportExportSize,
},
Expand Down Expand Up @@ -472,13 +459,6 @@ export class CoreUsageDataService
this.soConfig = config;
});

this.configService
.atPath<KibanaConfigType>('kibana')
.pipe(takeUntil(this.stop$))
.subscribe((config) => {
this.kibanaConfig = config;
});

changedDeprecatedConfigPath$
.pipe(takeUntil(this.stop$))
.subscribe((deprecatedConfigPaths) => (this.deprecatedConfigPaths = deprecatedConfigPaths));
Expand Down
42 changes: 0 additions & 42 deletions src/core/server/kibana_config.test.ts

This file was deleted.

51 changes: 0 additions & 51 deletions src/core/server/kibana_config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/core/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ type MockedPluginInitializerConfig<T> = jest.Mocked<PluginInitializerContext<T>[

export function pluginInitializerContextConfigMock<T>(config: T) {
const globalConfig: SharedGlobalConfig = {
kibana: {
index: '.kibana-tests',
},
elasticsearch: {
shardTimeout: duration('30s'),
requestTimeout: duration('30s'),
Expand Down
6 changes: 0 additions & 6 deletions src/core/server/plugins/legacy_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ describe('Legacy config', () => {
const legacyConfig = getGlobalConfig(configService);

expect(legacyConfig).toStrictEqual({
kibana: {
index: '.kibana',
},
elasticsearch: {
shardTimeout: duration(30, 's'),
requestTimeout: duration(30, 's'),
Expand All @@ -62,9 +59,6 @@ describe('Legacy config', () => {
const legacyConfig = await getGlobalConfig$(configService).pipe(take(1)).toPromise();

expect(legacyConfig).toStrictEqual({
kibana: {
index: '.kibana',
},
elasticsearch: {
shardTimeout: duration(30, 's'),
requestTimeout: duration(30, 's'),
Expand Down
Loading

0 comments on commit 3621c00

Please sign in to comment.