Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrmcc3/aws-metrics-collector
Clojure AWS Cloudwatch metric collector
https://github.com/mrmcc3/aws-metrics-collector
aws clojure cloudwatch metrics
Last synced: 25 days ago
JSON representation
Clojure AWS Cloudwatch metric collector
- Host: GitHub
- URL: https://github.com/mrmcc3/aws-metrics-collector
- Owner: mrmcc3
- License: mit
- Created: 2018-02-17T05:53:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T06:31:46.000Z (almost 7 years ago)
- Last Synced: 2024-12-13T21:11:41.919Z (28 days ago)
- Topics: aws, clojure, cloudwatch, metrics
- Language: Clojure
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
# aws-metrics-collector (alpha)
Clojure AWS Cloudwatch metric collector.
A collector is a core.async channel that:
* accepts metrics as vanilla clojure data
* drops non-conforming metrics
* batches metrics according to AWS limits
* sends the batches periodically to Cloudwatch using the AWS Java SDK## Usage
image:https://img.shields.io/clojars/v/mrmcc3/aws-metrics-collector.svg[Clojars]
[source, clojure]
----
{:deps {mrmcc3/aws-metrics-collector
{:git/url "https://github.com/mrmcc3/aws-metrics-collector"
:sha "a16baa17c7b71a684b2085c0e40913315fb85c6b"}}}
----[source, clojure]
----
(require
'[mrmcc3.aws.metrics.collector :as c]
'[clojure.core.async :as a]);; define a collector channel with a Cloudwatch metrics namespace
(def collector (c/collector {:namespace "Test"}));; put a single metric
(a/put! collector {:name "im-a-metric" :value 3.14});; for multiple metrics use a/onto-chan
(a/onto-chan
collector
{:ResponseTime 125
:RenderTime 55.2}
false);; close the collector when finished
(a/close! collector)
----Note by default `collector` will use a default AWS Cloudwatch client
so make sure the you have AWS credentials setup somewhere in the
default chain with the permission to PutMetricData.See the specs in the code for more info about the collector options
and valid metric data. Dimensions, aggregated statistics,
storage resolution, timestamps and units are all supported!