Skip to content

Commit

Permalink
[Monitoring] Change all configs to monitoring.* (#56215) (#56421)
Browse files Browse the repository at this point in the history
* Revert "Revert "[Monitoring] Change all configs to `monitoring.*`" (#56214)"

This reverts commit bd08eb7.

* Fix missing config changes

* More fixes

* Doc changes

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
chrisronline and elasticmachine authored Jan 30, 2020
1 parent 103095a commit a519fa2
Show file tree
Hide file tree
Showing 59 changed files with 213 additions and 171 deletions.
32 changes: 16 additions & 16 deletions docs/settings/monitoring-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ built-in `elastic` user has this role.

You can adjust how monitoring data is
collected from {kib} and displayed in {kib} by configuring settings in the
`kibana.yml` file. There are also `xpack.monitoring.elasticsearch.*` settings,
`kibana.yml` file. There are also `monitoring.ui.elasticsearch.*` settings,
which support the same values as <<settings,{kib} configuration settings>>.

To control how data is collected from your {es} nodes, you configure
Expand All @@ -31,20 +31,20 @@ For more information, see
[[monitoring-general-settings]]
==== General monitoring settings

`xpack.monitoring.enabled`::
`monitoring.enabled`::
Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the
`xpack.monitoring.ui.enabled` setting, when this setting is `false`, the
`monitoring.ui.enabled` setting, when this setting is `false`, the
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.

`xpack.monitoring.elasticsearch.hosts`::
`monitoring.ui.elasticsearch.hosts`::
Specifies the location of the {es} cluster where your monitoring data is stored.
By default, this is the same as `elasticsearch.hosts`. This setting enables
you to use a single {kib} instance to search and visualize data in your
production cluster as well as monitor data sent to a dedicated monitoring
cluster.

`xpack.monitoring.elasticsearch.username`::
`monitoring.ui.elasticsearch.username`::
Specifies the username used by {kib} monitoring to establish a persistent connection
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
monitoring cluster.
Expand All @@ -55,7 +55,7 @@ both the {es} monitoring cluster and the {es} production cluster.

If not set, {kib} uses the value of the `elasticsearch.username` setting.

`xpack.monitoring.elasticsearch.password`::
`monitoring.ui.elasticsearch.password`::
Specifies the password used by {kib} monitoring to establish a persistent connection
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
monitoring cluster.
Expand All @@ -66,7 +66,7 @@ both the {es} monitoring cluster and the {es} production cluster.

If not set, {kib} uses the value of the `elasticsearch.password` setting.

`xpack.monitoring.elasticsearch.pingTimeout`::
`monitoring.ui.elasticsearch.pingTimeout`::
Specifies the time in milliseconds to wait for {es} to respond to internal
health checks. By default, it matches the `elasticsearch.pingTimeout` setting,
which has a default value of `30000`.
Expand All @@ -77,11 +77,11 @@ which has a default value of `30000`.

These settings control how data is collected from {kib}.

`xpack.monitoring.kibana.collection.enabled`::
`monitoring.kibana.collection.enabled`::
Set to `true` (default) to enable data collection from the {kib} NodeJS server
for {kib} Dashboards to be featured in the Monitoring.

`xpack.monitoring.kibana.collection.interval`::
`monitoring.kibana.collection.interval`::
Specifies the number of milliseconds to wait in between data sampling on the
{kib} NodeJS server for the metrics that are displayed in the {kib} dashboards.
Defaults to `10000` (10 seconds).
Expand All @@ -96,24 +96,24 @@ However, the defaults work best in most circumstances. For more information
about configuring {kib}, see
{kibana-ref}/settings.html[Setting Kibana Server Properties].

`xpack.monitoring.elasticsearch.logFetchCount`::
`monitoring.ui.elasticsearch.logFetchCount`::
Specifies the number of log entries to display in the Monitoring UI. Defaults to
`10`. The maximum value is `50`.

`xpack.monitoring.max_bucket_size`::
`monitoring.ui.max_bucket_size`::
Specifies the number of term buckets to return out of the overall terms list when
performing terms aggregations to retrieve index and node metrics. For more
information about the `size` parameter, see
{ref}/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size[Terms Aggregation].
Defaults to `10000`.

`xpack.monitoring.min_interval_seconds`::
`monitoring.ui.min_interval_seconds`::
Specifies the minimum number of seconds that a time bucket in a chart can
represent. Defaults to 10. If you modify the
`xpack.monitoring.collection.interval` in `elasticsearch.yml`, use the same
`monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same
value in this setting.

`xpack.monitoring.ui.enabled`::
`monitoring.ui.enabled`::
Set to `false` to hide the Monitoring UI in {kib}. The monitoring back-end
continues to run as an agent for sending {kib} stats to the monitoring
cluster. Defaults to `true`.
Expand All @@ -127,15 +127,15 @@ better decisions about your container performance, rather than guessing based on
the overall machine performance. If you are not running your applications in a
container, then Cgroup statistics are not useful.

`xpack.monitoring.ui.container.elasticsearch.enabled`::
`monitoring.ui.container.elasticsearch.enabled`::

For {es} clusters that are running in containers, this setting changes the
*Node Listing* to display the CPU utilization based on the reported Cgroup
statistics. It also adds the calculated Cgroup CPU utilization to the
*Node Overview* page instead of the overall operating system's CPU
utilization. Defaults to `false`.

`xpack.monitoring.ui.container.logstash.enabled`::
`monitoring.ui.container.logstash.enabled`::

For {ls} nodes that are running in containers, this setting
changes the {ls} *Node Listing* to display the CPU utilization
Expand Down
50 changes: 50 additions & 0 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,56 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
renameFromRoot('xpack.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner'),
renameFromRoot('xpack.telemetry.url', 'telemetry.url'),
// Monitoring renames
// TODO: Remove these from here once the monitoring plugin is migrated to NP
renameFromRoot('xpack.monitoring.enabled', 'monitoring.enabled'),
renameFromRoot('xpack.monitoring.ui.enabled', 'monitoring.ui.enabled'),
renameFromRoot(
'xpack.monitoring.kibana.collection.enabled',
'monitoring.kibana.collection.enabled'
),
renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'),
renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'),
renameFromRoot(
'xpack.monitoring.show_license_expiration',
'monitoring.ui.show_license_expiration'
),
renameFromRoot(
'xpack.monitoring.ui.container.elasticsearch.enabled',
'monitoring.ui.container.elasticsearch.enabled'
),
renameFromRoot(
'xpack.monitoring.ui.container.logstash.enabled',
'monitoring.ui.container.logstash.enabled'
),
renameFromRoot(
'xpack.monitoring.tests.cloud_detector.enabled',
'monitoring.tests.cloud_detector.enabled'
),
renameFromRoot(
'xpack.monitoring.kibana.collection.interval',
'monitoring.kibana.collection.interval'
),
renameFromRoot('xpack.monitoring.elasticsearch.hosts', 'monitoring.ui.elasticsearch.hosts'),
renameFromRoot('xpack.monitoring.elasticsearch.username', 'monitoring.ui.elasticsearch.username'),
renameFromRoot('xpack.monitoring.elasticsearch.password', 'monitoring.ui.elasticsearch.password'),
renameFromRoot(
'xpack.monitoring.xpack_api_polling_frequency_millis',
'monitoring.xpack_api_polling_frequency_millis'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.enabled',
'monitoring.cluster_alerts.email_notifications.enabled'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.email_address',
'monitoring.cluster_alerts.email_notifications.email_address'
),
renameFromRoot('xpack.monitoring.ccs.enabled', 'monitoring.ui.ccs.enabled'),
renameFromRoot(
'xpack.monitoring.elasticsearch.logFetchCount',
'monitoring.ui.elasticsearch.logFetchCount'
),
configPathDeprecation,
dataPathDeprecation,
rewriteBasePathDeprecation,
Expand Down
96 changes: 48 additions & 48 deletions x-pack/legacy/plugins/monitoring/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export const config = Joi => {
const DEFAULT_REQUEST_HEADERS = ['authorization'];

return Joi.object({
ccs: Joi.object({
enabled: Joi.boolean().default(true),
}).default(),
enabled: Joi.boolean().default(true),
ui: Joi.object({
enabled: Joi.boolean().default(true),
ccs: Joi.object({
enabled: Joi.boolean().default(true),
}).default(),
container: Joi.object({
elasticsearch: Joi.object({
enabled: Joi.boolean().default(false),
Expand All @@ -29,6 +29,51 @@ export const config = Joi => {
enabled: Joi.boolean().default(false),
}).default(),
}).default(),
max_bucket_size: Joi.number().default(10000),
min_interval_seconds: Joi.number().default(10),
show_license_expiration: Joi.boolean().default(true),
elasticsearch: Joi.object({
customHeaders: Joi.object().default({}),
logQueries: Joi.boolean().default(false),
requestHeadersWhitelist: Joi.array()
.items()
.single()
.default(DEFAULT_REQUEST_HEADERS),
sniffOnStart: Joi.boolean().default(false),
sniffInterval: Joi.number()
.allow(false)
.default(false),
sniffOnConnectionFault: Joi.boolean().default(false),
hosts: Joi.array()
.items(Joi.string().uri({ scheme: ['http', 'https'] }))
.single(), // if empty, use Kibana's connection config
username: Joi.string(),
password: Joi.string(),
requestTimeout: Joi.number().default(30000),
pingTimeout: Joi.number().default(30000),
ssl: Joi.object({
verificationMode: Joi.string()
.valid('none', 'certificate', 'full')
.default('full'),
certificateAuthorities: Joi.array()
.single()
.items(Joi.string()),
certificate: Joi.string(),
key: Joi.string(),
keyPassphrase: Joi.string(),
keystore: Joi.object({
path: Joi.string(),
password: Joi.string(),
}).default(),
truststore: Joi.object({
path: Joi.string(),
password: Joi.string(),
}).default(),
alwaysPresentCertificate: Joi.boolean().default(false),
}).default(),
apiVersion: Joi.string().default('master'),
logFetchCount: Joi.number().default(10),
}).default(),
}).default(),
kibana: Joi.object({
collection: Joi.object({
Expand All @@ -46,56 +91,11 @@ export const config = Joi => {
xpack_api_polling_frequency_millis: Joi.number().default(
XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS
),
max_bucket_size: Joi.number().default(10000),
min_interval_seconds: Joi.number().default(10),
show_license_expiration: Joi.boolean().default(true),
agent: Joi.object({
interval: Joi.string()
.regex(/[\d\.]+[yMwdhms]/)
.default('10s'),
}).default(),
elasticsearch: Joi.object({
customHeaders: Joi.object().default({}),
logQueries: Joi.boolean().default(false),
requestHeadersWhitelist: Joi.array()
.items()
.single()
.default(DEFAULT_REQUEST_HEADERS),
sniffOnStart: Joi.boolean().default(false),
sniffInterval: Joi.number()
.allow(false)
.default(false),
sniffOnConnectionFault: Joi.boolean().default(false),
hosts: Joi.array()
.items(Joi.string().uri({ scheme: ['http', 'https'] }))
.single(), // if empty, use Kibana's connection config
username: Joi.string(),
password: Joi.string(),
requestTimeout: Joi.number().default(30000),
pingTimeout: Joi.number().default(30000),
ssl: Joi.object({
verificationMode: Joi.string()
.valid('none', 'certificate', 'full')
.default('full'),
certificateAuthorities: Joi.array()
.single()
.items(Joi.string()),
certificate: Joi.string(),
key: Joi.string(),
keyPassphrase: Joi.string(),
keystore: Joi.object({
path: Joi.string(),
password: Joi.string(),
}).default(),
truststore: Joi.object({
path: Joi.string(),
password: Joi.string(),
}).default(),
alwaysPresentCertificate: Joi.boolean().default(false),
}).default(),
apiVersion: Joi.string().default('master'),
logFetchCount: Joi.number().default(10),
}).default(),
tests: Joi.object({
cloud_detector: Joi.object({
enabled: Joi.boolean().default(true),
Expand Down
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/monitoring/deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const deprecations = () => {
}
},
(settings, log) => {
const fromPath = 'xpack.monitoring.elasticsearch';
const fromPath = 'monitoring.elasticsearch';
const es = get(settings, 'elasticsearch');
if (es) {
if (es.username === 'elastic') {
Expand All @@ -39,7 +39,7 @@ export const deprecations = () => {
}
},
(settings, log) => {
const fromPath = 'xpack.monitoring.elasticsearch.ssl';
const fromPath = 'monitoring.elasticsearch.ssl';
const ssl = get(settings, 'elasticsearch.ssl');
if (ssl) {
if (ssl.key !== undefined && ssl.certificate === undefined) {
Expand Down
34 changes: 17 additions & 17 deletions x-pack/legacy/plugins/monitoring/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ export const monitoring = kibana =>
new kibana.Plugin({
require: ['kibana', 'elasticsearch', 'xpack_main'],
id: 'monitoring',
configPrefix: 'xpack.monitoring',
configPrefix: 'monitoring',
publicDir: resolve(__dirname, 'public'),
init(server) {
const configs = [
'xpack.monitoring.ui.enabled',
'xpack.monitoring.kibana.collection.enabled',
'xpack.monitoring.max_bucket_size',
'xpack.monitoring.min_interval_seconds',
'monitoring.ui.enabled',
'monitoring.kibana.collection.enabled',
'monitoring.ui.max_bucket_size',
'monitoring.ui.min_interval_seconds',
'kibana.index',
'pkg.version',
'xpack.monitoring.show_license_expiration',
'xpack.monitoring.ui.container.elasticsearch.enabled',
'xpack.monitoring.ui.container.logstash.enabled',
'xpack.monitoring.tests.cloud_detector.enabled',
'xpack.monitoring.kibana.collection.interval',
'xpack.monitoring.elasticsearch.hosts',
'xpack.monitoring.elasticsearch',
'xpack.monitoring.xpack_api_polling_frequency_millis',
'monitoring.ui.show_license_expiration',
'monitoring.ui.container.elasticsearch.enabled',
'monitoring.ui.container.logstash.enabled',
'monitoring.tests.cloud_detector.enabled',
'monitoring.kibana.collection.interval',
'monitoring.ui.elasticsearch.hosts',
'monitoring.ui.elasticsearch',
'monitoring.xpack_api_polling_frequency_millis',
'server.uuid',
'server.name',
'server.host',
'server.port',
'xpack.monitoring.cluster_alerts.email_notifications.enabled',
'xpack.monitoring.cluster_alerts.email_notifications.email_address',
'xpack.monitoring.ccs.enabled',
'xpack.monitoring.elasticsearch.logFetchCount',
'monitoring.cluster_alerts.email_notifications.enabled',
'monitoring.cluster_alerts.email_notifications.email_address',
'monitoring.ui.ccs.enabled',
'monitoring.ui.elasticsearch.logFetchCount',
];

const serverConfig = server.config();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a519fa2

Please sign in to comment.