0.0.11 • Published 7 years ago

rover-mdd v0.0.11

Weekly downloads
45
License
private (c) ambri...
Repository
-
Last release
7 years ago

Rover MDD

A logging and monitoring library for GCP/Stackdriver

Installation (client)

Use npm: npm install -s rover-mdd

Logging

Basic Usage

To log something, you simply import the logger and use the syntax below. Note: this function is not fully typed yet (issue here)

To provide a payload, just add a second argument.

Levels include: silly, debug, verbose, info, warn, error where only info, warn, error will be used

If you require a different config, see "Advanced Usage" below

import { logger } from 'rover-mdd';
...
logger.info('Simple log');
logger.warn('With payload', { foo: 'bar', stuff: 123})

Advanced Usage

We are also exporting a logger, which allows you to specify the minimal log level it passes on:

import { advancedLogger } from 'rover-mdd';

// if you need a logger that only passes on errors
const myToughLogger = advancedLogger('error');

logger.warn('silence...'); // won't be passed
logger.error('BOOM');

Monitoring

To monitor, use the metric builder to create a metric, by providing a service, a metric name and the GCP projectId. This will return a function that expects one or many labels and a number as metric.

This functionality will be extended later. For now only numbers are expected. The monitoring will be timeseries based, where the timestamp etc is added in the library.

import { metricBuilder } from 'rover-mdd';
...
// create a metric
const myMetric = metricBuilder({
  service: 'Matterhorn',
  metricName: 'PhotosTaken',
  projectId: 'staging-rover',
});
...
myMetric({ labels: {someTag: 'label', somethingElse: 'anotherLabel'}, metric: 123})

Development

  • Clone
  • npm install
  • develop
  • increase version (not automated as of now)
  • npm run publish
0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago