Telemetry config settings
Initialization¶
When a node is run using the algod command, before the script starts the server, it configures its telemetry based on the appropriate logging.config file. The algoh command, which hosts algod, configures logging and telemetry before calling algod. Both of these commands can override the config fileās telemetry enable fieldās value using the -t flag. When a nodeās telemetry is enabled, a telemetry state (which wraps the nodeās hook for the elasticsearch server to which the logs are saved) is added to the nodeās logger reflecting the fields contained within the appropriate config file.
Configuration¶
A nodeās telemetry status can be managed using the diagcfg CLI, which modifies the nodeās logging.config file. This file instructs the nodeās construction of its TelemetryConfig struct, defining the following fields:
Key | Data type | Description |
---|---|---|
Enable | bool | Determines whether Algorand remote logging is enabled for this node. |
SendToLog | bool | Determines whether telemetry entries should be logged locally as well. |
URI | string | The URI for the elastic search server to be logged to. Leave blank for default. |
Name | string | The name of the machine for remote logging purposes. |
GUID | string | A unique identifier for the nodeās telemetry logging. Except in contrived circumstances, there should exist one GUID across all nodes running on a machine. |
MinLogLevel | logrus.LogLevel | The lowest event significance that should be logged. |
ReportHistoryLevel | logrus.LogLevel | The logrus importance level at which the nodeās history will be reported. Must be greater than or equal to MinLogLevel. |
FilePath | string | The location to which the logging.config file instance of the struct will be saved. |
UserName | string | The username credential for establishing an elastic telemetry hook. |
Password | string | The password credential for establishing an elastic telemetry hook. |
An Algorand node host can configure their nodeās telemetry before running it by modifying the logging.config file in their nodeās data directory, or deleting this file and modifying their ~/.algorand/logging.config file. In addition, the user can alter a running nodeās telemetry status using the diagcfg CLI
Config File Location¶
The file named ālogging.configā informs the initial configuration of a nodeās telemetry. There will typically be at least two logging.config files on a machine running a node: one for each node the machine is running, stored in that nodeās data directory, and a global config file stored in ~/.algorand/. This global file is generally only accessed when a node-specific config file cannot be found.
However, the ādiagcfg telemetryā command tree, which replaces the functionality of āgoal loggingā, updates or creates both the local and global config files when executing any command that changes the nodeās telemetry state, only failing to create the local file if no dataDir is provided, in which case thereās presumably also no node running.