Giter Site home page Giter Site logo

httptostatsd's Introduction

HttpToStatsd Build Status

An HTTP server in node.js for receiving client metrics and send them to statsD.

Native apps, and client side apps, can't easily send UDP packet directly to StatsD. With this server, you can send to it, asynchronous http request, from client-side apps, letting the server send them in UDP to your statsD.

installation

yarn

... profit !

usage in production

node app

or if you want to choose the port (to run multiple instance) :

export NODE_PORT=8081 && node app

usage in dev (loading dev config)

export NODE_ENV=development
node app

usage in production (loading production config)

export NODE_ENV=production
node app

increment

/statsd/:node/increment?token=xxx
/statsd/:node/increment/:delta?token=xxx

example

/statsd/raoul/increment?token=xxx
/statsd/raoul/increment/123?token=xxx

delta value specifies by how much counter is modified

timer

/statsd/:node/timer/:timing?token=xxx

gauge

/statsd/:node/gauge/:gauge?token=xxx

example

/statsd/raoul/timer/234?token=xxx

timing value in ms

how to compute a token

md5sum(node + value + secretKey)

for increment, value is '1'

Rate limit

    "rateLimit": {
        "enable": true,
        "lookup": [
            "connection.remoteAddress"
        ],
        "maxRequestsPerSeconds": 100,
        "expire": 60,
        "skipHeaders": true
    }
  • enable: Boolean enable/disable rate limit feature
  • lookup: String|Array.<String> value lookup on the request object. Can be a single value or array.
  • maxRequestsPerSeconds: Number allowed number of requests before getting rate limited
  • expire: Number amount of time in s before the rate-limited is reset (global reset)
  • skipHeaders: Boolean whether to skip sending HTTP X-Ratelimit headers for rate limit

Launch unit test

yarn test

httptostatsd's People

Contributors

nchaulet avatar omansour avatar pihomeserver avatar acoquoin avatar slashgear avatar fdubost avatar

Stargazers

Antoine Reneleau avatar Jérôme Foray avatar Justin J. Novack avatar Martin Magakian avatar Matt avatar  avatar Julien BIANCHI avatar Xavier Baldacci avatar

Watchers

Thomas ZILLIOX avatar James Cloos avatar Ξrik Saunier avatar  avatar Florent Lavy avatar Siwaÿll avatar Jean-Michel DOHUUTIN avatar  avatar Kenny Dits @kenny_dee avatar Francois Jacquier avatar Jérémy JOURDIN avatar Jérémie Picard avatar FX GABERAN avatar  avatar François VERRON avatar Emmanuel Franc avatar Valentin C. avatar Nicolas Afresne avatar  avatar Thierry Geindre avatar Vincent Gallissot avatar Busuttil Nicolas avatar Flavien Pensato avatar Gory Alexandre avatar Etienne D. avatar Adrien E. avatar  avatar

httptostatsd's Issues

README

Is it possible to write the README file ?
We don't even know what it's about 😄

httpToStatsd implementation

Hello
I ask myself about the best way to implement httpToStatsd in a project.
In my case my architecture is i think classical :

  • A backend server with Statsd and a database (InfluxDb here)
  • A frontend with a node app (splitted in two parts client and server) and Nginx as a proxy to not expose the app.

Then i want to allow external applications/systems/whatever to send metrics to statsd. Then i guess that the best place to install httpToStatsd is to put it on the frontend server using Nginx as a proxy also.

Can you please confirm that i'm on the good way ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.