Skip to content

Commit

Permalink
[APM] Fix issue with onboarding page around java agent (#168816)
Browse files Browse the repository at this point in the history
## Summary

Closes - #168659
Closes - #168348

### After

<img width="1266" alt="Screenshot 2023-10-13 at 10 27 44"
src="https://github.com/elastic/kibana/assets/7416358/494d9a2c-fd69-4ee9-b8a3-dcebef04beb0">
  • Loading branch information
achyutjhunjhunwala authored Oct 13, 2023
1 parent 71c889e commit b98d7fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ describe('getCommands', () => {
});
expect(commands).toMatchInlineSnapshot(`
"java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\\\
-Delastic.apm.service_name=<your-service-name> \\\\\\\\
-Delastic.apm.service_name=<your-service-name> \\\\
-Delastic.apm.api_key= \\\\
-Delastic.apm.server_url= \\\\
-Delastic.apm.environment=<your-environment> \\\\\\\\
-Delastic.apm.environment=<your-environment> \\\\
-Delastic.apm.application_packages=org.example \\\\
-jar my-service-name.jar"
`);
Expand All @@ -42,10 +42,10 @@ describe('getCommands', () => {
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
"java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\\\
-Delastic.apm.service_name=<your-service-name> \\\\\\\\
-Delastic.apm.service_name=<your-service-name> \\\\
-Delastic.apm.secret_token=foobar \\\\
-Delastic.apm.server_url=localhost:8220 \\\\
-Delastic.apm.environment=<your-environment> \\\\\\\\
-Delastic.apm.environment=<your-environment> \\\\
-Delastic.apm.application_packages=org.example \\\\
-jar my-service-name.jar"
`);
Expand All @@ -60,10 +60,10 @@ describe('getCommands', () => {
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
"java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\\\
-Delastic.apm.service_name=<your-service-name> \\\\\\\\
-Delastic.apm.service_name=<your-service-name> \\\\
-Delastic.apm.secret_token=foobar \\\\
-Delastic.apm.server_url=localhost:8220 \\\\
-Delastic.apm.environment=<your-environment> \\\\\\\\
-Delastic.apm.environment=<your-environment> \\\\
-Delastic.apm.application_packages=org.example \\\\
-jar my-service-name.jar"
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
*/

import {
serviceNameHint,
apiKeyHint,
secretTokenHint,
serverUrlHint,
serviceEnvironmentHint,
apiKeyHint,
serviceNameHint,
} from './shared_hints';

export const javaVariables = (secretToken?: string) => ({
...(secretToken && { secretToken: 'Delastic.apm.secret_token' }),
...(!secretToken && { apiKey: 'Delastic.apm.api_key' }),
apmServerUrl: 'Delastic.apm.server_url',
...(secretToken && { secretToken: 'elastic.apm.secret_token' }),
...(!secretToken && { apiKey: 'elastic.apm.api_key' }),
apmServerUrl: 'elastic.apm.server_url',
});

export const javaHighlightLang = 'java';
Expand All @@ -32,14 +32,14 @@ export const javaLineNumbers = (apiKey?: string | null) => ({
},
});
export const java = `java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\
-Delastic.apm.service_name=<your-service-name> \\\\
-Delastic.apm.service_name=<your-service-name> \\
{{^secretToken}}
-Delastic.apm.api_key={{{apiKey}}} \\
{{/secretToken}}
{{#secretToken}}
-Delastic.apm.secret_token={{{secretToken}}} \\
{{/secretToken}}
-Delastic.apm.server_url={{{apmServerUrl}}} \\
-Delastic.apm.environment=<your-environment> \\\\
-Delastic.apm.environment=<your-environment> \\
-Delastic.apm.application_packages=org.example \\
-jar my-service-name.jar`;

0 comments on commit b98d7fb

Please sign in to comment.