Skip to content
Vamp Node.js Client
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
api.js
digest-check.js
elasticsearch_client_factory.js
elasticsearch_metrics.js
http.js
index.js
log.js
package-lock.json
package.json
prometheus_metrics.js
sample.js
util.js

README.md

Vamp Node.js Client

This is the NodeJS implementation for Vamp client.

Install using node install.

Info

let _ = require('highland');
let vamp = require('vamp-node-client');

let api = new vamp.Api();
    
api.info().each(function (info) {
    _.log(info.message);
});

Configuration

api.config().each(function (config) {
    _.log(config['vamp.info.message']);
});

Publishing an event

api.event(['tag1:a', 'tag2:b'], 'abcd');

Example using Elasticsearch metrics

let _ = require('highland');
let vamp = require('vamp-node-client');

// overriding configuration
let api = new vamp.Api({
    host: 'http://localhost:9090', // by default: $VAMP_URL || 'http://127.0.0.1'
    path: '/api/v1'                // by default: '/api/v1'
});

let metrics = new vamp.ElasticsearchMetrics(api);
metrics.average({ ft: 'abc' }, 'Tt', 30).each(function(response) {
    // response.total, response.rate, response.average
    _.log(response);
});

Event digest validation

Run node digest-check.js [directory] [salt]:

  • directory - directory where event json files are
  • salt - SHA1 salt used for creating original event digests (signatures)
You can’t perform that action at this time.