Add Heartbeat as Uptime Monitors to Add Data UI (#23995) (#24472)

This adds a box "Uptime Monitors" to the Metrics tab. This box guides through installing and configuring Heartbeat with 1 monitor and loading the dashboards.

If the setup is local Heartbeat by default will ping `http://localhost:9200`. The setup recommended for the Cloud setup is to ping `http://elastic.co`. It requires an additional step as it's a non default monitor but will allow to directly have data in the dashboards.
This commit is contained in:
Nicolas Ruflin 2018-10-24 10:05:42 +02:00 committed by GitHub
parent f2c37d7f46
commit bdae66b223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 731 additions and 1 deletions

View file

@ -0,0 +1,661 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { INSTRUCTION_VARIANT } from './instruction_variant';
import { createTrycloudOption1, createTrycloudOption2 } from './onprem_cloud_instructions';
import { getSpaceIdForBeatsTutorial } from '../lib/get_space_id_for_beats_tutorial';
export const createHeartbeatInstructions = context => ({
INSTALL: {
OSX: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.osxTitle', {
defaultMessage: 'Download and install Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.osxTextPre', {
defaultMessage: 'First time using Heartbeat? See the [Getting Started Guide]({link}).',
values: { link: '{config.docs.beats.heartbeat}/heartbeat-getting-started.html' },
}),
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'tar xzvf heartbeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'cd heartbeat-{config.kibana.version}-darwin-x86_64/',
],
},
DEB: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.debTitle', {
defaultMessage: 'Download and install Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.debTextPre', {
defaultMessage: 'First time using Heartbeat? See the [Getting Started Guide]({link}).',
values: { link: '{config.docs.beats.heartbeat}/heartbeat-getting-started.html' },
}),
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-{config.kibana.version}-amd64.deb',
'sudo dpkg -i heartbeat-{config.kibana.version}-amd64.deb',
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.debTextPost', {
defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({link}).',
values: { link: 'https://www.elastic.co/downloads/beats/heartbeat' },
}),
},
RPM: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.rpmTitle', {
defaultMessage: 'Download and install Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.rpmTextPre', {
defaultMessage: 'First time using Heartbeat? See the [Getting Started Guide]({link}).',
values: { link: '{config.docs.beats.heartbeat}/heartbeat-getting-started.html' },
}),
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-{config.kibana.version}-x86_64.rpm',
'sudo rpm -vi heartbeat-{config.kibana.version}-x86_64.rpm',
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.debTextPost', {
defaultMessage: 'Looking for the 32-bit packages? See the [Download page]({link}).',
values: { link: 'https://www.elastic.co/downloads/beats/heartbeat' },
}),
},
WINDOWS: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.windowsTitle', {
defaultMessage: 'Download and install Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.windowsTextPre', {
defaultMessage: 'First time using Heartbeat? See the [Getting Started Guide]({heartbeatLink}).\n\
1. Download the Heartbeat Windows zip file from the [Download]({elasticLink}) page.\n\
2. Extract the contents of the zip file into {folderPath}.\n\
3. Rename the {directoryName} directory to `Heartbeat`.\n\
4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select \
**Run As Administrator**). If you are running Windows XP, you might need to download and install PowerShell.\n\
5. From the PowerShell prompt, run the following commands to install Heartbeat as a Windows service.',
values: {
directoryName: '`heartbeat-{config.kibana.version}-windows`',
folderPath: '`C:\\Program Files`',
heartbeatLink: '{config.docs.beats.heartbeat}/heartbeat-getting-started.html',
elasticLink: 'https://www.elastic.co/downloads/beats/heartbeat',
},
}),
commands: [
'PS > cd C:\\Program Files\\Heartbeat',
'PS C:\\Program Files\\Heartbeat> .\\install-service-heartbeat.ps1',
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.install.windowsTextPost', {
defaultMessage: 'Modify the settings under `output.elasticsearch` in the {path} file to point to your Elasticsearch installation.',
values: { path: '`C:\\Program Files\\Heartbeat\\heartbeat.yml`' },
}),
}
},
START: {
OSX: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.osxTitle', {
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.osxTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
}),
commands: [
'./heartbeat setup',
'./heartbeat -e',
]
},
DEB: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.debTitle', {
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.debTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
}),
commands: [
'sudo heartbeat setup',
'sudo service heartbeat start',
]
},
RPM: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.rpmTitle', {
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.rpmTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
}),
commands: [
'sudo heartbeat setup',
'sudo service heartbeat start',
],
},
WINDOWS: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.windowsTitle', {
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.windowsTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
}),
commands: [
'PS C:\\Program Files\\Heartbeat> heartbeat.exe setup',
'PS C:\\Program Files\\Heartbeat> Start-Service heartbeat',
],
},
},
CONFIG: {
OSX: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.osxTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.osxTextPre', {
defaultMessage: 'Modify {path} to set the connection information:',
values: {
path: '`heartbeat.yml`',
},
}),
commands: [
'output.elasticsearch:',
' hosts: ["<es_url>"]',
' username: "elastic"',
' password: "<password>"',
'setup.kibana:',
' host: "<kibana_url>"',
getSpaceIdForBeatsTutorial(context)
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.osxTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
and {kibanaUrlTemplate} is the URL of Kibana. \
To configure your own monitors check [configure Hearbeat docs]({configureLink}).',
values: {
passwordTemplate: '`<password>`',
esUrlTemplate: '`<es_url>`',
kibanaUrlTemplate: '`<kibana_url>`',
configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html',
},
}),
},
DEB: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.debTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.debTextPre', {
defaultMessage: 'Modify {path} to set the connection information:',
values: {
path: '`/etc/heartbeat/heartbeat.yml`',
},
}),
commands: [
'output.elasticsearch:',
' hosts: ["<es_url>"]',
' username: "elastic"',
' password: "<password>"',
'setup.kibana:',
' host: "<kibana_url>"',
getSpaceIdForBeatsTutorial(context)
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.debTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
and {kibanaUrlTemplate} is the URL of Kibana. \
To configure your own monitors check [configure Hearbeat docs]({configureLink}).',
values: {
passwordTemplate: '`<password>`',
esUrlTemplate: '`<es_url>`',
kibanaUrlTemplate: '`<kibana_url>`',
configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html',
},
}),
},
RPM: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.rpmTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.rpmTextPre', {
defaultMessage: 'Modify {path} to set the connection information:',
values: {
path: '`/etc/heartbeat/heartbeat.yml`',
},
}),
commands: [
'output.elasticsearch:',
' hosts: ["<es_url>"]',
' username: "elastic"',
' password: "<password>"',
'setup.kibana:',
' host: "<kibana_url>"',
getSpaceIdForBeatsTutorial(context)
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.rpmTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
and {kibanaUrlTemplate} is the URL of Kibana. \
To configure your own monitors check [configure Hearbeat docs]({configureLink}).',
values: {
passwordTemplate: '`<password>`',
esUrlTemplate: '`<es_url>`',
kibanaUrlTemplate: '`<kibana_url>`',
configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html',
},
}),
},
WINDOWS: {
title: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.windowsTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.windowsTextPre', {
defaultMessage: 'Modify {path} to set the connection information:',
values: {
path: '`C:\\Program Files\\Heartbeat\\heartbeat.yml`',
},
}),
commands: [
'output.elasticsearch:',
' hosts: ["<es_url>"]',
' username: "elastic"',
' password: "<password>"',
'setup.kibana:',
' host: "<kibana_url>"',
getSpaceIdForBeatsTutorial(context)
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatInstructions.config.windowsTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
and {kibanaUrlTemplate} is the URL of Kibana. \
To configure your own monitors check [configure Hearbeat docs]({configureLink}).',
values: {
passwordTemplate: '`<password>`',
esUrlTemplate: '`<es_url>`',
kibanaUrlTemplate: '`<kibana_url>`',
configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html',
},
}),
}
}
});
export const createHeartbeatCloudInstructions = () => ({
CONFIG: {
OSX: {
title: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.osxTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.osxTextPre', {
defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:',
values: {
path: '`heartbeat.yml`',
},
}),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"'
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.osxTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.',
values: { passwordTemplate: '`<password>`' },
}),
},
DEB: {
title: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.debTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.debTextPre', {
defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:',
values: {
path: '`/etc/heartbeat/heartbeat.yml`',
},
}),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"'
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.debTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.',
values: { passwordTemplate: '`<password>`' },
}),
},
RPM: {
title: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.rpmTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.rpmTextPre', {
defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:',
values: {
path: '`/etc/heartbeat/heartbeat.yml`',
},
}),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"'
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.rpmTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.',
values: { passwordTemplate: '`<password>`' },
}),
},
WINDOWS: {
title: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.windowsTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.windowsTextPre', {
defaultMessage: 'Modify {path} to set the connection information for Elastic Cloud:',
values: {
path: '`C:\\Program Files\\Heartbeat\\heartbeat.yml`',
},
}),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"'
],
textPost: i18n.translate('kbn.common.tutorials.heartbeatCloudInstructions.config.windowsTextPost', {
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user.',
values: { passwordTemplate: '`<password>`' },
}),
}
}
});
export function heartbeatEnableInstructionsOnPrem() {
const defaultTitle = i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.defaultTitle', {
defaultMessage: 'Edit the configuration - Add monitors',
});
const defaultCommands = [
'- type: http',
' urls: ["<http://localhost:9200>"]',
' schedule: "@every 10s"'
];
const defaultTextPost = i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.defaultTextPost', {
defaultMessage: 'Where {hostTemplate} is your monitored URL, For more details on how to configure Monitors in \
Heartbeat, read the [Heartbeat configuration docs.]({configureLink})',
values: {
configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html',
hostTemplate: '`<http://localhost:9200>`'
}
});
return {
OSX: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.osxTextPre', {
defaultMessage: 'Modify the settings in the `heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
DEB: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.debTextPre', {
defaultMessage: 'Modify the monitors in the `/etc/heartbeat/heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
RPM: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.rpmTextPre', {
defaultMessage: 'Modify the monitors in the `/etc/heartbeat/heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
WINDOWS: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableOnPremInstructions.windowsTextPre', {
defaultMessage: 'From the {path} folder, run:',
values: { path: `C:\\Program Files\\Heartbeat` },
}),
commands: defaultCommands,
textPost: defaultTextPost
}
};
}
export function heartbeatEnableInstructionsCloud() {
const defaultTitle = i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.defaultTitle', {
defaultMessage: 'Edit the configuration - Add monitors',
});
const defaultCommands = [
'- type: http',
' urls: ["http://elastic.co"]',
' schedule: "@every 10s"'
];
const defaultTextPost = i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.defaultTextPost', {
defaultMessage: 'For more details on how to configure Monitors in Heartbeat, read the [Heartbeat configuration docs.]({configureLink})',
values: { configureLink: '{config.docs.beats.heartbeat}/heartbeat-configuration.html' }
});
return {
OSX: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.osxTextPre', {
defaultMessage: 'Modify the settings in the `heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
DEB: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.debTextPre', {
defaultMessage: 'Modify the monitors in the `/etc/heartbeat/heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
RPM: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.rpmTextPre', {
defaultMessage: 'Modify the monitors in the `/etc/heartbeat/heartbeat.yml` file.',
}),
commands: defaultCommands,
textPost: defaultTextPost
},
WINDOWS: {
title: defaultTitle,
textPre: i18n.translate('kbn.common.tutorials.heartbeatEnableCloudInstructions.windowsTextPre', {
defaultMessage: 'From the {path} folder, run:',
values: { path: `C:\\Program Files\\Heartbeat` },
}),
commands: defaultCommands,
textPost: defaultTextPost
}
};
}
export function heartbeatStatusCheck() {
return {
title: i18n.translate('kbn.common.tutorials.heartbeatStatusCheck.title', {
defaultMessage: 'Heartbeat status',
}),
text: i18n.translate('kbn.common.tutorials.heartbeatStatusCheck.text', {
defaultMessage: 'Check that data is received from Heartbeat',
}),
btnLabel: i18n.translate('kbn.common.tutorials.heartbeatStatusCheck.buttonLabel', {
defaultMessage: 'Check data',
}),
success: i18n.translate('kbn.common.tutorials.heartbeatStatusCheck.successText', {
defaultMessage: 'Data successfully received from Heartbeat',
}),
error: i18n.translate('kbn.common.tutorials.heartbeatStatusCheck.errorText', {
defaultMessage: 'No data has been received from Heartbeat yet',
}),
esHitsCheck: {
index: 'heartbeat-*',
query: {
match_all: {},
},
},
};
}
export function onPremInstructions(platforms, geoipRequired, uaRequired, context) {
const HEARTBEAT_INSTRUCTIONS = createHeartbeatInstructions(context);
return {
instructionSets: [
{
title: i18n.translate('kbn.common.tutorials.heartbeat.premInstructions.gettingStarted.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.OSX,
HEARTBEAT_INSTRUCTIONS.CONFIG.OSX,
heartbeatEnableInstructionsOnPrem().OSX,
HEARTBEAT_INSTRUCTIONS.START.OSX,
],
},
{
id: INSTRUCTION_VARIANT.DEB,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.DEB,
HEARTBEAT_INSTRUCTIONS.CONFIG.DEB,
heartbeatEnableInstructionsOnPrem().DEB,
HEARTBEAT_INSTRUCTIONS.START.DEB,
],
},
{
id: INSTRUCTION_VARIANT.RPM,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.RPM,
HEARTBEAT_INSTRUCTIONS.CONFIG.RPM,
heartbeatEnableInstructionsOnPrem().RPM,
HEARTBEAT_INSTRUCTIONS.START.RPM,
],
},
{
id: INSTRUCTION_VARIANT.WINDOWS,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.WINDOWS,
HEARTBEAT_INSTRUCTIONS.CONFIG.WINDOWS,
heartbeatEnableInstructionsOnPrem().WINDOWS,
HEARTBEAT_INSTRUCTIONS.START.WINDOWS,
],
},
],
statusCheck: heartbeatStatusCheck(),
},
],
};
}
export function onPremCloudInstructions() {
const TRYCLOUD_OPTION1 = createTrycloudOption1();
const TRYCLOUD_OPTION2 = createTrycloudOption2();
const HEARTBEAT_INSTRUCTIONS = createHeartbeatInstructions();
return {
instructionSets: [
{
title: i18n.translate('kbn.common.tutorials.heartbeat.premCloudInstructions.gettingStarted.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,
instructions: [
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
HEARTBEAT_INSTRUCTIONS.INSTALL.OSX,
HEARTBEAT_INSTRUCTIONS.CONFIG.OSX,
heartbeatEnableInstructionsCloud().OSX,
HEARTBEAT_INSTRUCTIONS.START.OSX,
],
},
{
id: INSTRUCTION_VARIANT.DEB,
instructions: [
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
HEARTBEAT_INSTRUCTIONS.INSTALL.DEB,
HEARTBEAT_INSTRUCTIONS.CONFIG.DEB,
heartbeatEnableInstructionsCloud().DEB,
HEARTBEAT_INSTRUCTIONS.START.DEB,
],
},
{
id: INSTRUCTION_VARIANT.RPM,
instructions: [
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
HEARTBEAT_INSTRUCTIONS.INSTALL.RPM,
HEARTBEAT_INSTRUCTIONS.CONFIG.RPM,
heartbeatEnableInstructionsCloud().RPM,
HEARTBEAT_INSTRUCTIONS.START.RPM,
],
},
{
id: INSTRUCTION_VARIANT.WINDOWS,
instructions: [
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
HEARTBEAT_INSTRUCTIONS.INSTALL.WINDOWS,
HEARTBEAT_INSTRUCTIONS.CONFIG.WINDOWS,
heartbeatEnableInstructionsCloud().WINDOWS,
HEARTBEAT_INSTRUCTIONS.START.WINDOWS,
],
},
],
statusCheck: heartbeatStatusCheck(),
},
],
};
}
export function cloudInstructions() {
const HEARTBEAT_INSTRUCTIONS = createHeartbeatInstructions();
const HEARTBEAT_CLOUD_INSTRUCTIONS = createHeartbeatCloudInstructions();
return {
instructionSets: [
{
title: i18n.translate('kbn.common.tutorials.heartbeat.cloudInstructions.gettingStarted.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.OSX,
HEARTBEAT_CLOUD_INSTRUCTIONS.CONFIG.OSX,
heartbeatEnableInstructionsCloud().OSX,
HEARTBEAT_INSTRUCTIONS.START.OSX,
],
},
{
id: INSTRUCTION_VARIANT.DEB,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.DEB,
HEARTBEAT_CLOUD_INSTRUCTIONS.CONFIG.DEB,
heartbeatEnableInstructionsCloud().DEB,
HEARTBEAT_INSTRUCTIONS.START.DEB,
],
},
{
id: INSTRUCTION_VARIANT.RPM,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.RPM,
HEARTBEAT_CLOUD_INSTRUCTIONS.CONFIG.RPM,
heartbeatEnableInstructionsCloud().RPM,
HEARTBEAT_INSTRUCTIONS.START.RPM,
],
},
{
id: INSTRUCTION_VARIANT.WINDOWS,
instructions: [
HEARTBEAT_INSTRUCTIONS.INSTALL.WINDOWS,
HEARTBEAT_CLOUD_INSTRUCTIONS.CONFIG.WINDOWS,
heartbeatEnableInstructionsCloud().WINDOWS,
HEARTBEAT_INSTRUCTIONS.START.WINDOWS,
],
},
],
statusCheck: heartbeatStatusCheck(),
},
],
};
}

