npm.io
0.8.1 • Published 5 years ago

sqreen-sdk

Licence
MIT
Version
0.8.1
Deps
1
Size
19 kB
Vulns
23
Weekly
0

Standalone SDK for Sqreen API

Usage

Installation

The module is available as sqreen-sdk:

$ npm i -S sqreen-sdk
Auth

Before sending any signal to Sqreen ingestion API, the init method must be called first to setup the authentication token and initialize the batch.

const SqreenSDK = require('sqreen-sdk');
// SqreenSDK.init(token, max batch size, max batch age in seconds)
SqreenSDK.init('<my application token>', 100, 60);

The batch is part of the reporting system of the SDK. It means that the signals placed into it, will be reported together when one of the following condition is reached:

  • the batch size reached it's max value
  • the batch is not empty and has not been reported in the interval set as its max age.
Creating Points
Creating Metrics
Creating Traces
HTTP Traces
Usage with Express