honeycomb-monitoring
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Honeycomb Monitoring

JS SDK to send performance and monitoring markers to HoneyComb in a consistent way.

Installation

npm install honeycomb-monitoring

yarn add honeycomb-monitoring

Usage

Initialization

import Monitor from 'honeycomb-monitoring';

const writeKey = 'XX-HONEY-COMB-WRITE-KEY-XX';
const dataset = 'sample-dataset';
const enabled = process.ENV === 'prod'

const monitor = Monitor(writeKey, dataset, enabled);

Reporting

// Generic event
monitor.reportGenericEvent('event-name');

// Error
monitor.reportError('event-name', new Error('uh oh'));
monitor.reportError('event-name', '401');
monitor.reportError('event-name', { error: 'danger' });

// Duration
monitor.reportDurationStart('event-name');
/** some code **/
monitor.reportDurationEnd('event-name');

// Number of events/items per interval
monitor.reportIntervalCount('event-name', 100, Interval.minute);

API Middleware

app.use(monitor.responseTimeMiddleware());

Development

Testing

yarn test

Building

yarn build

Readme

Keywords

none

Package Sidebar

Install

npm i honeycomb-monitoring

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

138 kB

Total Files

5

Last publish

Collaborators

  • srogers202