nestjs-hot-shots
TypeScript icon, indicating that this package has built-in type declarations

2.0.19 • Public • Published

NestJS Hot-shots npm LICENSE Downloads Last Commit

Nest.JS logo

Hot-shots Module for Nest.js Framework. A Node.js client for Etsy's StatsD server, Datadog's DogStatsD server, and InfluxDB's Telegraf StatsD server.

Features

  • TypeScript types
  • Telegraf support
  • Events
  • Child clients
  • TCP/UDS Protocol support
  • Raw Stream Protocol support
  • Mock mode
  • Much more, including many bug fixes

For questions and support please use the Issues.

Installation

$ npm i nestjs-hot-shots hot-shots
$ yarn add nestjs-hot-shots hot-shots
$ pnpm add nestjs-hot-shots hot-shots

Usage

Once the installation process is complete, we can import the HotShotsModule into the root AppModule:

import { Module } from '@nestjs/common'
import { HotShotsModule } from 'nestjs-hot-shots';

@Module({
    imports: [
        HotShotsModule.forRoot({
            port: 8020,
            globalTags: { env: process.env.NODE_ENV }
        })
    ]
})
export class AppModule {
}

Then inject StatsD provider for use hot-shots:

import { Injectable } from '@nestjs/common';
import { StatsD } from 'hot-shots';

@Injectable()
export class AppMetrics {
    public constructor(private readonly metrics: StatsD) {
    }

    public metricStuff() {
        this.metrics.increment('somecounter');
    }
}

See the hot-shots module for more details.

Stay in touch

License

MIT © Alexey Filippov

Dependencies (0)

    Dev Dependencies (19)

    Package Sidebar

    Install

    npm i nestjs-hot-shots

    Weekly Downloads

    6,936

    Version

    2.0.19

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • socketsomeone