Adds Elastic APM instrumentation to your application
gasket create <app-name> --plugins @gasket/plugin-elastic-apm
npm i @gasket/plugin-elastic-apm
Modify plugins
section of your gasket.config.js
:
module.exports = {
plugins: {
add: [
+ '@gasket/plugin-elastic-apm'
]
}
}
Configurations for the plugin can be added under elasticAPM
in the config.
This object accepts the same properties as the Elastic APM Node.js agent. (See
the configuration options documentation)
module.exports = {
plugins: {
add: ['@gasket/plugin-elastic-apm']
},
elasticAPM: {
secretToken: '****',
serverUrl: 'http://localhost:9200'
}
}
You may also configure the APM agent with environment variables (e.g:
ELASTIC_APM_SERVER_URL
) instead of using the config object. These environment
variables are also described in the configuration options documentation.
The APM server URL (as either elasticAPM.serverUrl
or
ELASTIC_APM_SERVER_URL
) and secret token (as either elasticAPM.secretToken
or ELASTIC_APM_SECRET_TOKEN
) are both required configuration fields. If either
of these are not present, the APM agent will be disabled.
If your application’s users send session credentials or any other sensitive
information in their cookies, you may wish to filter them out before they are
stored in Elasticsearch. Specify a list of cookie names to redact in
gasket.config.js
:
module.exports = {
elasticAPM: {
sensitiveCookies: ['my_jwt', 'userFullName']
}
};
This plugins hooks the preboot lifecycle from [@gasket/plugin-start].