项目作者: florisporro

项目描述 :
Prometheus Heartbeat metric exporter
高级语言: JavaScript
项目地址: git://github.com/florisporro/prometheus-heartbeat.git
创建时间: 2018-11-12T18:25:03Z
项目社区:https://github.com/florisporro/prometheus-heartbeat

开源协议:

下载


Prometheus Heartbeat Metrics

I wanted to track the current internet availability of hardware that may move around the world with Prometheus. Preferably without adding dedicated monitoring software or hardware to the system, so I needed something that will run on almost any linux-based system.

The solution was a very simple NodeJS server that listens for incoming heartbeats made with simple HTTP GET requests, with an authentication header.

curl is enough to perform this request, and using cron a task can be scheduled to perform such a request every minute or so from even the simplest hardware.

Getting Started

  1. git clone https://github.com/florisporro/Prometheus_Heartbeat.git
  2. npm install
  3. SECRET=yoursecrethere npm run

That’s it! Server is now listening for incoming heartbeats on port 3000.

Try it out:

  1. curl --header "x-secret: yoursecrethere" http://localhost:3000/heartbeat/weeeee
  2. Followed by:
  3. curl http://localhost:3000/metrics

Deployment

A Docker image is available.

  1. docker run -p 3000:3000 -e "SECRET=yoursecrethere" florisporro/prometheus-heartbeat

Authors