circonus-labs / circonus-cip Goto Github PK
View Code? Open in Web Editor NEWCirconus Instrumentation Package
Circonus Instrumentation Package
Hey!
Yesterday I tried to integrate my node application by using circonous-cip
npm package and trap method. This is how my code looks like:
import * as circonus_cip from 'circonus-cip';
import * as express from 'express';
import { Logger } from '../logger/logger';
import { IMetricsOptions } from './configuration';
export class MetricsStorage {
private readonly trap = circonus_cip.makeTrap(
this._opts.uuid,
this._opts.secret,
);
constructor(app: express.Express, private readonly _opts: IMetricsOptions) {
if (!this._opts.secret || !this._opts.uuid) {
Logger.getLogger().warn(
`Metrics are disabled - undefined secret or uuid`,
);
return;
}
app.use(circonus_cip.express(this._opts.uuid, this._opts.secret));
}
public addMetric(name: string, value: number | string | boolean) {
this.trap.record(name, value);
}
}
The main issue that I have with this code is:
To detect problem with 0 value I used new Date().getTime()
value to always have different big value. Example code:
service.metrics.addMetric('sample', new Date().getTime());
Am I doing something wrong? It seems like package contains all necessary data but circonous anyway display 0 on each chart :(
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.