Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

eyebeam

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eyebeam

Prometheus dashboard

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Eyebeam

Dashboard for prometheus metrics

Example

Result

example

Simple express server with prometheus metrics

const express = require('express');
const { collectDefaultMetrics, register, Counter } = require('prom-client');
const eyebeam = require('../dist');

const PORT = 3000;

collectDefaultMetrics();

const app = express();
const counter = new Counter({ name: "metrics_counter", help: "Total metrics calls" });

app.get('/', (req, res) => {
    res.send('Hello World!');
});


app.get('/metrics', (req, res) => {
    counter.inc();
    res.setHeader('Content-Type', register.contentType);
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.send(register.metrics());
});

app.get('/eyebeam', eyebeam.handler({ url: `/metrics`, interval: 1500 }));

app.listen(PORT, () => {
    console.log(`Express server http://localhost:${PORT}`);
    console.log(`Prometheus metrics http://localhost:${PORT}/metrics`);
    console.log(`Eyebeam dashboard http://localhost:${PORT}/eyebeam`);
});

Run

npm run example

Keywords

prometheus

FAQs

Package last updated on 19 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts