# @envelop/statsd

Latest version **9.0.1** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @envelop/statsd
pnpm add @envelop/statsd
yarn add @envelop/statsd
bun add @envelop/statsd
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.0.1 |
| Published | 2026-11-12 |
| First published | 2021-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.15.0 |
| Dependencies | 1 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8541 |
| Author | Kamil Kisiela <kamil.kisiela@gmail.com> |
| Maintainers | dotansimha, enisdenjo, theguild-bot |
| Keywords | envelop, datadog, statsd, graphql, telegraf |

## Links

- npm: https://www.npmjs.com/package/@envelop/statsd
- Repository: https://github.com/graphql-hive/graphql-yoga
- Homepage: https://github.com/graphql-hive/graphql-yoga/tree/main/packages/envelop/plugins/statsd#readme
- npm.io page: https://npm.io/package/@envelop/statsd

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 9.0.1 (latest) — 2026-11-12
- 9.0.2-rc-20261124205929-9595907fc2bef8a397343bd288fef4685ab9f508 (rc) — 2026-11-24
- 9.0.2-alpha-20261124173018-63c2b8a5d0d7e845ecdc9f401a4ca79f6c943dc8 (alpha) — 2026-11-24
- 9.0.1-alpha-20261112141330-38ba3951f67b0d318166a9440eade51b2f5e9cf9 — 2026-11-12
- 9.0.1-rc-20261112141317-184086d94be0f21d781bea0446e4791b6a018507 — 2026-11-12
- 9.0.1-rc-20261111185655-c5cf052ddf41ad176b870cc0d16f11174fab5c0b — 2026-11-11
- 9.0.1-alpha-20261111175152-e39c721ee7ae5562ccdc6db5ec8239098e4af153 — 2026-11-11
- 9.0.0 — 2026-10-22
- 9.0.0-rc-20261022165416-7c29decb398764e6ac3915e1c539c478cbf19237 — 2026-10-22
- 9.0.0-alpha-20261019231601-b21e6cedc1a444383d9ce69fe6180f5b4ff67120 — 2026-10-19
- 9.0.0-alpha-20261019165905-4e993e96c2903cbe3084f9b49dfbf05042e3fe57 — 2026-10-19
- 9.0.0-alpha-20261019135505-9270088a653c3b9c07f54ef1cb67e69488e4e188 — 2026-10-19
- 9.0.0-alpha-20261009120802-464ace7b331b5693c49d18e270d79cb071e59247 — 2026-10-09
- 9.0.0-alpha-20261006205119-381bef34d7da2fde417073fec18c06eb58224f87 — 2026-10-06
- 9.0.0-alpha-20260929215310-f756e1d4981e8dd5ac5e128b5c2554893ae24a52 — 2026-09-29
- … 1644 more at https://npm.io/package/@envelop/statsd/versions

## README

## `@envelop/statsd`

This plugin tracks the complete execution flow, and reports metrics using StatsD (based on
`hot-shots`).

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)

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

## Getting Started

```
yarn add hot-shots @envelop/statsd
```

## Usage Example

```ts
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import StatsD from 'hot-shots'
import { envelop, useEngine } from '@envelop/core'
import { useStatsD } from '@envelop/statsd'

const client = new StatsD({
  port: 8020,
  globalTags: { env: process.env.NODE_ENV }
})

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useStatsD({
      client,
      prefix: 'gql', // results in `gql.operations.count` instead of `graphql.operations.count`,
      skipIntrospection: true // if you wish to disable introspection logging
    })
  ]
})
```

---
_Source: https://npm.io/package/@envelop/statsd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
