mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* Define and use an internal log ui source configuration * Fix urls in tests * Remove unnecessary code
This commit is contained in:
parent
d41c1adc70
commit
25d91e9c17
6 changed files with 41 additions and 6 deletions
|
@ -164,3 +164,8 @@ export const INDEX_PATTERN_FILEBEAT = 'filebeat-*';
|
|||
|
||||
// This is the unique token that exists in monitoring indices collected by metricbeat
|
||||
export const METRICBEAT_INDEX_NAME_UNIQUE_TOKEN = '-mb-';
|
||||
|
||||
/**
|
||||
* The id of the infra source owned by the monitoring plugin.
|
||||
*/
|
||||
export const INFRA_SOURCE_ID = 'internal-stack-monitoring';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { init } from './init';
|
||||
import { init, postInit } from './init';
|
||||
import { config } from './config';
|
||||
import { deprecations } from './deprecations';
|
||||
import { getUiExports } from './ui_exports';
|
||||
|
@ -24,4 +24,7 @@ export const monitoring = (kibana) => new kibana.Plugin({
|
|||
config,
|
||||
deprecations,
|
||||
uiExports: getUiExports(),
|
||||
postInit(server) {
|
||||
postInit(server);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -15,6 +15,7 @@ import {
|
|||
getOpsStatsCollector,
|
||||
getSettingsCollector,
|
||||
} from './server/kibana_monitoring/collectors';
|
||||
import { initInfraSource } from './server/lib/logs/init_infra_source';
|
||||
|
||||
/**
|
||||
* Initialize the Kibana Monitoring plugin by starting up asynchronous server tasks
|
||||
|
@ -116,3 +117,7 @@ export const init = (monitoringPlugin, server) => {
|
|||
};
|
||||
});
|
||||
};
|
||||
|
||||
export const postInit = server => {
|
||||
initInfraSource(server);
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ exports[`Logs should render a link to filter by cluster uuid 1`] = `
|
|||
Object {
|
||||
"link": <EuiLink
|
||||
color="primary"
|
||||
href="/app/infra#/link-to/logs?filter=elasticsearch.cluster.uuid:12345"
|
||||
href="/app/infra#/link-to/internal-stack-monitoring/logs?filter=elasticsearch.cluster.uuid:12345"
|
||||
type="button"
|
||||
>
|
||||
Logs
|
||||
|
@ -42,7 +42,7 @@ exports[`Logs should render a link to filter by cluster uuid and index uuid 1`]
|
|||
Object {
|
||||
"link": <EuiLink
|
||||
color="primary"
|
||||
href="/app/infra#/link-to/logs?filter=elasticsearch.cluster.uuid:12345 and elasticsearch.index.name:6789"
|
||||
href="/app/infra#/link-to/internal-stack-monitoring/logs?filter=elasticsearch.cluster.uuid:12345 and elasticsearch.index.name:6789"
|
||||
type="button"
|
||||
>
|
||||
Logs
|
||||
|
@ -69,7 +69,7 @@ exports[`Logs should render a link to filter by cluster uuid and node uuid 1`] =
|
|||
Object {
|
||||
"link": <EuiLink
|
||||
color="primary"
|
||||
href="/app/infra#/link-to/logs?filter=elasticsearch.cluster.uuid:12345 and elasticsearch.node.id:6789"
|
||||
href="/app/infra#/link-to/internal-stack-monitoring/logs?filter=elasticsearch.cluster.uuid:12345 and elasticsearch.node.id:6789"
|
||||
type="button"
|
||||
>
|
||||
Logs
|
||||
|
@ -297,7 +297,7 @@ exports[`Logs should render normally 1`] = `
|
|||
Object {
|
||||
"link": <EuiLink
|
||||
color="primary"
|
||||
href="/app/infra#/link-to/logs"
|
||||
href="/app/infra#/link-to/internal-stack-monitoring/logs"
|
||||
type="button"
|
||||
>
|
||||
Logs
|
||||
|
|
|
@ -14,6 +14,7 @@ import {
|
|||
EuiCallOut,
|
||||
EuiLink,
|
||||
} from '@elastic/eui';
|
||||
import { INFRA_SOURCE_ID } from '../../../common/constants';
|
||||
import { formatDateTimeLocal } from '../../../common/formatting';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
@ -110,7 +111,7 @@ const clusterColumns = [
|
|||
];
|
||||
|
||||
function getLogsUiLink(clusterUuid, nodeId, indexUuid) {
|
||||
const base = `${chrome.getBasePath()}/app/infra#/link-to/logs`;
|
||||
const base = `${chrome.getBasePath()}/app/infra#/link-to/${INFRA_SOURCE_ID}/logs`;
|
||||
|
||||
const params = [];
|
||||
if (clusterUuid) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { prefixIndexPattern } from '../ccs_utils';
|
||||
import { INDEX_PATTERN_FILEBEAT, INFRA_SOURCE_ID } from '../../../common/constants';
|
||||
|
||||
export const initInfraSource = server => {
|
||||
const infraPlugin = server.plugins.infra;
|
||||
|
||||
if (infraPlugin) {
|
||||
const config = server.config();
|
||||
const filebeatIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_FILEBEAT, '*');
|
||||
infraPlugin.defineInternalSourceConfiguration(INFRA_SOURCE_ID, {
|
||||
name: 'Elastic Stack Logs',
|
||||
logAlias: filebeatIndexPattern
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue