mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[APM] Link to APM Server setup in APM Getting started guide (#34786)
This commit is contained in:
parent
d733a8950c
commit
aff8c69deb
3 changed files with 79 additions and 39 deletions
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
export const INSTRUCTION_VARIANT = {
|
||||
ESC: 'esc',
|
||||
OSX: 'osx',
|
||||
DEB: 'deb',
|
||||
RPM: 'rpm',
|
||||
|
@ -35,6 +36,7 @@ export const INSTRUCTION_VARIANT = {
|
|||
};
|
||||
|
||||
const DISPLAY_MAP = {
|
||||
[INSTRUCTION_VARIANT.ESC]: 'Elastic Cloud',
|
||||
[INSTRUCTION_VARIANT.OSX]: 'macOS',
|
||||
[INSTRUCTION_VARIANT.DEB]: 'DEB',
|
||||
[INSTRUCTION_VARIANT.RPM]: 'RPM',
|
||||
|
|
|
@ -37,49 +37,86 @@ function getIfExists(config, key) {
|
|||
|
||||
export function createElasticCloudInstructions(config) {
|
||||
const apmServerUrl = getIfExists(config, 'xpack.cloud.apm.url');
|
||||
const secretToken = getIfExists(config, 'xpack.cloud.apm.secret_token');
|
||||
const instructionSets = [];
|
||||
|
||||
if (!apmServerUrl) {
|
||||
instructionSets.push(getApmServerInstructionSet(config));
|
||||
}
|
||||
|
||||
instructionSets.push(getApmAgentInstructionSet(config));
|
||||
|
||||
return {
|
||||
instructionSets: [
|
||||
instructionSets,
|
||||
};
|
||||
}
|
||||
|
||||
function getApmServerInstructionSet(config) {
|
||||
const apmUiUrl = getIfExists(config, 'xpack.cloud.apm.ui.url');
|
||||
return {
|
||||
title: i18n.translate('kbn.server.tutorials.apm.apmServer.title', {
|
||||
defaultMessage: 'APM Server',
|
||||
}),
|
||||
instructionVariants: [
|
||||
{
|
||||
title: i18n.translate('kbn.server.tutorials.apm.elasticCloudInstructions.title', {
|
||||
defaultMessage: 'APM Agents',
|
||||
}),
|
||||
instructionVariants: [
|
||||
id: INSTRUCTION_VARIANT.ESC,
|
||||
instructions: [
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.NODE,
|
||||
instructions: createNodeAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.DJANGO,
|
||||
instructions: createDjangoAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.FLASK,
|
||||
instructions: createFlaskAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.RAILS,
|
||||
instructions: createRailsAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.RACK,
|
||||
instructions: createRackAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.JS,
|
||||
instructions: createJsAgentInstructions(apmServerUrl),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.GO,
|
||||
instructions: createGoAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.JAVA,
|
||||
instructions: createJavaAgentInstructions(apmServerUrl, secretToken),
|
||||
title: 'Enable the APM Server in the ESS console',
|
||||
textPre: i18n.translate('kbn.server.tutorials.apm.elasticCloud.textPre', {
|
||||
defaultMessage:
|
||||
'To enable the APM Server go to [the ESS console]({essConsoleLink}). Once enabled, refresh this page.',
|
||||
values: {
|
||||
essConsoleLink: apmUiUrl,
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function getApmAgentInstructionSet(config) {
|
||||
const apmServerUrl = getIfExists(config, 'xpack.cloud.apm.url');
|
||||
const secretToken = getIfExists(config, 'xpack.cloud.apm.secret_token');
|
||||
|
||||
return {
|
||||
title: i18n.translate('kbn.server.tutorials.apm.elasticCloudInstructions.title', {
|
||||
defaultMessage: 'APM Agents',
|
||||
}),
|
||||
instructionVariants: [
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.NODE,
|
||||
instructions: createNodeAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.DJANGO,
|
||||
instructions: createDjangoAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.FLASK,
|
||||
instructions: createFlaskAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.RAILS,
|
||||
instructions: createRailsAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.RACK,
|
||||
instructions: createRackAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.JS,
|
||||
instructions: createJsAgentInstructions(apmServerUrl),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.GO,
|
||||
instructions: createGoAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
{
|
||||
id: INSTRUCTION_VARIANT.JAVA,
|
||||
instructions: createJavaAgentInstructions(apmServerUrl, secretToken),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,9 +14,10 @@ export const cloud = kibana => {
|
|||
|
||||
uiExports: {
|
||||
injectDefaultVars(server, options) {
|
||||
options.id = 'test-cloud-id';
|
||||
return {
|
||||
isCloudEnabled: !!options.id,
|
||||
cloudId: options.id
|
||||
cloudId: options.id,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
@ -38,9 +39,9 @@ export const cloud = kibana => {
|
|||
init(server) {
|
||||
const config = server.config().get(`xpack.cloud`);
|
||||
server.expose('config', {
|
||||
isCloudEnabled: !!config.id
|
||||
isCloudEnabled: !!config.id,
|
||||
});
|
||||
server.usage.collectorSet.register(getCloudUsageCollector(server));
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue