# heroin-js-librato

> Librato config as code

Latest version **1.1.0** (published 2019-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install heroin-js-librato
pnpm add heroin-js-librato
yarn add heroin-js-librato
bun add heroin-js-librato
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-07-22 |
| First published | 2016-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 36.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mateusz Kwasniewski |
| Maintainers | kwasniew |

## Links

- npm: https://www.npmjs.com/package/heroin-js-librato
- npm.io page: https://npm.io/package/heroin-js-librato

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [is-subset](https://npm.io/package/is-subset.md) 0.1.1
- [good-guy-http](https://npm.io/package/good-guy-http.md) 1.12.2

## Recent versions

- 1.1.0 (latest) — 2019-07-22
- 1.0.0 — 2019-05-10
- 0.4.3 — 2016-05-16
- 0.4.2 — 2016-05-16
- 0.4.1 — 2016-05-16
- 0.4.0 — 2016-05-16
- 0.3.0 — 2016-05-12
- 0.2.0 — 2016-05-06
- 0.1.1 — 2016-05-06
- 0.1.0 — 2016-05-06
- 0.0.1 — 2016-05-06

## README

HeroIn plugin for Librato
-------
[![Build Status](https://travis-ci.org/Schibsted-Tech-Polska/heroin-js-librato.svg?branch=master)](https://travis-ci.org/Schibsted-Tech-Polska/heroin-js-librato)

Adding addon to HeroIn
------

```javascript
var configurator = heroin(process.env.HEROKU_API_TOKEN);
configurator.addPlugin(require('heroin-js-librato').plugin);
```
```javascript
var test = {
    name: 'my-heroku-app',
    addons: {
        librato: {plan: 'librato:nickel', alerts: require('./alerts') },
    }
};
```

Inside alerts.js
```javascript
var alerts = [{
    name: 'myapp.status5xx.high',
    description: null,
    conditions: [{
        type: 'above',
        metric_name: 'router.status.5xx',
        source: null,
        threshold: 40,
        duration: 600,
        summary_function: 'sum'
    }],
    services: [{
        type: 'slack',
        settings: {url: 'https://hooks.slack.com/services/xyz'},
        title: 'my-chat:#myapp-alerts'
    }],
    attributes: null,
    active: true,
    version: 2,
    rearm_seconds: 1800,
    rearm_per_signal: false
}];
module.exports = alerts;
```

Notes
------
Only paid librato account allows for alert configuration.

If you leave out alerts key in the addon config it won't delete existing alerts.
```javascript
var test = {
    name: 'my-heroku-app',
    addons: {
        librato: { plan: 'librato:nickel' },
    }
};
```

If you set alerts to empty array it will delete existing alerts.
```javascript
var test = {
    name: 'my-heroku-app',
    addons: {
        librato: { plan: 'librato:nickel', alerts: [] },
    }
};
```

Alerts format matches librato API https://www.librato.com/docs/api/#alerts and https://www.librato.com/docs/api/#services.

You don't need to deal with service IDs as this plugin handles them on your behalf. All you need to do is specify notification service settings.

---
_Source: https://npm.io/package/heroin-js-librato · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