View file

@ -52,7 +52,8 @@ export function replaceTemplateStrings(text, params = {}) {
base_url: ELASTIC_WEBSITE_URL,
beats: {
filebeat: documentationLinks.filebeat.base,
metricbeat: documentationLinks.metricbeat.base
metricbeat: documentationLinks.metricbeat.base,
heartbeat: documentationLinks.heartbeat.base
},
logstash: documentationLinks.logstash.base,
version: DOC_LINK_VERSION

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

View file

@ -60,6 +60,7 @@ import { golangMetricsSpecProvider } from './golang_metrics';
import { logstashMetricsSpecProvider } from './logstash_metrics';
import { prometheusMetricsSpecProvider } from './prometheus_metrics';
import { zookeeperMetricsSpecProvider } from './zookeeper_metrics';
import { uptimeMonitorsSpecProvider } from './uptime_monitors';
export function registerTutorials(server) {
server.registerTutorial(systemLogsSpecProvider);
@ -105,4 +106,5 @@ export function registerTutorials(server) {
server.registerTutorial(logstashMetricsSpecProvider);
server.registerTutorial(prometheusMetricsSpecProvider);
server.registerTutorial(zookeeperMetricsSpecProvider);
server.registerTutorial(uptimeMonitorsSpecProvider);
}

View file

@ -0,0 +1,63 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/heartbeat_instructions';
export function uptimeMonitorsSpecProvider(server, context) {
return {
id: 'uptimeMonitors',
name: i18n.translate('kbn.server.tutorials.uptimeMonitors.nameTitle', {
defaultMessage: 'Uptime Monitors',
}),
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: i18n.translate('kbn.server.tutorials.uptimeMonitors.shortDescription', {
defaultMessage: 'Monitor services for their availability',
}),
longDescription: i18n.translate('kbn.server.tutorials.uptimeMonitors.longDescription', {
defaultMessage: 'Monitor services for their availability with active probing. \
Given a list of URLs, Heartbeat asks the simple question: Are you alive?. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.heartbeat}/heartbeat-getting-started.html',
},
}),
euiIconType: 'heartbeatApp',
artifacts: {
dashboards: [
{
id: 'f3e771c0-eb19-11e6-be20-559646f8b9ba',
linkLabel: i18n.translate('kbn.server.tutorials.uptimeMonitors.artifacts.dashboards.linkLabel', {
defaultMessage: 'Heartbeat dashboard',
}),
isOverview: true
}
],
exportedFields: {
documentationUrl: '{config.docs.beats.heartbeat}/exported-fields.html'
}
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/uptime_monitors/screenshot.png',
onPrem: onPremInstructions(null, null, null, context),
elasticCloud: cloudInstructions(),
onPremElasticCloud: onPremCloudInstructions()
};
}

View file

@ -35,6 +35,9 @@ export const documentationLinks = {
metricbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`,
},
heartbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/heartbeat/${DOC_LINK_VERSION}`,
},
logstash: {
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
},