https://github.com/urbanos-public/streaming_metrics
Library for shipping metrics from Elixir apps to monitoring sinks
https://github.com/urbanos-public/streaming_metrics
cloudwatch elixir metrics-gathering monitoring prometheus
Last synced: 26 days ago
JSON representation
Library for shipping metrics from Elixir apps to monitoring sinks
- Host: GitHub
- URL: https://github.com/urbanos-public/streaming_metrics
- Owner: UrbanOS-Public
- License: apache-2.0
- Created: 2018-08-23T14:27:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T14:01:38.000Z (about 3 years ago)
- Last Synced: 2024-03-14T22:24:11.633Z (over 2 years ago)
- Topics: cloudwatch, elixir, metrics-gathering, monitoring, prometheus
- Language: Elixir
- Homepage: https://hexdocs.pm/streaming_metrics/readme.html
- Size: 58.6 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/smartcitiesdata/streaming_metrics)
[](https://hex.pm/packages/streaming_metrics)
# Steaming Metrics
## Description
A library that interfaces with several metric recording backends.
## Installation
To add to your mix dependencies, add the following block to your mix.exs deps:
```elixir
def deps do
[
{:streaming_metrics, "~> 2.2.0"}
]
end
```
## Usage
This library can record metrics to AWS CloudWatch, Prometheus, or to the console. To specify this, put something like the below in your environment config file.
```
config :my_app,
metric_collector: StreamingMetrics.ConsoleMetricCollector
```
or
```
config :my_app,
metric_collector: StreamingMetrics.PrometheusMetricCollector
```
or
```
config :my_app,
metric_collector: StreamingMetrics.AwsMetricCollector
```
Each collector implementation has three functions:
- `record_metrics/2` takes an array of metrics and a namespace.
- `count_metric/4` takes an integer, a namespace, an optional array of dimensions (ex: `[{"DimensionName", "some dimension value"}]`), and an optional timestamp.
- `gauge_metric/5` takes an integer, a namespace, an optional array of dimensions (ex: `[{"DimensionName", "some dimension value"}]`), an optional unit type (see [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html)), and an optional timestamp.
## License
SmartCity is released under the Apache 2.0 license - see the license at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)