# instrumental

> An agent for instrumentalapp.com. Supports the full collector protocol.

Latest version **0.2.1** (published 2015-04-06) · 0 weekly downloads

## Install

```sh
npm install instrumental
pnpm add instrumental
yarn add instrumental
bun add instrumental
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2015-04-06 |
| First published | 2013-08-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alec Gorge |
| Maintainers | alecgorge, jackboberg |
| Keywords | instrumental, stats, metrics |

## Links

- npm: https://www.npmjs.com/package/instrumental
- Repository: https://github.com/alecgorge/node-instrumental-agent
- Issues: https://github.com/alecgorge/node-instrumental-agent/issues
- npm.io page: https://npm.io/package/instrumental

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) 1.5.x

## Recent versions

- 0.2.1 (latest) — 2015-04-06
- 0.2.0 — 2013-08-15
- 0.1.0 — 2013-08-15

## README

# Instrumental for Node

A node.js agent for instrumentalapp.com. It supports the full [collector protocol](https://instrumentalapp.com/docs/collector/readme).

## Installation

````
npm install instrumental
````

## Usage

The only settings that should need changing are `api_key` and perhaps `max_queue_size` if you have very frequent/infrequent data.

````javascript
I = require('instrumental')
I.setup({
	// from here: https://instrumentalapp.com/docs/setup
	api_key			: "your_api_key", 		 
	
	// optional, default shown
	hostname 		: 'instrumentalapp.com', 
	
	// optional, default shown
	port 			: 8000,					 
	
	// optional, default shown. disconnect from the server
	// after this many milliseconds.
	timeout			: 10000,				 
	
	// optional, default shown. metrics will only be sent
	// to the server when this many have been queued,
	// reconnecting if necessary.
	max_queue_size	: 100,					 

}, function (is_api_key_valid) {
	// optional!
	//
	// this is called everytime the agent connects 
	// to the server to send metrics. it can indicate
	// a successful or unsuccessful connection based on
	// is_api_key_valid.
});

I.increment('metric.name', /* increment_by = 1, timestamp = now */);

I.gauge('metric.name', 82.12, /* timestamp = now */);

I.gauge_absolute('metric.name', 12.12, /* timestamp = now */);

I.notice('This is a notice', /* duration = 0, timestamp = now */);

// this forces the agent to send all current metrics to the server.
// good to call when the server is shutting down or similar
I.flush();
````

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