Twemproxy

Supported OS Linux Windows Mac OS

Integration version1.15.0

Overview

Track overall and per-pool stats on each of your Twemproxy servers. This Agent check collects metrics for client and server connections and errors, request and response rates, bytes in and out of the proxy, and more.

Setup

Installation

The Agent’s Twemproxy check is included in the Datadog Agent package, so you don’t need to install anything else on your Twemproxy servers.

Configuration

Host

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

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

    init_config:
    
    instances:
      - host: localhost
        port: 2222
    
  2. Restart the Agent to begin sending Twemproxy metrics to Datadog.

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 twemproxy.d/conf.yaml file to start collecting your Apache Logs:

    logs:
      - type: file
        path: "<LOG_FILE_PATH>"
        source: twemproxy
        service: "<SERVICE_NAME>"
    

    Change the path and service parameter values and configure them for your environment. See the sample twemproxy.d/conf.yaml for all available configuration options.

  3. Restart the Agent.

Containerized

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

ParameterValue
<INTEGRATION_NAME>twemproxy
<INIT_CONFIG>blank or {}
<INSTANCE_CONFIG>{"host": "%%host%%", "port":"22222"}
Log collection

Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes log collection documentation.

ParameterValue
<LOG_CONFIG>{"source": "twemproxy", "service": "<SERVICE_NAME>"}

Validation

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

Data Collected

Metrics

twemproxy.client_connections
(gauge)
number of active client connections
Shown as connection
twemproxy.client_eof
(gauge)
number of eof on client connections
Shown as error
twemproxy.client_err
(gauge)
number of errors on client connections
Shown as error
twemproxy.curr_connections
(gauge)
number of current connections
Shown as connection
twemproxy.forward_error
(gauge)
number of times we encountered a forwarding error
Shown as error
twemproxy.fragments
(gauge)
number of fragments created from a multi-vector request
Shown as request
twemproxy.in_queue
(gauge)
number of requests in incoming queue
Shown as request
twemproxy.in_queue_bytes
(gauge)
current request bytes in incoming queue
Shown as byte
twemproxy.out_queue
(gauge)
number of requests in outgoing queue
Shown as request
twemproxy.out_queue_bytes
(gauge)
current request bytes in outgoing queue
Shown as byte
twemproxy.request_bytes
(gauge)
total request bytes
Shown as byte
twemproxy.requests
(gauge)
number of requests
Shown as request
twemproxy.response_bytes
(gauge)
total response bytes
Shown as byte
twemproxy.responses
(gauge)
number of responses
Shown as response
twemproxy.server_connections
(gauge)
number of active server connections
Shown as connection
twemproxy.server_ejects
(gauge)
number of times backend server was ejected
Shown as event
twemproxy.server_eof
(gauge)
number of eof on server connections
Shown as error
twemproxy.server_err
(gauge)
number of errors on server connections
Shown as error
twemproxy.server_timedout
(gauge)
number of timeouts on server connections
Shown as timeout
twemproxy.total_connections
(gauge)
rate of new connections
Shown as connection

Events

The Twemproxy check does not include any events.

Service Checks

twemproxy.can_connect
Returns Critical if the Agent cannot send data to the Twemproxy endpoint, OK otherwise.
Statuses: ok, critical

Troubleshooting

Need help? Contact Datadog support.