StackState-Gearman Integration

Overview

Bring Gearman metrics to StackState to:

  • Visualize Gearman performance.
  • Know how many tasks are queued or running.
  • Correlate the performance of Gearman with the rest of your applications.

Setup

Configuration

To capture Gearman metrics you need to install the StackState Agent.

  1. Install the python gearman module

  2. Configure the Agent to connect to Gearman, edit conf.d/gearmand.yaml

    init_config:
    
    instances:
      - server: localhost
        port: 4730
        tags:
            - optional_tag_1
            - optional_tag_2
    

  3. Restart the Agent

Validation

Execute the info command and verify that the integration check has passed. The output of the command should contain a section similar to the following:

Checks
======

  [...]

  gearmand
  --------
      - instance #0 [OK]
      - Collected 8 metrics & 0 events

Data Collected

Metrics

gearman.unique_tasks
(gauge)
The number of all functions registered with Gearman.
shown as task
gearman.running
(gauge)
The total number of running Gearman jobs.
shown as task
gearman.queued
(gauge)
The total number of jobs in the queue.
shown as task
gearman.workers
(gauge)
The total number of capable Gearman workers.
shown as process
gearman.running_by_task
(gauge)
The number of running Gearman jobs by task.
shown as task
gearman.queued_by_task
(gauge)
The number of jobs in the queue by task.
shown as task
gearman.workers_by_task
(gauge)
The number of capable Gearman workers by task.
shown as process

Service Checks

gearman.can_connect:

Returns Critical if the Agent cannot connect to Gearman to collect metrics.