Giter VIP home page Giter VIP logo

kamon-cloudwatch's Introduction

Kamon AWS Cloudwatch Extension

Build Status GitHub release Maven Central Mergify Status

Overview

A simple Kamon extension to ship metrics data to Cloudwatch using Amazon's async client.

Note: This project has been initially forked from Timeout's kamon-cloudwatch but evolved separately as the original one has fallen out of maintenance.

Version Compatibility Matrix

The following table maps Kamon core version with the version of this library:

Kamon Core Kamon CloudWatch Scala JDK
1.0.0 1.0.0 2.10,2.11,2.12 1.8+
2.0.0 1.1.x 2.11,2.12,2.13 1.8+

Getting Started

Add library dependency to your build.sbt

libraryDependencies += "com.github.alonsodomin" %% "kamon-cloudwatch" % "<version>"

The module will be loaded automatically and you should see "Starting the Kamon CloudWatch extension" message in your logs output.

Note: Be sure the box in which this is going to be used, has the proper access credentials to send data to AWS CloudWatch. The preferred approach would be to either use an InstanceProfile or roles in the case of ECS/Docker Containers. Another way would be to have the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set correctly.

Kamon 1.0 users

If using Kamon 1.x, you will need to register it manually during application startup:

val reporter = new CloudWatchReporter()
Kamon.addReporter(reporter)

Configuration

You can configure the module behaviour by overriding any of the following settings in your application.conf file:

kamon {
  cloudwatch {

    # namespace is the AWS Metrics custom namespace
    namespace = <application name>
    
    # (Optional) AWS region, on ec2 region is fetched by getCurrentRegion command
    region = eu-west-1

    # batch size of data when send to Cloudwatch. Default: 20
    batch-size = 20

    # how many threads will be assigned to the pool that does the shipment of metrics. Default: 5
    async-threads = 5
    
    # whether to add Kamon environment tags to each of the metrics. Default: false
    include-environment-tags = false

    # explicit aws access key and secret definition (optional)
    # if not specified values fetched from one of the followings
    #   * AWS_PROFILE env variable
    #   * AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables
    #   * Amazon EC2 Instance Metadata
    # access-key-id = ""
    # secret-access-key = ""

  }
}

AWS Cloudwatch Example

  • log on to Cloudwatch, the metrics will be appearing on 'Custom namespaces' section under "Metrics" menu, i.e.: alt text

License

kamon-cloudwatch's People

Contributors

alonsodomin avatar barrydobson avatar kcaipq avatar mergify[bot] avatar scala-steward avatar stsatlantis avatar vaslabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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