All Projects → rcruzper → express-actuator

rcruzper / express-actuator

Licence: MIT license
Express middleware with endpoints to help you monitor and manage applications

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to express-actuator

redis-healthy
It retrieves metrics, periodically, from Redis (or sentinel) and send them to Logstash
Stars: ✭ 62 (-12.68%)
Mutual labels:  monitor, health-check
chrome-extension-aspectratio219
🖥️ Fit the screen properly in fullscreen mode on monitor ultrawide with 21:9 aspect ratio (Netflix, Youtube, PrimeVideo, Crunchyroll)
Stars: ✭ 28 (-60.56%)
Mutual labels:  monitor
dynamic-threadpool
📌 强大的动态线程池框架,附带监控报警功能。支持 JDK、Tomcat、Jetty、Undertow 线程池;Dubbo、Dubbox、RabbitMQ、RocketMQ、Hystrix 消费线程池(更多框架线程池还在适配中)。内置两种使用模式:轻量级依赖配置中心以及无中间件依赖版本。
Stars: ✭ 3,609 (+4983.1%)
Mutual labels:  monitor
RS232-Monitor-Database
🔌📺 This is a public database for all the known RS232 commands for professionnal screens, monitors and projectors. Feel free to contribute !
Stars: ✭ 22 (-69.01%)
Mutual labels:  monitor
microservice-graph-explorer
Navigate and explore all of the microservices in your application in real time using the real application connections.
Stars: ✭ 71 (+0%)
Mutual labels:  health-check
monitor
mac 实时网速监控 bandwidh monitor
Stars: ✭ 23 (-67.61%)
Mutual labels:  monitor
homebridge-callmonitor
Signals incoming and outgoing calls using the call monitor facility in Fritz!Box devices via HomeKit
Stars: ✭ 25 (-64.79%)
Mutual labels:  monitor
uptime-kuma
A fancy self-hosted monitoring tool
Stars: ✭ 27,425 (+38526.76%)
Mutual labels:  monitor
SAPNetworkMonitor
Based on niping for sap network monitoring QQ群: 651878914
Stars: ✭ 48 (-32.39%)
Mutual labels:  monitor
statoo
`statoo` is a super simple http GET tool for checking site health
Stars: ✭ 28 (-60.56%)
Mutual labels:  health-check
YappyGitLab
A GitLab monitor bot for Discord
Stars: ✭ 51 (-28.17%)
Mutual labels:  monitor
ZKShS
Search shodan without any knowledge about its queries
Stars: ✭ 37 (-47.89%)
Mutual labels:  monitor
Unknown-Logger
An advanced Windows Keylogger with features like (Disable CMD, Screenshotter, Client Stub Builder, Low Level Keyhooks, Hide Application, Respawner, Delete Chrome and Firefox data, and more!)
Stars: ✭ 23 (-67.61%)
Mutual labels:  monitor
swoole-link-monitor
基于swoole 定时器与woker 实现链路监控
Stars: ✭ 34 (-52.11%)
Mutual labels:  monitor
PerformanceAnalyzer
Under the iOS platform, the analyzer is a tool which statistics CPU, FPS, Memory, Loading-Time and provides the output of statistical data. And contain SQL execution time monitor base on FMDatabase and UI refresh in main thread monitor
Stars: ✭ 42 (-40.85%)
Mutual labels:  monitor
iOS-Monitor-Resources
对各厂商的 iOS SDK 性能监控方案的整理和收集后的资源
Stars: ✭ 31 (-56.34%)
Mutual labels:  monitor
gochanges
**[ARCHIVED]** website changes tracker 🔍
Stars: ✭ 12 (-83.1%)
Mutual labels:  monitor
bull-monitor
🐂 Standard UI for Bull and BullMQ.
Stars: ✭ 89 (+25.35%)
Mutual labels:  monitor
idfx
Tool for flash/monitor ESP-IDF and ESP8266_SDK apps on the WSL2 ⚡
Stars: ✭ 71 (+0%)
Mutual labels:  monitor
pm2-docker
Monitor Docker Daemon (expose host docker daemon for monitoring)
Stars: ✭ 21 (-70.42%)
Mutual labels:  monitor

Express Actuator

npm version Build Status Coverage Status Known Vulnerabilities Libraries.io dependency status for latest release npm

This middleware creates a series of endpoints to help you monitor and manage your application when it's pushed to production. It's useful when you run your application on kubernetes and you are in need of endpoints for readiness/liveness probe.

It is based on Spring Boot Actuator and the healthcheck-ping module by Mathias Schreck.

Table of Contents

Endpoints

ID Description
info Displays application information.
metrics Shows metrics information for the current application.
health Shows application health information.

Installation

$ npm install --save express-actuator

Typescript

$ npm install --save-dev @types/express-actuator

Usage

const actuator = require('express-actuator');
const app = express();

app.use(actuator());

Configuring Actuator

All defined options are optional:

const options = {
    basePath: '/management', // It will set /management/info instead of /info
    infoGitMode: 'simple', // the amount of git information you want to expose, 'simple' or 'full',
    infoBuildOptions: null, // extra information you want to expose in the build object. Requires an object.
    infoDateFormat: null, // by default, git.commit.time will show as is defined in git.properties. If infoDateFormat is defined, moment will format git.commit.time. See https://momentjs.com/docs/#/displaying/format/.
    customEndpoints: [] // array of custom endpoints
};

app.use(actuator(options));

Custom Endpoints

You can add your own validations using the customEndpoints option:

const options = {
    customEndpoints: [
        {
            id: 'dependencies', // used as endpoint /dependencies or ${basePath}/dependencies
            controller: (req, res) => { // Controller to be called when accessing this endpoint
                // Your custom code here
            }
        }
    ]
};

app.use(actuator(options));

IMPORTANT:

  1. If you call your custom endpoint info it WILL override the default info.
  2. If you provide basePath, your id will be available as ${basePath}/${id}, otherwise, just /${id}.
  3. Consider lightweight code being processed by your endpoint controller or it will compete with your main application.

Deprecated mode

To have backward compatibility with previous versions (<= 1.2.0) the legacy way is still available:

app.use(actuator('/management')); // It will set /management/info instead of /info

IMPORTANT: Deprecated mode will be removed in the next major version.

Endpoints Examples

info

{
    "build": {
        "description": "This is my new app",
        "name": "MyApp",
        "version": "1.0.0"
    },
    "git": {
        "branch": "master",
        "commit": {
            "id": "329a314",
            "time": "2016-11-18 08:16:39-0500"
        }
    }
}

IMPORTANT: To get this information the middleware have some sort of logic:

  1. When the express app is executed with node app.js or npm start the module will look for a file named package.json where the node command was launched.
  2. Git information will show only if exists a git.properties file where the app was launched. You can use node-git-info to generate this file.

metrics

{
    "mem": {
        "heapTotal": 14659584,
        "heapUsed": 10615072,
        "rss": 30093312
    },
    "uptime": 19.797
}

health

{
  "status": "UP"
}

Application Information

Git Commit Information

The info endpoint has a feature to publish information about your git source code repository. If a git.properties file is available on your project path, the git.branch, git.commit.id, and git.commit.time properties are exposed.

TIP: You can use node-git-info to generate git.properties file on your project.

If you want to display the full git information (that is, the full content of git.properties), use the infoGitMode property, as follows:

const options = {
    infoGitMode: 'full'
};

app.use(actuator(options));

Contributing

Third-party contributions are welcome! 🙏🏼 See CONTRIBUTING.md for step-by-step instructions.

If you need help or have a question, let me know via a GitHub issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].