N|Solid Runtime Configuration
Environment Variables
The N|Solid runtime can be configured via the environment variables listed below. Although each of these environment variables are optional, certain features will be missing or limited in each case. It is recommended that you connect to the console using NSOLID_COMMAND
or a StatsD collector using NSOLID_STATSD
, and customize your process using any of the remaining environment variables.
Environment Variable | Description |
---|---|
NSOLID_COMMAND | The route to the console command port. It should be formatted as "host:port". The default host is localhost , and the default port is 9001 . Without this environment variable, the N|Solid Agent will not attempt to connect. The host can be provided via several formats: IPv4 10.0.0.21 IPv6 [2001:cdba::3257:9652] hostname nsolid_hub.local |
NSOLID_APPNAME | The name of the application that the instance is running. Use this in order to create logical groupings of the processes in the console. If omitted, the value defaults to the name field of your package.json. If this is also omitted, the value defaults to untitled application |
NSOLID_TAGS | The list of tags associated with your instance, which can be used to identify and filter instances in Console views. See Tags and Filters for more details |
NSOLID_PUBKEY | The ZMQ public key used with the N|Solid Console server |
NSOLID_HOSTNAME | The hostname the N|Solid process is running on (overrides system-determined hostname) |
NSOLID_STATSD | The route to a StatsD collector if you wish to send metrics directly to an external data collection service from the N|Solid process. Without this environment variable, the N|Solid Agent will not attempt to send StatsD data. It should be formatted as "host:port". If unspecified, the default host is localhost and port is 8125 . Hosts and IP addresses are accepted in the same format as NSOLID_COMMAND |
NSOLID_INTERVAL | The interval, in milliseconds, in which the N|Solid Agent will collect and report metrics to the console and/or the StatsD collector if either are connected. This value defaults to 3000 (3 seconds) and cannot be lower than 1000 |
NSOLID_OTLP | It defines the type of OTLP endpoint we want N |
NSOLID_OTLP_CONFIG | Specific configuration for the OTLP endpoint tye defined with NSOLID_OTLP . See the OpenTelemetry section for more details |
NSOLID_STATSD_BUCKET | An override for the default StatsD bucket (key prefix) when using the NSOLID_STATSD functionality. See the StatsD section for more details |
NSOLID_STATSD_TAGS | Optional tags to append to StatsD metric data when using the NSOLID_STATSD functionality. See the StatsD section for more details |
NSOLID_TRACING_ENABLED | Boolean to indicate if you want N|Solid to generate traces when connected to an endpoint that supports it. See the Tracing section for more details |
NSOLID_TRACING_MODULES_BLACKLIST | List of core modules instrumented by N|Solid you want to disable when tracing is enabled. See the Tracing section for more details |
NSOLID_REDACT_SNAPSHOTS | Boolean to indicate if you want heap snapshots to obscure string variable contents. This may impede your ability to debug and is meant for sensitive production environments. |
package.json
The N|Solid process can also be configured via an nsolid
object in the package.json file for the current application. Environment variable values override the properties in the package.json file. The mapping of nsolid
object properties in the package.json file to environment variables is as follows:
nsolid property in package.json | Environment Variable |
---|---|
command | NSOLID_COMMAND |
pubkey | NSOLID_PUBKEY |
statsd | NSOLID_STATSD |
statsdBucket | NSOLID_STATSD_BUCKET |
statsdTags | NSOLID_STATSD_TAGS |
otlp | NSOLID_OTLP |
otlpConfig | NSOLID_OTLP_CONFIG |
tracingEnabled | NSOLID_TRACING_ENABLED |
tracingModulesBlacklist | NSOLID_TRACING_MODULES_BLACKLIST |
hostname | NSOLID_HOSTNAME |
env | NODE_ENV |
interval | NSOLID_INTERVAL |
tags | NSOLID_TAGS - this may be an array of tag values or a comma-separated string of tag values |
app | NSOLID_APPNAME |
Example package.json:
# package.json
{
"name": "message-service",
"version": "1.0.0",
"nsolid": {
"env": "production",
"command": "nsolid-command-host.local:9001",
"app": "messaging",
"tags": "aws, mq"
}
}
N|Solid CLI
Configuration File
The N|Solid Command Line Interface (CLI) can be configured via a configuration file, .nsolid-clirc.
# .nsolid-clirc
{
"remote": "http://localhost:6753",
"app": "my-node-application"
}