Socket Listener

Note

This plugin is currently being groomed to be an integration. It works, but we haven’t spent a lot of time on it yet to optimize the user experience. Feel free to try it out, just keep in mind that we will be enhancing the experience over time.

This plugin is ported from the Telegraf Socket Listener Service Input Plugin. The Socket Listener is a service input plugin that listens for messages from streaming (tcp, unix) or datagram (udp, unixgram) protocols. The plugin expects messages in the Telegraf Input Data Formats:

Setup

The socket_listener plugin is included with the AppOptics host agent by default, please follow the directions below to enable it for a host agent instance.

Configuration

The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your installation. To enable the plugin:

  1. Make a copy of the socket_listener example configuration file /opt/appoptics/etc/plugins.d/socket_listener.yaml.example, renaming it to /opt/appoptics/etc/plugins.d/socket_listener.yaml:
$ sudo cp /opt/appoptics/etc/plugins.d/socket_listener.yaml.example /opt/appoptics/etc/plugins.d/socket_listener.yaml
  1. Update the /opt/appoptics/etc/plugins.d/socket_listener.yaml configuration file with settings specific to your use case, for example:
collector:
  socket_listener:
    all:
      ## URL to listen on
      # service_address: "tcp://:8094"
      # service_address: "tcp://127.0.0.1:http"
      # service_address: "tcp4://:8094"
      # service_address: "tcp6://:8094"
      # service_address: "tcp6://[2001:db8::1]:8094"
      # service_address: "udp://:8094"
      # service_address: "udp4://:8094"
      # service_address: "udp6://:8094"
      # service_address: "unix:///tmp/telegraf.sock"
      # service_address: "unixgram:///tmp/telegraf.sock"

      ## Maximum number of concurrent connections.
      ## Only applies to stream sockets (e.g. TCP).
      ## 0 (default) is unlimited.
      # max_connections: 1024

      ## Read timeout.
      ## Only applies to stream sockets (e.g. TCP).
      ## 0 (default) is unlimited.
      # read_timeout: "30s"

      ## Maximum socket buffer size in bytes.
      ## For stream sockets, once the buffer fills up, the sender will start backing up.
      ## For datagram sockets, once the buffer fills up, metrics will start dropping.
      ## Defaults to the OS default.
      # read_buffer_size: 65535

      ## Period between keep alive probes.
      ## Only applies to TCP sockets.
      ## 0 disables keep alive probes.
      ## Defaults to the OS configuration.
      # keep_alive_period: "5m"

      ## Data format to consume.
      ## Each data format has its own unique set of configuration options, read
      ## more about them here:
      ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
      # data_format: "influx"

load:
  plugin: snap-plugin-collector-bridge-socket_listener
  task: task-bridge-socket_listener.yaml
  1. Restart the host agent:
$ sudo service appoptics-snapteld restart
  1. Enable the Socket Listener plugin

    When you log in to AppOptics you should see socket_listener listed in the Plugin section on the home page. You will also find it on the Integrations Page. Clicking on the widget will open up a window that shows you the list of metrics that the plugin is collecting. Activate the plugin by clicking on the “Enable Plugin” button, then select the metrics you would like to see on a dashboard and click on the “Send Metrics to Dashboard” button.

For more information read the Telegraf Socket Listener Service Input Plugin docs.