Configuration

Universal Agent configuration is stored in agent.properties file in /opt/plumbr-agent/conf directory. This file contains both the configuration for the Universal Agent service (daemon) and the cluster-specific configuration.

All other files of the agent are stored in /opt/plumbr-agent/[service_version] directories where each service_version is also installed as a separate service in the system. All paths mentioned here are relative to the service-specific directory.

Service configuration

All configuration properties that are specific to the daemon, thus do not affect the behavior of the agent within
monitored processes, have a daemon. prefix. Required properties are:

  • daemon.serverUrl – specifies the address of the Plumbr Server that the agent sends data to.
  • daemon.serverId – specifies the server name which will be shown under Servers list. This is also shown when viewing individual interactions or API calls. By default, installer sets it to the server hostname.
  • daemon.apiKey – authentication key. Can be viewed under Account Settings in Plumbr Server.

Optional configuration properties are:

  • daemon.diskBufferSize – specifies the maximum size of the file that is used to store data that has not yet been sent to the server. This file is only used if in-memory buffers are full, which can happen either due to the server being unreachable or the rate of new data being generated exceeding the rate at which it can be sent.

Cluster configuration

A cluster is defined by a property named monitor.cluster. One instance of this line is present for each defined cluster, therefore there may be multiple of these. The value of this property is in the format of [cluster_name]:[process_name_pattern], where process name pattern is matched against the full path of the executable
being monitored, where ** matches any character and * matches any number of characters except a directory separator /. For example the default cluster definition line for PHP-FPM is monitor.cluster=php-fpm:**php*. The process name patterns set up by Plumbr installer for each of the supported technologies are:

  • **php* – for PHP-FPM
  • **apache2* and **httpd* – for Apache 2, also monitors PHP if it is running via mod_php within Apache
  • **nginx* – for nginx
  • **python* – for CPython or PyPy when not running within uWSGI
  • **pypy* – for PyPy when not running within uWSGI
  • **uwsgi* – for uWSGI running either with CPython or PyPy

Other properties are in the format of monitor.[property_name] to apply to all clusters, or monitor.cluster.[property_name] to apply it only to the last cluster defined before that line.

Application version configuration

Application version can be provided in several ways:

  • Configuration file property monitor.appVersion
  • Environment variable PLUMBR_APP_VERSION

Which option is better to use depends on how the deploy or launch of the monitored processes is done. If the monitored service is managed by systemd or sysvinit, and changing the launch scripts or configuration of the service is undesired, then configuration file property should be used. Otherwise it should generally be easier to use the environment variable.

Logging configuration

Log file names are in the format of [type].[date].[fragment].log. New fragment is created when previous reaches maximum size. The size of a fragment can be configured, but the maximum number or maximum size cannot.

Agent keeps four types of logs:

  • logs/daemon contains the logs of the daemon that communicates with the Plumbr Server directly.
  • data/monitor/[process_id] contains the log file fragment of a specific process for as long as that process is still active.
  • logs/monitors/ contains logs mixed together from all monitored processes, but only contains log lines added after they have successfully established a connection with the daemon, therefore might not contain all logs from monitored processes.
  • logs/monitor-archive contains .tar files to which log files from data/monitor/[process_id] will be appended to when the process exits or when the specific log file is completed (new fragment is started).

Logging configuration is specified either for the daemon (daemon. prefix), for monitored processes (monitor. prefix) or for the monitored processes of a specific cluster (monitor.cluster. prefix). The available logging configuration properties are:

  • logLevel – specifies the log level for the daemon process. Default value is DEBUG. All available values are ERROR, WARN, INFO, DEBUG and TRACE (do not use TRACE in production).
  • logFileMaxSize – specifies the maximum size of a single log file (fragment). If this is reached, then a new fragment is created.

Retention can be configured with the option daemon.logRetentionDays which specifies the number of days to keep log files for. Log files older than that are automatically deleted.