Installs and configures App Insights in your NodeJS app.
This generator will add and configure applicationinsights npm package for you.
- Requires a NodeJs server for application insights to hook into.
Use the @nrwl/next:custom-server generator which will have been added to your workspace by @ensono-stacks/workspace` to generate your NodeJS server!
- It requires the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable to be set.
There is a known issue with the
@nrwl/next:custom-server impacting customServerTarget when typescript libraries are present in the monorepo. Please check the following Github Issue for the status of this issue.
nx generate @ensono-stacks/azure-node:app-insights
Command line arguments
The following command line arguments are available:
|--project||Target project name.||string|
|--appInsightsKey||The env variable that stores the app insights key.||string|
|--server||Path to custom server file inside the project.||string|
main()function in the server file to initialise and configure app insights.