Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.92 KB

README.md

File metadata and controls

80 lines (52 loc) · 1.92 KB

Ninja Framework + Prometheus by Fizzed

Maven Central

Fizzed, Inc. (Follow on Twitter: @fizzed_inc)

Overview

Integration of Prometheus with the Ninja Framework.

Setup

Add the prometheus-ninja-module dependency to your Maven pom.xml

<dependency>
    <groupId>com.fizzed</groupId>
    <artifactId>prometheus-ninja-module</artifactId>
    <version>0.0.5</version>
</dependency>

In your conf/Module.java file:

package conf;

import com.fizzed.prometheus.ninja.NinjaPrometheusModule;
import com.google.inject.AbstractModule;

public class Module extends AbstractModule {

    @Override
    protected void configure() {
        install(new NinjaPrometheusModule());
    }

}

In your conf/Routes.java file:

package conf;

import com.fizzed.prometheus.ninja.NinjaPrometheusRoutes;
import ninja.Results;
import ninja.Router;
import ninja.application.ApplicationRoutes;

public class Routes implements ApplicationRoutes {

    @Override
    public void init(Router router) {
        
        NinjaPrometheusRoutes.init(router);

    }
    
}

Demo

There is a Ninja app in the demo folder that demonstrates all the functionality this module provides and it's a simple way to see how it works. This project uses Blaze to help script tasks. Run the following in your shell (from the root project directory, not in demo):

java -jar blaze.jar demo

Once running, point your browser to http://localhost:8080/

License

Copyright (C) 2020 Fizzed, Inc.

This work is licensed under the Apache License, Version 2.0. See LICENSE for details.