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:
def deps do
[
{:streaming_metrics, "~> 2.1.7"}
]
endUsage
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.ConsoleMetricCollectoror
config :my_app,
metric_collector: StreamingMetrics.PrometheusMetricCollectoror
config :my_app,
metric_collector: StreamingMetrics.AwsMetricCollectorEach collector implementation has two functions:
record_metrics/2takes an array of metrics and a namespace.count_metrics/3takes an integer, a namespace, an optional array of dimensions (ex:[{"DimensionName", "some dimension value"}]), 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