Git Product home page Git Product logo

reactor-monitoring-demo's Introduction

Reactor monitoring demo

Preparation

You will need Java 8+, Docker and Docker Compose installed.

Quick start

  1. Start Prometheus & Grafana with Docker Compose:

    $ docker-compose up -d

    It will start Grafana in port 3000 and Prometheus on port 9090.

  2. Open Grafana and explore the dashboards:

    • "Schedulers" - dashboard for various metrics reported by Reactor's schedulers
    • "Business" - dashboard with a few metrics related to the business logic based on Reactor's metrics mechanism
  3. Start com.example.demo.DemoApplication

    The application is a simple Spring Boot application that listens to Wikipedia's change stream and exposes the latest change via HTTP endpoint GET /latestChange.

    It enables Reactor schedulers' metrics by calling Schedulers.enableMetrics().

    The processing pipeline converts the received change into a human readable form. Note that it does not know how to process the updates from bots and reports an error.

    There are two "reactive" metrics in the pipeline:

    1. recentchange for every event sent by the Wikipedia stream
    2. processing for every result of the processing
  4. Once the application is started, you should start seeing the metrics in Grafana.

    Try hitting various endpoints of the app to observe the changes on the "Schedulers" dashboard. For instance, you can run some load on GET /latestChange or GET /actuator/health with tools like WRK:

    $ wrk -t12 -c1000 -d30s http://localhost:8080/actuator/health
    Running 30s test @ http://localhost:8080/actuator/health
      12 threads and 1000 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency    24.40ms   51.39ms   2.00s    99.10%
        Req/Sec     3.34k   651.18     5.31k    70.00%
      1197831 requests in 30.07s, 130.23MB read
      Socket errors: connect 0, read 1081, write 0, timeout 14
    Requests/sec:  39834.50
    Transfer/sec:      4.33MB

Where to find the dashboards' definitions

If you want to import them into your running Grafana, see dashboards/ folder for the Grafana dashboard definitions in JSON format.

One can also export the definition from the UI by clicking on "Share dashboard -> Export -> View JSON".

reactor-monitoring-demo's People

Contributors

bsideup 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactor-monitoring-demo's Issues

App doesn't quit gracefully

Expected Behavior

CTRL-C-ing the application that was started with java -jar .. should let it terminate gracefully.

Actual Behavior

The app starts spitting lots of exceptions, I've seen at least "Too many open files", and doesn't seem to want to stop on its own. Had to kill -9 the pid.

Steps to Reproduce

Run the app, CTRL-C it.

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.