From 1002aed3c37f0369d68e9c883e9aa7734fe3502e Mon Sep 17 00:00:00 2001 From: Felix Barnsteiner Date: Wed, 4 Jul 2018 13:28:35 +0200 Subject: [PATCH] [APM] Add Java agent tutorial (#20453) --- .../common/tutorials/instruction_variant.js | 2 ++ .../tutorials/apm/apm_client_instructions.js | 25 +++++++++++++++++++ .../server/tutorials/apm/elastic_cloud.js | 5 ++++ .../kibana/server/tutorials/apm/on_prem.js | 5 ++++ 4 files changed, 37 insertions(+) diff --git a/src/core_plugins/kibana/common/tutorials/instruction_variant.js b/src/core_plugins/kibana/common/tutorials/instruction_variant.js index b1b4d1b8f17a..3b62c5d637c2 100644 --- a/src/core_plugins/kibana/common/tutorials/instruction_variant.js +++ b/src/core_plugins/kibana/common/tutorials/instruction_variant.js @@ -30,6 +30,7 @@ export const INSTRUCTION_VARIANT = { RACK: 'rack', JS: 'js', GO: 'go', + JAVA: 'java', }; const DISPLAY_MAP = { @@ -45,6 +46,7 @@ const DISPLAY_MAP = { [INSTRUCTION_VARIANT.RACK]: 'Rack', [INSTRUCTION_VARIANT.JS]: 'JS', [INSTRUCTION_VARIANT.GO]: 'Go', + [INSTRUCTION_VARIANT.JAVA]: 'Java', }; /** diff --git a/src/core_plugins/kibana/server/tutorials/apm/apm_client_instructions.js b/src/core_plugins/kibana/server/tutorials/apm/apm_client_instructions.js index 72794242e289..d9019a534e13 100644 --- a/src/core_plugins/kibana/server/tutorials/apm/apm_client_instructions.js +++ b/src/core_plugins/kibana/server/tutorials/apm/apm_client_instructions.js @@ -287,3 +287,28 @@ func main() {curlyOpen} '**Warning: The Go agent is currently in Beta and not meant for production use.**', }, ]; + +export const JAVA_CLIENT_INSTRUCTIONS = [ + { + title: 'Download the APM agent', + textPre: 'Download the agent jar from [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3Aelastic-apm-agent). ' + + 'Do **not** add the agent as a dependency to your application.' + }, + { + title: 'Start your application with the javaagent flag', + textPre: 'Add the `-javaagent` flag and configure the agent with system properties.\n' + + '\n' + + ' * Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space)\n' + + ' * Set custom APM Server URL (default: http://localhost:8200)\n' + + ' * Set the base package of your application', + commands: `java -javaagent:/path/to/elastic-apm-agent-.jar \\ + -Delastic.apm.service_name=my-application \\ + -Delastic.apm.server_url=http://localhost:8200 \\ + -Delastic.apm.application_packages=org.example \\ + -jar my-application.jar`.split('\n'), + textPost: + 'See the [documentation]' + + '({config.docs.base_url}guide/en/apm/agent/java/current/index.html) for configuration options and advanced usage.\n\n' + + '**Warning: The Java agent is currently in Beta and not meant for production use.**', + }, +]; diff --git a/src/core_plugins/kibana/server/tutorials/apm/elastic_cloud.js b/src/core_plugins/kibana/server/tutorials/apm/elastic_cloud.js index b1d5b49a716b..a7bf9fa012fd 100644 --- a/src/core_plugins/kibana/server/tutorials/apm/elastic_cloud.js +++ b/src/core_plugins/kibana/server/tutorials/apm/elastic_cloud.js @@ -27,6 +27,7 @@ import { RACK_CLIENT_INSTRUCTIONS, JS_CLIENT_INSTRUCTIONS, GO_CLIENT_INSTRUCTIONS, + JAVA_CLIENT_INSTRUCTIONS, } from './apm_client_instructions'; const SERVER_URL_INSTRUCTION = { @@ -69,6 +70,10 @@ export const ELASTIC_CLOUD_INSTRUCTIONS = { id: INSTRUCTION_VARIANT.GO, instructions: [SERVER_URL_INSTRUCTION, ...GO_CLIENT_INSTRUCTIONS], }, + { + id: INSTRUCTION_VARIANT.JAVA, + instructions: [SERVER_URL_INSTRUCTION, ...JAVA_CLIENT_INSTRUCTIONS], + }, ], }, ], diff --git a/src/core_plugins/kibana/server/tutorials/apm/on_prem.js b/src/core_plugins/kibana/server/tutorials/apm/on_prem.js index f05575bcff27..162dc8b1d681 100644 --- a/src/core_plugins/kibana/server/tutorials/apm/on_prem.js +++ b/src/core_plugins/kibana/server/tutorials/apm/on_prem.js @@ -35,6 +35,7 @@ import { RACK_CLIENT_INSTRUCTIONS, JS_CLIENT_INSTRUCTIONS, GO_CLIENT_INSTRUCTIONS, + JAVA_CLIENT_INSTRUCTIONS, } from './apm_client_instructions'; export function onPremInstructions(server) { @@ -135,6 +136,10 @@ export function onPremInstructions(server) { id: INSTRUCTION_VARIANT.GO, instructions: GO_CLIENT_INSTRUCTIONS, }, + { + id: INSTRUCTION_VARIANT.JAVA, + instructions: JAVA_CLIENT_INSTRUCTIONS, + }, ], statusCheck: { title: 'Agent status',