Code Monkey home page Code Monkey logo

express-actuator's Introduction

Express Actuator

npm version Build Status Coverage Status Dependencies Status

This middleware creates a series of endpoints to help you monitor and manage your application when it's pushed to production.

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

Endpoints

These are the endpoints available:

  • /info - Displays application information.

    {
        "build": {
            "description": "This is my new app",
            "name": "MyApp",
            "version": "1.0.0"
        },
        "git": {
            "branch": "master",
            "commit": {
                "id": "329a314",
                "time": 1478086940000
            }
        }    
    }

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

    1. If the express app is executed with npm start it will get the data from process.env
    2. If the express app is executed with node app.js the module will look for a file named package.json where the node command was launched.
    3. 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 - Shows ‘metrics’ information for the current application.

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

Installation

$ npm install express-actuator --save

Usage

var actuator = require('express-actuator');

var app = express();

app.use(actuator());

If you want the endpoints to be available on a custom endpoint you can do so:

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

express-actuator's People

Contributors

rcruzper avatar

Watchers

Kevin Barz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.