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

juttle-graphite-adapter

v0.6.0

Published

Juttle adapter for Graphite

Downloads

17

Readme

Juttle Graphite Adapter

Build Status

Graphite adapter for the Juttle data flow language, with read & write support.

Examples

Reading existing metrics is as simple as:

read graphite -from :1 week ago: name ~ 'app1.*.response_ms'
| reduce value = avg(value) by name

This will compute last week's average of every metric matching app1.*.response_ms.

If you encoded something like the region or hostname into the metric name then you can easily parse that name in juttle. Let's say your metric name looks like region.host.metric_name. Then you can calculate the average value of the response time per host every 1 minute for the last 24 hours like so:

read graphite -from :24 hours ago: name ~ '*.response_ms'
| put host = String.split(name, '.')[1]
| reduce -every :1 minute: value = avg(value) by host

Installation

Like Juttle itself, the adapter is installed as a npm package. Both Juttle and the adapter need to be installed side-by-side:

$ npm install juttle
$ npm install juttle-graphite-adapter

Configuration

The adapter needs to be registered and configured so that it can be used from within Juttle. To do so, add the following to your ~/.juttle/config.json file:

{
    "adapters": {
        "graphite": {
            "carbon": {
                "host": "localhost",
                "port": 2003
            },
            "webapp": {
                "host": "localhost",
                "port": 8080,
                "username": "...",
                "password": "..."
            }
        }
    }
}

Keys in carbon specify the location of Graphite storage backend, keys in webapp contain configuration for the Graphite frontend.

Usage

Data Model

Graphite stores metrics with:

  • name - alphanumeric sequence defining a path to your metric that you should consider naming appropriately. See graphite documentation for more details.

  • value - numerical value for the metric identified

  • timestamp - the timestamp associated with this metric as an integer of seconds since epoch.

Read options

When reading data out of graphite every metric will be converted into a point with the name, value, and time fields.

Name | Type | Required | Description -----|------|----------|------------- from | moment | no | select points after this time (inclusive) to | moment | no | select points before this time (exclusive)

Write options

This adapter maps data points containing the fields name, value, and time to a graphite metric. All other points missing these fields are not written and a warning is issued instead.

So, for writing, the key thing is to make sure your data contains the fields name, value and time. When constructing data from a data point that has multiple fields, make sure to pick a naming convention you can easily use to parse back out of graphite later. More details on naming your metric can be found in the graphite wiki.

Contributing

Want to contribute? Awesome! Don’t hesitate to file an issue or open a pull request.