Nighttime Peanut Migrations

    @envelop/statsd
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.2 • Public • Published

    @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/stats
    

    Usage Example

    import { envelop } from '@envelop/core'
    import { useStatsD } from '@envelop/statsd'
    import StatsD from 'hot-shots'
    
    const client = new StatsD({
      port: 8020,
      globalTags: { env: process.env.NODE_ENV }
    })
    
    const getEnveloped = envelop({
      plugins: [
        // ... 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
        })
      ]
    })

    Install

    npm i @envelop/statsd

    DownloadsWeekly Downloads

    523

    Version

    2.4.2

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • dotansimha