Skip to content

Commit

Permalink
[APM] Add Java agent tutorial (elastic#20453)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbarny authored Jul 4, 2018
1 parent 0dff5c9 commit 1002aed
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const INSTRUCTION_VARIANT = {
RACK: 'rack',
JS: 'js',
GO: 'go',
JAVA: 'java',
};

const DISPLAY_MAP = {
Expand All @@ -45,6 +46,7 @@ const DISPLAY_MAP = {
[INSTRUCTION_VARIANT.RACK]: 'Rack',
[INSTRUCTION_VARIANT.JS]: 'JS',
[INSTRUCTION_VARIANT.GO]: 'Go',
[INSTRUCTION_VARIANT.JAVA]: 'Java',
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-<version>.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.**',
},
];
5 changes: 5 additions & 0 deletions src/core_plugins/kibana/server/tutorials/apm/elastic_cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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],
},
],
},
],
Expand Down
5 changes: 5 additions & 0 deletions src/core_plugins/kibana/server/tutorials/apm/on_prem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 1002aed

Please sign in to comment.