Giter Site home page Giter Site logo

oslabs-beta / datadoc Goto Github PK

View Code? Open in Web Editor NEW
67.0 3.0 1.0 3.52 MB

Endpoint downtime detection, monitoring, and traffic simulation developer tool

License: MIT License

Shell 0.20% JavaScript 95.93% HTML 1.07% SCSS 2.81%
data-observability monitoring-tool traffic-simulation devtool express-js

datadoc's Introduction

DataDoc

DataDoc is an endpoint monitoring, detection and traffic simulation tool that provides real-time metrics and customizable alert notifications.

Table of Contents

Getting Started

Prerequisites

  • Node.js v18^
  • Docker

Installation

This tool requires the npm package express-endpoints-monitor to detect and gather metrics for endpoints in your Express application. To understand how to use this plugin, see the full documentation.

  1. Run the following terminal command in your project directory that you would like to begin monitoring:

    npm install express-endpoints-monitor
    

    This should have created a express-endpoints-monitor/ folder in your node_modules/ directory

  2. WIP: Clone this repository. Unzip the file in a separate folder and open a terminal in this directory. Run the following commands:

    npm install
    npm run build
    

    This will install the needed dependences and build the desktop application.

Exposing Endpoints to the Monitoring Tool

  1. Open your Express application file in a text editor. At the top of the file, import the plugin by adding:

    const expMonitor = require("express-endpoints-monitor");
    

    This module comes with several functions to register endpoints with the monitoring application and begin log requests made to those endpoints.

  2. In your file, include the following line:

    app.use(expMonitor.gatherMetrics);
    

    This will record metrics for incoming requests and make them available to the metrics API which will be set up later.

  3. Under an endpoint that you would like to begin monitoring, include the expMonitor.registerEndpoint middleware. For example, this may look like:

    app.get(...,
      expMonitor.registerEndpoint,
      ...
    );
    

    The order of this function in the middleware chain is not important. This middleware will stage this particular endpoint for exporting, and can be used in multiple endpoints.

  4. Once all desired endpoints have been registered, they must be exported on the metrics server. In your app.listen declaration, add these lines to the passed-in callback function:

    app.listen(..., function callback() {
      ...
      expMonitor.exportEndpoints();
      startMetricsServer(<METRICS_SERVER_PORT>)
    )
    

    This will start up a metrics server on METRICS_SERVER_PORT. If this argument is not specified, it will resolve to 9991. The server includes several endpoints, one of which is GET /endpoints which responds with the list of registered endpoints in JSON format.

    Alternatively, if you would like to export all endpoints, you may replace the above snippet with the exportAllEndpoints function:

    app.listen(..., function callback() {
      ...
      expMonitor.exportAllEndpoints();
      startMetricsServer(<METRICS_SERVER_PORT>)
    )
    

    This will expose all endpoints regardless of whether they include the registerEndpoint middleware.

  5. Your application is ready to start monitoring! To verify your setup, use a browser or API testing tool to interact with the metrics API started at http://localhost:<METRICS_SERVER_PORT>. The list of available endpoints is:

    • GET /endpoints
    • GET /metrics
    • DELETE /metrics
  6. To see the full use of the library, see the npm page.

Initializing Databases

In your local DataDoc folder, run the following command:

docker compose up

The -d flag may be supplied to detach the instance from the terminal.

Starting the Desktop Application

  1. In your local DataDoc folder, run the following command if you haven't during the installation steps:

    npm build
    

    This command only needs to be run once.

  2. WIP: In the same folder, run the following command to start the desktop application:

    npm start
    

How to Use

Adding Workspaces

Using the Monitoring Tool

Using the Simulation Tool

Configuring Alerts

Tech Stack

Electron

React

MaterialUI

MaterialUI

Express

Node.js

npm

Postgres

InfluxDB

Twilio

Docker

Webpack

Authors

datadoc's People

Contributors

jamieschiff avatar jh51 avatar jochuang avatar mariamzakariadze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

shaikshahid98

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.