Skip to content

Quick extension to ship Kamon metrics to Amazon Cloudwatch

License

Notifications You must be signed in to change notification settings

timeoutdigital/kamon-cloudwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kamon Amazon Cloudwatch Extension

Build Status GitHub release

(Note: inspired by this repo done by Phil Will. Some code has been reused and modified in this project)

Overview

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

Installation

  • add library dependency to your build.sbt
libraryDependencies += "com.timeout" %% "kamon-cloudwatch" % "0.0.1"
  • load extension by Akka (optional), by default this module is set to auto-start by calling Kamon.start()
akka {
  ...
  
  extensions = ["com.timeout.kamon.cloudwatch.KamonCloudWatch"]
}
  • make sure you have AWS_PROFILE or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY pair set correctly

  • add the following to your application.conf and change the fields accordingly:

kamon {
  cloudwatch {

    # namespace is the AWS Metrics custom namespace
    namespace = kamon-cloudwatch
    
    # AWS region, on ec2 region is fetched by getCurrentRegion command
    region = eu-west-1

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

    # only logs metrics to file without shipping out to Cloudwatch if it is false
    send-metrics = true

    # how many threads will be assigned to the pool that does the shipment of metrics
    async-threads = 5

    # Subscription patterns used to select which metrics will be pushed to CloudWatch.
    # Please Note that, metrics collection entries entities must be activated under the kamon.metrics.filters settings.
    # Paste the subscriptions template to your app to configure。
    subscriptions {
      histogram         = [ "**" ]
      min-max-counter   = [ "**" ]
      gauge             = [ "**" ]
      counter           = [ "**" ]
      trace             = [ "**" ]
      trace-segment     = [ "**" ]
      akka-actor        = [ 
        "project/user/userController/**",
        "project/user/orderController/**"
      ]
      akka-dispatcher   = [ "**" ]
      akka-router       = [ "**" ]
      system-metric     = [ "**" ]
      http-server       = [ "**" ]
      akka-http-server  = [ "**" ]
    }
  }
}
  • module is set to auto-start by default, you should see "Starting the Kamon CloudWatch extension" in your console output.

AWS Cloudwatch Example

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

License

About

Quick extension to ship Kamon metrics to Amazon Cloudwatch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages