New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

juttle-graphite-adapter

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juttle-graphite-adapter

Juttle adapter for Graphite

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
4
Weekly downloads
 
Created
Source

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.

NameTypeRequiredDescription
frommomentnoselect points after this time (inclusive)
tomomentnoselect 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.

Keywords

FAQs

Package last updated on 24 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc