Coder Social home page Coder Social logo

microservice-admin-dashboard's Introduction

Introduction

This repository contains a microservice Dashboard and framework to operate the dashboard.

Dashboard:

  • Metrics and healtcheck viewer for your DropWizard microservices.
  • An overview of all microservices registered with Apache Zookeeper allong with the Netflix Curator plugin.
  • A detailed performance metric for each individual service Netflix Hystrix
  • Server overview that shows the CPU, RAM and Disk usage.
  • Centralized log management without external dependencies! (it reads your file log)

Framework:

The dashboard is shipped with a framework / library for dropwizard, which enables you to connect to the admin dashboard and use all its functions with the minimum line of code. It has the following features:

  • Registers and configures your service with Apache Zookeeper with a single line of code.
  • It has a build in ServiceLocator, you can call other services by name (without knowing their address and / or port).
  • The ServiceLocator uses the Netflix Feign library to call other services through Java interfaces.
  • It has Yammer Tenacity support build in.
  • It has build in authentication support by adding the following piece to your confguration file.
    authentication:
        servicename: Login_service
        path: /api/token/  

Screenshots

alt tag alt tag alt tag alt tag alt tag alt tag

Installation:

  • Install Apache Zookeeper and run it.
  • Download the dashboard here and extract the zip file.
  • Run the dashboard through the following command:
    java -jar dashboard-0.8.jar server config.yml
  • The dashboard should be up and running on http://localhost:8080

Getting started

There is an example project included, which you can use as a reference.

After you have got the dashboard up and running, create a new Dropwizard project.

  • Add the following dependency
    <dependency>
        <groupId>com.aegal</groupId>
        <artifactId>microservice-framework-core</artifactId>
        <version>0.8</version>
    </dependency>
  • Make your dropwizard Configuration class extend from MicroserviceConfig instead of the io.dropwizard.Configuration class.
  • Add the following line to your Dropwizard Application class:
    @Override
    public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
        bootstrap.addBundle(new MicroserviceBundle<>());
    }
  • Add the following to your configuration.yml file:
    discovery:
      serviceName: Example
      namespace: myapp
      #zookeeper:
      port: 2181
      listenAddress: 127.0.0.1
       
    server:
      applicationConnectors:
      - type: http
        port: 0                          
      adminConnectors:
      - type: http
        port: 0
      requestLog:
          timeZone: UTC
          appenders:
          - type: file
            currentLogFilename: /tmp/example_service.log
            archive: false
            threshold: ALL
      
    logging:
      appenders:
        - type: console
        - type: file
          currentLogFilename: /tmp/example_service.log
          archive: false
          threshold: ALL
  • The above snippet does the following things:
    • Defines the zookeeper connection properties.
    • Defines the name of the service (Example) and the namespace (important for the dashboard)
    • Tells the application to use a random port (0)
    • Configures logging (the log file will be used for centralized logging).

Optionally:

  • Use the Hystrix Latency and fault tolerance library by adding the following things to your Dropwizard Application class:
    public enum DependencyKeys implements TenacityPropertyKey {
        Action;

        public static TenacityPropertyKeyFactory getTenacityPropertyKeyFactory() {
            return new TenacityPropertyKeyFactory(){
                @Override
                public TenacityPropertyKey from(String value) {
                    return DependencyKeys.valueOf(value.toUpperCase());
                }
            };
        }
    }
     
    @Override
    public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
        bootstrap.addBundle(new MicroserviceBundle<>());
        bootstrap.addBundle(TenacityBundleBuilder.newBuilder()
                .propertyKeyFactory(DependencyKeys.getTenacityPropertyKeyFactory())
                .propertyKeys(DependencyKeys.values())
                .build());
    }
     
    @Override
    public void run(ExampleConfiguration exampleConfiguration, Environment environment) throws Exception {
        environment.jersey().register(ExampleResource.class);

        InitializeTenacity.initialize(DependencyKeys.values());
    }

Version

0.8

Tech

This project uses a number of open source projects to work properly:

  • [Apache Zookeeper] - for service discovery
  • [Netflix Curator] - Zookeeper client wrapper.
  • [Netflix Hystrix] - Latency and fault tolerance library
  • [Netflix Feign] - java to http client binder
  • [Yammer Tenacity] - Dropwizard integration with Netflix Hystrix
  • [Dropwizard] - Java Framework
  • [AngularJS] - for the front-end
  • and more...

License

MIT

microservice-admin-dashboard's People

Contributors

abduegal avatar

Watchers

 avatar  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.