https://github.com/alonsodomin/kamon-cloudwatch
Kamon extension to ship Kamon metrics to AWS Cloudwatch
https://github.com/alonsodomin/kamon-cloudwatch
aws aws-cloudwatch cloudwatch kamon metrics metrics-gathering
Last synced: 14 days ago
JSON representation
Kamon extension to ship Kamon metrics to AWS Cloudwatch
- Host: GitHub
- URL: https://github.com/alonsodomin/kamon-cloudwatch
- Owner: alonsodomin
- License: other
- Created: 2017-09-28T10:38:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T07:15:44.000Z (about 1 year ago)
- Last Synced: 2024-02-28T08:29:16.936Z (about 1 year ago)
- Topics: aws, aws-cloudwatch, cloudwatch, kamon, metrics, metrics-gathering
- Language: Scala
- Homepage:
- Size: 717 KB
- Stars: 7
- Watchers: 3
- Forks: 5
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kamon AWS Cloudwatch Extension
[](https://travis-ci.org/alonsodomin/kamon-cloudwatch)
[](https://github.com/alonsodomin/kamon-cloudwatch/releases)
[](https://maven-badges.herokuapp.com/maven-central/com.github.alonsodomin/kamon-cloudwatch_2.12)
[](https://mergify.io)## Overview
A simple [Kamon](https://github.com/kamon-io/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](https://github.com/timeoutdigital/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`
```scala
libraryDependencies += "com.github.alonsodomin" %% "kamon-cloudwatch" % ""
```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:
```scala
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 =
# (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.:
# License
- [Apache V2](https://github.com/alonsodomin/kamon-cloudwatch/blob/master/LICENSE "MIT")