"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createRailsAgentInstructions = exports.createRackAgentInstructions = exports.createPhpAgentInstructions = exports.createOpenTelemetryAgentInstructions = exports.createNodeAgentInstructions = exports.createJsAgentInstructions = exports.createJavaAgentInstructions = exports.createGoAgentInstructions = exports.createFlaskAgentInstructions = exports.createDotNetAgentInstructions = exports.createDjangoAgentInstructions = void 0; var _i18n = require("@kbn/i18n"); /* * 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. */ const createNodeAgentInstructions = (apmServerUrl = '', secretToken = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.nodeClient.install.title', { defaultMessage: 'Install the APM agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.nodeClient.install.textPre', { defaultMessage: 'Install the APM agent for Node.js as a dependency to your application.' }), commands: ['npm install elastic-apm-node --save'] }, { title: _i18n.i18n.translate('xpack.apm.tutorial.nodeClient.configure.title', { defaultMessage: 'Configure the agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.nodeClient.configure.textPre', { defaultMessage: 'Agents are libraries that run inside of your application process. \ APM services are created programmatically based on the `serviceName`. \ This agent supports a variety of frameworks but can also be used with your custom stack.' }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.nodeClient.configure.textPost', { defaultMessage: 'See [the documentation]({documentationLink}) for advanced usage, including how to use with \ [Babel/ES Modules]({babelEsModulesLink}).', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/nodejs/current/index.html', babelEsModulesLink: '{config.docs.base_url}guide/en/apm/agent/nodejs/current/advanced-setup.html#es-modules' } }) }]; exports.createNodeAgentInstructions = createNodeAgentInstructions; const createDjangoAgentInstructions = (apmServerUrl = '', secretToken = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.djangoClient.install.title', { defaultMessage: 'Install the APM agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.djangoClient.install.textPre', { defaultMessage: 'Install the APM agent for Python as a dependency.' }), commands: ['$ pip install elastic-apm'] }, { title: _i18n.i18n.translate('xpack.apm.tutorial.djangoClient.configure.title', { defaultMessage: 'Configure the agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.djangoClient.configure.textPre', { defaultMessage: 'Agents are libraries that run inside of your application process. \ APM services are created programmatically based on the `SERVICE_NAME`.' }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.djangoClient.configure.textPost', { defaultMessage: 'See the [documentation]({documentationLink}) for advanced usage.', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/python/current/django-support.html' } }) }]; exports.createDjangoAgentInstructions = createDjangoAgentInstructions; const createFlaskAgentInstructions = (apmServerUrl = '', secretToken = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.flaskClient.install.title', { defaultMessage: 'Install the APM agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.flaskClient.install.textPre', { defaultMessage: 'Install the APM agent for Python as a dependency.' }), commands: ['$ pip install elastic-apm[flask]'] }, { title: _i18n.i18n.translate('xpack.apm.tutorial.flaskClient.configure.title', { defaultMessage: 'Configure the agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.flaskClient.configure.textPre', { defaultMessage: 'Agents are libraries that run inside of your application process. \ APM services are created programmatically based on the `SERVICE_NAME`.' }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.flaskClient.configure.textPost', { defaultMessage: 'See the [documentation]({documentationLink}) for advanced usage.', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/python/current/flask-support.html' } }) }]; exports.createFlaskAgentInstructions = createFlaskAgentInstructions; const createRailsAgentInstructions = (apmServerUrl = '', secretToken = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.railsClient.install.title', { defaultMessage: 'Install the APM agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.railsClient.install.textPre', { defaultMessage: 'Add the agent to your Gemfile.' }), commands: [`gem 'elastic-apm'`] }, { title: _i18n.i18n.translate('xpack.apm.tutorial.railsClient.configure.title', { defaultMessage: 'Configure the agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.railsClient.configure.textPre', { defaultMessage: 'APM is automatically started when your app boots. Configure the agent, by creating the config file {configFile}', values: { configFile: '`config/elastic_apm.yml`' } }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.railsClient.configure.textPost', { defaultMessage: 'See the [documentation]({documentationLink}) for configuration options and advanced usage.\n\n', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/ruby/current/index.html' } }) }]; exports.createRailsAgentInstructions = createRailsAgentInstructions; const createRackAgentInstructions = (apmServerUrl = '', secretToken = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.install.title', { defaultMessage: 'Install the APM agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.install.textPre', { defaultMessage: 'Add the agent to your Gemfile.' }), commands: [`gem 'elastic-apm'`] }, { title: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.configure.title', { defaultMessage: 'Configure the agent' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.configure.textPre', { defaultMessage: 'For Rack or a compatible framework (e.g. Sinatra), include the middleware in your app and start the agent.' }), commands: `# config.ru require 'sinatra/base' class MySinatraApp < Sinatra::Base use ElasticAPM::Middleware # ... end ElasticAPM.start( app: MySinatraApp, # ${_i18n.i18n.translate('xpack.apm.tutorial.rackClient.configure.commands.requiredComment', { defaultMessage: 'required' })} config_file: '' # ${_i18n.i18n.translate('xpack.apm.tutorial.rackClient.configure.commands.optionalComment', { defaultMessage: 'optional, defaults to config/elastic_apm.yml' })} ) run MySinatraApp at_exit {curlyOpen} ElasticAPM.stop {curlyClose}`.split('\n') }, { title: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.createConfig.title', { defaultMessage: 'Create config file' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.createConfig.textPre', { defaultMessage: 'Create a config file {configFile}:', values: { configFile: '`config/elastic_apm.yml`' } }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.rackClient.createConfig.textPost', { defaultMessage: 'See the [documentation]({documentationLink}) for configuration options and advanced usage.\n\n', values: { documentationLink: '{config.docs.base_url}guide/en/apm/agent/ruby/current/index.html' } }) }]; exports.createRackAgentInstructions = createRackAgentInstructions; const createJsAgentInstructions = (apmServerUrl = '') => [{ title: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.enableRealUserMonitoring.title', { defaultMessage: 'Enable Real User Monitoring support in APM Server' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.enableRealUserMonitoring.textPre', { defaultMessage: 'APM Server disables RUM support by default. See the [documentation]({documentationLink}) \ for details on how to enable RUM support. When using the APM integration with Fleet, RUM support is automatically enabled.', values: { documentationLink: '{config.docs.base_url}guide/en/apm/guide/{config.docs.version}/configuration-rum.html' } }) }, { title: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.installDependency.title', { defaultMessage: 'Set up the Agent as a dependency' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.installDependency.textPre', { defaultMessage: 'You can install the Agent as a dependency to your application with \ `npm install @elastic/apm-rum --save`.\n\n\ The Agent can then be initialized and configured in your application like this:' }), customComponentName: 'TutorialConfigAgent', textPost: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.installDependency.textPost', { defaultMessage: 'Framework integrations, like React or Angular, have custom dependencies. \ See the [integration documentation]({docLink}) for more information.', values: { docLink: '{config.docs.base_url}guide/en/apm/agent/rum-js/current/framework-integrations.html' } }) }, { title: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.scriptTags.title', { defaultMessage: 'Set up the Agent with Script Tags' }), textPre: _i18n.i18n.translate('xpack.apm.tutorial.jsClient.scriptTags.textPre', { defaultMessage: "Alternatively, you can use Script tags to set up and configure the Agent. \ Add a `