Configurations
You can set following configurations in the Node.js agent.
Sample Node.js agent configurations:
You can pass above configurations in two ways
- Environment variables
- atatus.start function (in atatus.js)
atatus.js file in your project root and configure the agent there. Start your application with node -r ./atatus.js ./app/server.js.
Enable/Disable Agent
If you would like to enable or disable atatus agent at runtime, you can do so by controling the enabled varilable dynamically. In atatus.jsSet app version
If you use an appVersion to identify releases of your app, you can send it to Atatus. It is highly recommended to set appVersion. In atatus.jsConfigure a custom host name
By default, we will fetch the host name using node.js os.hostname(), but you can override this as follows: In atatus.jsSet environment
By default, Atatus looks at theNODE_ENV environment variable to see what environment the script is running in. If that is not set, Atatus assumes you are running in production. If you want to override this, you can set the environment options.
In atatus.js
Set analytics
App Analytics collects all requests individually with contextual data. In atatus.jsSet logBody
By default, Atatus Analytics does not capture request and response bodies. However, if you want to capture them, you can enable the appropriate options during Atatus initialization. Please note that this option is only applicable to Analytics and not to APM.request- Only the request body is captured in analytics.response- Only the response body is captured in analytics.all- Both the request and response bodies are captured in analytics.
Set analytics outgoing request
By default, Atatus Analytics does not capture outgoing requests. However, if you want to capture them, you can enable the appropriate options during Atatus initialization. Please note that this option is only applicable to Analytics and not to APM. In atatus.jsSet skip function
Theskip function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus.
In atatus.js
Set analytics skip function
TheanalyticsSkip function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus.
In atatus.js
Set analytics mask function
TheanalyticsMask function allows you to modify the request/response headers, body, or query parameters before they are sent to Atatus. You can utilize this function to make alterations such as removing specific header or body fields. It will give you the flexibility to customize the request data that is ultimately sent to Atatus.
In atatus.js
Set log body content types
ThelogBodyContentTypes option allows capturing the response body for specific content types in API analytics.
In atatus.js
Add tags
It is often very useful to send some extra information along with the errors and performance metrics so that you can filter them in the Atatus dashboard. To do this, you can set thetags:
In atatus.js
Add custom data
To debug errors effectively, you can send some meta data along with errors. To do this, you can set thecustomData:
In atatus.js
Ignore URL
Using this option, you can define list of URLs that Atatus agent will ignore. Ignore URLs accepts array of string or Regex. In atatus.jsIgnore User Agents
Using this option, you can define list of User-Agents that Atatus agent will ignore. Ignore user agents accepts array of string or Regex. In atatus.jsIgnore Error Status Codes
If you want to ignore certain status codes from HTTP failures, you can use this option. Ignore status codes accepts array of integer. In atatus.jsSet proxy configuration
You can use a proxy server by configuring a proxy URL when starting with Atatus. In atatus.jsSet Log Level
You can enable detailed logging in Atatus by setting the log level todebug. This helps in troubleshooting by printing internal logs to the console.
In atatus.js