forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'apm-tutorial-token' of github.com:cauemarcondes/kibana …
…into apm-tutorial-storybook
- Loading branch information
Showing
29 changed files
with
2,052 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
x-pack/plugins/apm/public/tutorial/config_agent/commands/django.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const django = `# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.addAgentComment', | ||
{ | ||
defaultMessage: 'Add the agent to the installed apps', | ||
} | ||
)} | ||
INSTALLED_APPS = ( | ||
'elasticapm.contrib.django', | ||
# ... | ||
) | ||
ELASTIC_APM = {curlyOpen} | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.setRequiredServiceNameComment', | ||
{ | ||
defaultMessage: 'Set the required service name. Allowed characters:', | ||
} | ||
)} | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.allowedCharactersComment', | ||
{ | ||
defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', | ||
} | ||
)} | ||
'SERVICE_NAME': '', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.useIfApmServerRequiresTokenComment', | ||
{ | ||
defaultMessage: 'Use if APM Server requires a secret token', | ||
} | ||
)} | ||
'SECRET_TOKEN': '{{{secretToken}}}', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment', | ||
{ | ||
defaultMessage: | ||
'Set the custom APM Server URL (default: {defaultApmServerUrl})', | ||
values: { defaultApmServerUrl: 'http://localhost:8200' }, | ||
} | ||
)} | ||
'SERVER_URL': '{{{apmServerUrl}}}', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.setServiceEnvironmentComment', | ||
{ | ||
defaultMessage: 'Set the service environment', | ||
} | ||
)} | ||
'ENVIRONMENT': 'production', | ||
{curlyClose} | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.djangoClient.configure.commands.addTracingMiddlewareComment', | ||
{ | ||
defaultMessage: 'To send performance metrics, add our tracing middleware:', | ||
} | ||
)} | ||
MIDDLEWARE = ( | ||
'elasticapm.contrib.django.middleware.TracingMiddleware', | ||
#... | ||
)`; |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/apm/public/tutorial/config_agent/commands/dotnet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
export const dotnet = `{ | ||
"ElasticApm": { | ||
"SecretToken": "{{{secretToken}}}", | ||
"ServerUrls": "{{{apmServerUrl}}}", //Set custom APM Server URL (default: http://localhost:8200) | ||
"ServiceName": "MyApp", //allowed characters: a-z, A-Z, 0-9, -, _, and space. Default is the entry assembly of the application | ||
"Environment": "production", // Set the service environment | ||
} | ||
}`; |
70 changes: 70 additions & 0 deletions
70
x-pack/plugins/apm/public/tutorial/config_agent/commands/flask.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const flask = `# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.initializeUsingEnvironmentVariablesComment', | ||
{ | ||
defaultMessage: 'initialize using environment variables', | ||
} | ||
)} | ||
from elasticapm.contrib.flask import ElasticAPM | ||
app = Flask(__name__) | ||
apm = ElasticAPM(app) | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.configureElasticApmComment', | ||
{ | ||
defaultMessage: | ||
"or configure to use ELASTIC_APM in your application's settings", | ||
} | ||
)} | ||
from elasticapm.contrib.flask import ElasticAPM | ||
app.config['ELASTIC_APM'] = {curlyOpen} | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.setRequiredServiceNameComment', | ||
{ | ||
defaultMessage: 'Set the required service name. Allowed characters:', | ||
} | ||
)} | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.allowedCharactersComment', | ||
{ | ||
defaultMessage: 'a-z, A-Z, 0-9, -, _, and space', | ||
} | ||
)} | ||
'SERVICE_NAME': '', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.useIfApmServerRequiresTokenComment', | ||
{ | ||
defaultMessage: 'Use if APM Server requires a secret token', | ||
} | ||
)} | ||
'SECRET_TOKEN': '{{{secretToken}}}', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.setCustomApmServerUrlComment', | ||
{ | ||
defaultMessage: | ||
'Set the custom APM Server URL (default: {defaultApmServerUrl})', | ||
values: { defaultApmServerUrl: 'http://localhost:8200' }, | ||
} | ||
)} | ||
'SERVER_URL': '{{{apmServerUrl}}}', | ||
# ${i18n.translate( | ||
'xpack.apm.tutorial.flaskClient.configure.commands.setServiceEnvironmentComment', | ||
{ | ||
defaultMessage: 'Set the service environment', | ||
} | ||
)} | ||
'ENVIRONMENT': 'production', | ||
{curlyClose} | ||
apm = ElasticAPM(app)`; |
Oops, something went wrong.