---
description:
  Collect and send metrics to Datadog DogStatsD and InfluxDB's Telegraf StatsD services using
  @graphql-mesh/plugin-statsd plugin. Available metrics include operations count, error count, and
  latency.
---

# DataDog, InfluxDB, Telegraf, StatsD

You can use `@graphql-mesh/plugin-statsd` plugin to collect and send metrics to Datadog's DogStatsD
and InfluxDB's Telegraf StatsD services.

Compatible with:

- Datadog's DogStatsD server
- InfluxDB's Telegraf StatsD server
- Etsy's StatsD serve

Available metrics:

- `graphql.operations.count` - the number of performed operations (including failures)
- `graphql.operations.error.count` - the number of failed operations
- `graphql.operations.latency` - a histogram of response times (in milliseconds)
- `graphql.delegations.count` - the number of delegated operations to the sources
- `graphql.delegations.error.count` - the number of failed delegated operations
- `graphql.delegations.latency` - a histogram of delegated response times (in milliseconds)
- `graphql.fetch.count` - the number of outgoing HTTP requests
- `graphql.fetch.error.count` - the number of failed outgoing HTTP requests
- `graphql.fetch.latency` - a histogram of outgoing HTTP response times (in milliseconds)

> You can also customize the `graphql` prefix and add custom tags to the metrics.

### Getting Started

```sh npm2yarn
npm i @graphql-mesh/plugin-statsd hot-shots
```

## Example Configuration

```yaml filename=".meshrc.yaml"
# ...
plugins:
  - statsd:
      # Configure `hot-shots`
      client:
        port: 8020
      # results in `gql.operations.count` instead of `graphql.operations.count`
      prefix: my-graphql-mesh
      # If you wish to disable introspection logging
      skipIntrospection: true
```

## Config API Reference

import API from '../../../generated-markdown/StatsdPlugin.generated.md'

<API />
