npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

statsd-riemann-backend

v1.0.2

Published

A simple StatsD backend to stream events to Riemann.io

Downloads

10

Readme

Build Status

statsd-riemann-backend

A backend plugin for Statsd to forward events to Riemann.io.

Overview

Suppose you wanted to use StatsD as your main event stream aggregator due to its simple interface and its ease of integration with existing services. Perfect! What if you wanted to include some alerts around the events you were sending to StatsD? Enter Riemann.io! Riemann.io is similar to StatsD in that it is an event stream aggregator, however Riemann.io includes support for many stream operations, event aggregation, and advanced alerting features. Please read more about Riemann.io if you want to learn more about what it can do.

This backend forwards all event packets sent to StatsD. Riemann.io includes lots of support for aggregating events, including rolling up and grouping events, computing metrics (like latency profiles) and is generally more useful when dealing with all metrics events rather than the rolled up metrics that StatsD also publishes. What that means is that this backend only responds to the packet event emitter and not the flush event emitter. Support for the flush event emitter may be added in the future.

Installation

In your StatsD installation folder, run:

$ npm install statsd-riemann-backend

Include the backend in your config.js file (see example configuration file below for complete configuration example).

{
  "backends": ["statsd-riemann-backend"]
}

If npm install fails with the following error message:

Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing `protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found

You must follow the riemann installation instructions.

Configuration

There are several configuration options that are available for this backend.

host, port, and transport

Override the host and port properties if your Riemann.io instance is not running on the same machine as your StatsD instance. Valid transport values include "tcp" and "udp". "udp" is the default method of transport.

tags

Anything you would like included as a tag on every event forwarded to Riemann.io

parseNamespace

StatsD encourages that events are named in the "Graphite way" (read more about that here) Events in Riemann.io have several properties that are useful when performing event stream operations. Two of those properties are service and description. If you set parseNamespace to true the backend will use the first portion of the event name as the event service and will use the remaining pieces of the event name as the event description.

For example: apiServer.findUser.response.statusCode:200|c would be parsed such that the event service would be "apiServer" and the description would be "findUser.response.statusCode" (the 200 count would be the event metric).

tagWithEventParts

Riemann.io events support arbitrary free text tags. If you set the tagWithEventParts property to true, the event name will be split into its separate parts and each part will be a separate tag on the event.

For example: apiServer.findUser.response.statusCode:200|c would be parsed such that the event tags would be ["apiServer", "findUser", "response", "statusCode"].

Example Configuration

{
  "backends": ["statsd-riemann-backend"],

  "riemann": {
    "host": "localhost",
    "port": 5555,
    "transport": "tcp",
    "tags": ["statsd"],
    "parseNamespace": true,
    "tagWithEventParts": true
  }
}

Contributing

Feel free to leave issues here or fork the project and submit pull requests. If there is a feature you would like added just submit an issue describing the feature and I will do my best.