项目作者: lahaxearnaud

项目描述 :
Amqp queue information to statsd
高级语言: JavaScript
项目地址: git://github.com/lahaxearnaud/rabbitmq-statsd.git
创建时间: 2016-09-10T15:36:00Z
项目社区:https://github.com/lahaxearnaud/rabbitmq-statsd

开源协议:

下载


rabbitmq-statsd

Example

Alt text

Alt text

Configuration

In the config.json file you will find all the application configuration

  1. {
  2. "collectInterval": 30000, // collect interval time in ms
  3. "amqp": {
  4. "username": "AMQP_USERNAME",
  5. "password": "AMQP_PASSWORD",
  6. "host": "AMQP_HOSTNAME:15672", // might be something like heroku.srs.rabbitmq.com/rabbitmq/foobar
  7. "protocol": "HTTP_OR_HTTPS"
  8. },
  9. "statsd": {
  10. "host": "STATSD_HOSTNAME",
  11. "port": "8125", // port of your statsd
  12. "prefix": "STATSD_PREFIX" // prefix for your stats ex rabbit.prod / rabbit.dev
  13. },
  14. "logPath": "rabbit.log"
  15. }

Install

Clone the remository

  1. $ git clone https://github.com/lahaxearnaud/rabbitmq-statsd

Run with docker on arm architecture (based on armbuild/alpine)

Docker images: 47MB

  • Build the image
    1. $ make build
    ```
    docker build -t rabbitmq-collector /home/pirate/domotique-rabbitmq-statsd
    Sending build context to Docker daemon 2.842 MB
    Step 1 : FROM resin/armhf-alpine-node:slim
    —-> 3e890d09a3d8
    Step 2 : RUN npm install forever -g
    —-> Using cache
    —-> a8ee4752aca3
    Successfully built a8ee4752aca3
  1. - Start the container
  2. ```sh
  3. $ make up
  1. docker rm rabbitmq-collector-container | true
  2. docker run --name rabbitmq-collector-container -v /home/pirate/domotique-rabbitmq-statsd:/var/app -d rabbitmq-collector forever /var/app/app.js
  3. 4645aa2efcc4946924be0faa8237e4163ba5a2771ef9b72d488ff4e22e79e610
  • Access container logs
    1. $ make tail
    ```
    docker logs -f rabbitmq-collector-container
    warn: —minUptime not set. Defaulting to: 1000ms
    warn: —spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
    info: Rabbit monitoring starting
  1. - Stop the container
  2. ```sh
  3. $ make down
  4. docker kill rabbitmq-collector-container | true
  • Remove the image
    1. $ make rm
    ```
    docker kill rabbitmq-collector-container | true
    Error response from daemon: Cannot kill container rabbitmq-collector-container: Container 4645aa2efcc4946924be0faa8237e4163ba5a2771ef9b72d488ff4e22e79e610 is not running
    docker rmi rabbitmq-collector
    Untagged: rabbitmq-collector:latest
  1. ## Run without docker with forever
  2. ```sh
  3. $ forver start app.js

Run without docker and without forever

  1. $ npm run app

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

LAHAXE Arnaud

License

Copyright © 2016 LAHAXE Arnaud
Licensed under the MIT license.


After coding

What better way to relax, after spending hours coding, than a good cocktail on the terrace?