1.0.0 • Published 3 years ago

ts-vigil-reporter v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

vigil-reporter-ts

Vigil Reporter for Node written in TypeScript. Used in pair with Vigil

Vigil Reporter is used to actively submit health information to Vigil from your apps. Apps are best monitored via application probes, which are able to report detailed system information such as CPU and RAM load. This lets Vigil show if an application host system is under high load.

How to install?

Include vigil-reporter-ts in your package.json dependencies.

Alternatively, you can install it via the package manager cli.

$ npm i ts-vigil-reporter
// Or if you prefer Yarn 
$ yarn add ts-vigil-reporter

How to use?

1. Create reporter

vigil-reporter can be instantiated as such:

import Vigil from "./Vigil";

const client: Vigil = new Vigil({
    url: 'https://status.example.com',  // `page_url` from Vigil `config.cfg`
    token: 'YOUR_SECRET_TOKEN',         // `reporter_token` from Vigil `config.cfg`
    probe: 'relay',                     // Probe ID containing the parent Node for Replica
    node: 'socket-client',              // Node ID containing Replica
    replica: '10.44.0.5',               // Unique Replica ID for instance. **Optional**
    interval: 30,                       // Reporting interval. **Optional**
    debug: false,                       // Enable console.log debug. **Optional**
    timeout: 10,                        // Timeout connecting Vigil server. **Optional**                    
    headers: {'X-Proxy-Auth': '1234'}   // Custom HTTP headers to be sent Vigil. **Optional**
});

You can also use REPLICA_MODE_IP or REPLICA_MODE_HOSTNAME as replica value. This will make your replica id always be your IP or Hostname.

For better details, please see the Options.ts interface.

2. Teardown reporter

If you need to teardown an active reporter, you can use the end(options) method to unbind it (options is optional).

client.end(/* flush: boolean */);

What is Vigil?

Wondering what Vigil is? Check out valeriansaliou/vigil

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago