Skip to main content

Graph your Datasift account metrics in Graphite.

Project description

# Datasift Graphite

[![Build Status](https://travis-ci.org/lextoumbourou/datasift-graphite.svg?branch=master)](https://travis-ci.org/lextoumbourou/datasift-graphite)

Graph your Datasift account metrics in Graphite.

## Installation

```
> (sudo) pip install datasift-graphite
```

Chuck it in a [virtualenv](https://virtualenv.pypa.io/en/latest/) if you want.

## Usage

Run ``datasift-graphite --help`` for a full list of options, however, get started like this:

```
> datasift-graphite \
--user lex \
--apikey abc123 \
--graphite-host graphite.company.co \
--include-dpu-stats
```

To keep it running in the background, I'd recommend something like [Supervisor](http://supervisord.org/). Here's how I do it in Ubuntu 14:

1. ```> sudo apt-get install supervisor```

2. ```> vi /etc/supervisor/conf.d/datasift-graphite.conf```

```
[program:datasift-graphite]
command=datasift-graphite --user lex --apikey abc123 --graphite-host graphite.company.co --include-dpu-stats
redirect_stderr=true
stdout_logfile=/var/log/datasift-graphite.log
autostart=true
autorestart=true
```
3. ```> sudo service supervisor restart```

You can use whatever you like, though. I won't be offended.

## Examples

* Keep an eye on your Datasift PAYG credits: ```datasift.balance.credit```

* Track your Datasift usage per object: ``sumSeriesWithWildcards(aliasByNode(datasift.usage.streams.*.licenses.*, 5), 1)``

* Track your DPU costs: ``sumSeriesWithWildcards(aliasByNode(datasift.dpu.streams.*.dpu, 4), 1)``

*Note: I'm a bit of a Graphite noob, at the time of writing, so if you've got some better ideas, hit me up.*

## Metrics exposed

### balance

* ``datasift.balance.credit`` - The credit remaining on plan.

### usage

* ``datasift.usage.total_streams`` - Total number of streams.
* ``datasift.usage.streams.<stream_id>.seconds`` - Seconds connected.
* ``datasift.usage.streams.<stream_id>.licenses.<license_name>`` - number of objects of each type delivered.

### dpu


* ``datasift.dpu.streams.<stream_id>.dpu`` - DPU value for a stream.
* ``datasift.dpu.streams.<stream_id>.count`` - DPU count for a stream.
* ``datasift.dpu.streams.<stream_id>.targets.<target_name>.dpu`` - DPU count per stream, per target.
* ``datasift.dpu.streams.<stream_id>.targets.<target_name>.count`` - DPU count per stream, per target.

*Note: for targets and licenses, ``.`` will be replaced with ``-``, eg ``links.meta.description`` becomes ``links-meta-description``.*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasift-graphite-1.0.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file datasift-graphite-1.0.tar.gz.

File metadata

File hashes

Hashes for datasift-graphite-1.0.tar.gz
Algorithm Hash digest
SHA256 3d3c8b5d054e29ce9dde61e35f79d863603526058cbafe7835c20d77402c50aa
MD5 a144b641f7de64aa2df18ba7c7558f9e
BLAKE2b-256 9b5923cd9ff8070d8678190be98d1d9e4ea95d8e8a23aa6015a24cb14029020e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page