Supervisord

Supported OS Linux Mac OS Windows

Integration version2.6.0

Supervisor Event

Overview

This check monitors the uptime, status, and number of processes running under Supervisor.

Setup

Installation

The Supervisor check is included in the Datadog Agent package, so you don’t need to install anything else on servers where Supervisor is running.

Configuration

Prepare supervisord

The Agent can collect data from Supervisor through a HTTP server or UNIX socket. The Agent collects the same data no matter which collection method you configure.

HTTP server

Add a block like this to Supervisor’s main configuration file (/etc/supervisor.conf):

[inet_http_server]
port=localhost:9001
;username=user  # optional
;password=pass  # optional
UNIX socket

Add blocks like these to /etc/supervisor.conf (if they’re not already there):

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

[unix_http_server]
file=/var/run/supervisor.sock
chmod=777
chown=nobody:nogroup
;username=user  # optional
;password=pass  # optional

If Supervisor is running as root, make sure chmod or chown is set so that non-root users, such as dd-agent, can read the socket.


Reload supervisord.

Host

To configure this check for an Agent running on a host:

Edit the supervisord.d/conf.yaml file in the conf.d/ folder at the root of your Agent’s configuration directory. See the sample supervisord.d/conf.yaml for all available configuration options:

init_config:

instances:
  ## Used to tag service checks and metrics, i.e. supervisor_server:supervisord0
  - name: supervisord0
    host: localhost
    port: 9001
  ## To collect from the socket instead
  # - name: supervisord0
  #   socket: unix:///var/run/supervisor.sock

Use the proc_names and/or proc_regex options to list processes you want the Agent to collect metrics on and create service checks for. If you don’t provide either option, the Agent tracks all child processes of Supervisor. If you provide both options, the Agent tracks processes from both lists meaning the two options are not mutually exclusive.

See the example check configuration for comprehensive descriptions of other check options.

Restart the Agent to start sending Supervisor metrics to Datadog.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

ParameterValue
<INTEGRATION_NAME>supervisord
<INIT_CONFIG>blank or {}
<INSTANCE_CONFIG>{"name":"<SUPERVISORD_SERVER_NAME>", "host":"%%host%%", "port":"9001", "username":"<USERNAME>", "password":"<PASSWORD>"}

Log collection

  1. Collecting logs is disabled by default in the Datadog Agent, you need to enable it in datadog.yaml:

    logs_enabled: true
    
  2. Add this configuration block to your supervisord.d/conf.yaml file to start collecting your Supervisord Logs:

    logs:
      - type: file
        path: /path/to/my/directory/file.log
        source: supervisord
    

    Change the path parameter value and configure it for your environment. See the sample supervisord.d/conf.yaml for all available configuration options.

  3. Restart the Agent.

Validation

Run the Agent’s status subcommand and look for supervisord under the Checks section.

Data Collected

Metrics

supervisord.process.count
(gauge)
The number of supervisord monitored processes
Shown as process
supervisord.process.uptime
(gauge)
The process uptime
Shown as second

Events

The Supervisor check does not include any events.

Service Checks

supervisord.can_connect
Returns CRITICAL if the Agent check is unable to connect to the supervisor daemon. Returns OK otherwise.
Statuses: ok, critical

supervisord.process.status
Returns CRITICAL if the process is not running or stopping, UNKNOWN if starting or unknown, OK otherwise.
Statuses: ok, critical, unknown

Troubleshooting

Need help? Contact Datadog support.

Further Reading