5.0.0 • Published 7 months ago

@envelop/statsd v5.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@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

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
    })
  ]
})
4.0.1

8 months ago

4.0.3

8 months ago

4.0.2

8 months ago

5.0.0

7 months ago

4.0.0

12 months ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.2

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.3.3

2 years ago

2.3.2

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.0

2 years ago

1.0.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago