Code Monkey home page Code Monkey logo

microservice-bootstrap's Introduction

microservice-bootstrap

This library is in maintanance mode. We recommend migrating to bootstrap-play-{25,26}.

This library implements a basic Play Global object and related functionality for frontend applications.

Creating a Global object for your microservice application

Simply create an object extending DefaultMicroserviceGlobal. That will provide you with the common filters and error handling. You can also override microserviceFilters attribute if you need to alter the default set of filters.

Metrics plugin

To enable the Metrics plugin in your application, add this line to your play.plugins file:

1:com.kenshoo.play.metrics.MetricsPlugin

and a block similar to this in your Play application config file:

metrics {
    name = ${appName}
    rateUnit = SECONDS
    durationUnit = SECONDS
    showSamples = true
    jvm = true
    enabled = true
}

You can also enable the plugin's admin servlet by adding this line to your routes file:

GET     /admin/metrics          com.kenshoo.play.metrics.MetricsController.metrics

and configure the controller in your application conf file:

controllers {
    com.kenshoo.play.metrics.MetricsController {
        needsAuth = false
        needsLogging = false
        needsAuditing = false
    }
}

Publishing metrics to Graphite

To enable Graphite publisher in your application, add a block like this to your application conf file:

microservice {
    metrics {
        graphite {
            host = graphite
            port = 2003
            prefix = play.${appName}.
            enabled = true
        }
    }

and point your Global object (inherited from DefaultMicroserviceGlobal ) to it

override def microserviceMetricsConfig(implicit app: Application): Option[Configuration] = app.configuration.getConfig("microservice.metrics")

Installing

Add the following to your SBT build:

resolvers += Resolver.bintrayRepo("hmrc", "releases")

libraryDependencies += "uk.gov.hmrc" %% "microservice-bootstrap" % "[INSERT-VERSION]"

License

This code is open source software licensed under the Apache 2.0 License.

microservice-bootstrap's People

Contributors

adrianrapan avatar andynewton avatar arminio avatar barriem avatar beyond-code-github avatar charleskubicek avatar chotai avatar christopherjturner avatar colin-lamed avatar dabd avatar danewatts avatar duncancrawford avatar erasmos avatar franekrichardson avatar iteratoruk avatar jachro avatar jakobgrunig avatar jm2dev avatar konradwudkowski avatar lotia avatar nigelhp avatar philsegal avatar platops-teams-and-repositories-labs avatar rjshep avatar rm-hull avatar saurabharora80 avatar scottkwalker avatar thomasrynnehmrc avatar tomasz-rosiek avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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

microservice-bootstrap's Issues

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.