This page describes the available configurations for the Atatus Node.js Agent.

Configurations

You can set following configurations in the Node.js agent. Sample Node.js agent configurations:
Node.js agent configurations in the environment: You can pass above configurations in two ways
  1. Environment variables
  2. atatus.start function (in atatus.js)
Create an 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.js

Set 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.js
Option 2: In Environment

​Configure 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.js
Option 2: In Environment

Set environment

By default, Atatus looks at the NODE_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
Option 2: In Environment

Set analytics

App Analytics collects all requests individually with contextual data. In atatus.js
Option 2: In Environment

Set 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.
In atatus.js
Option 2: In Environment

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.js
Option 2: In Environment

Set skip function

The skip function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus. In atatus.js

Set analytics skip function

The analyticsSkip function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus. In atatus.js

Set analytics mask function

The analyticsMask 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

The logBodyContentTypes 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 the tags: 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 the customData: 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.js

Ignore 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.js

Ignore 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.js

Set proxy configuration

You can use a proxy server by configuring a proxy URL when starting with Atatus. In atatus.js

Set Log Level

You can enable detailed logging in Atatus by setting the log level to debug. This helps in troubleshooting by printing internal logs to the console. In atatus.js
Option 2: Using Environment Variables

Set capture Logs

Enables automatic log collection from supported logging libraries. In atatus.js
Option 2: In Environment

Set Excluded Log Libraries

Specifies which log libraries should be excluded from automatic log capturing. In atatus.js
Option 2: In Environment