---
title: Gearman
description: Track the number of jobs queued and running - in total or by task.
breadcrumbs: Docs > Integrations > Gearman
---

# Gearman
Supported OS Integration version5.3.0
## Overview{% #overview %}

Collect Gearman metrics to:

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

**Minimum Agent version:** 6.0.0

## Setup{% #setup %}

### Installation{% #installation %}

The Gearman check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you don't need to install anything else on your Gearman job servers.

### Configuration{% #configuration %}

{% tab title="Host" %}
#### Host{% #host %}

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

1. Edit the `gearmand.d/conf.yaml` file, in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory) to start collecting your Gearman performance data. See the [sample gearmand.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/gearmand/datadog_checks/gearmand/data/conf.yaml.example) for all available configuration options.

   ```yaml
   init_config:
   
   instances:
     - server: localhost
       port: 4730
   ```

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent)

{% /tab %}

{% tab title="Containerized" %}
#### Containerized{% #containerized %}

For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance on applying the parameters below.

| Parameter            | Value                                  |
| -------------------- | -------------------------------------- |
| `<INTEGRATION_NAME>` | `gearmand`                             |
| `<INIT_CONFIG>`      | blank or `{}`                          |
| `<INSTANCE_CONFIG>`  | `{"server":"%%host%%", "port":"4730"}` |

{% /tab %}

#### Log collection{% #log-collection %}

1. Collecting logs is disabled by default in the Datadog Agent, enable it in your `datadog.yaml` file:

   ```yaml
   logs_enabled: true
   ```

1. Add this configuration block to your `gearmand.d/conf.yaml` file to start collecting your Gearman logs:

   ```yaml
   logs:
     - type: file
       path: /var/log/gearmand.log
       source: gearman
   ```

Change the `path` parameter value based on your environment. See the [sample gearmand.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/gearmand/datadog_checks/gearmand/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

See [Kubernetes Log Collection](https://docs.datadoghq.com/agent/kubernetes/log/) for information on configuring the Agent for log collection in Kubernetes environments.

### Validation{% #validation %}

[Run the Agent's `status` subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `gearmand` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **gearman.queued**(gauge)            | The total number of jobs in the queue.*Shown as task*               |
| **gearman.queued\_by\_task**(gauge)  | The number of jobs in the queue by task.*Shown as task*             |
| **gearman.running**(gauge)           | The total number of running Gearman jobs.*Shown as task*            |
| **gearman.running\_by\_task**(gauge) | The number of running Gearman jobs by task.*Shown as task*          |
| **gearman.unique\_tasks**(gauge)     | The number of all functions registered with Gearman.*Shown as task* |
| **gearman.workers**(gauge)           | The total number of capable Gearman workers.*Shown as process*      |
| **gearman.workers\_by\_task**(gauge) | The number of capable Gearman workers by task.*Shown as process*    |

### Events{% #events %}

The Gearman check does not include any events.

### Service Checks{% #service-checks %}

**gearman.can\_connect**

Returns `CRITICAL` if the Agent check is unable to connect to the monitored Gearman instance. Returns `OK` otherwise.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
