0.0.3 • Published 3 years ago

@metrist/metrist-agent v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 years ago

Metrist In-Process Agent for NodeJS

MetristAgent is the agent NodeJS plugin. It intercepts HTTP calls and sends data to the local Metrist Monitoring Agent. To install simply run

  npm install @metrist/metrist-agent

Usage

As early in your application's lifecycle as possible, the agent should be initalized and connected:

import { MetristAgent } from "@metrist/metrist-agent";

const agent = new MetristAgent();
// or pass a host and port:
new MetristAgent({ host: 'HOST', port: 1234 });


agent.connect();


// Disconnect once your app closes
agent.disconnect();

The MetristAgent constructor can take an object that contains host and port to configure the telemetry destination, otherwise it will attempt to use the METRIST_MONITORING_AGENT_HOST and METRIST_MONITORING_AGENT_PORT environment variables or default to '127.0.0.1' and 51712.

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago