AWS CloudWatch client library to send metrics conviniently and efficiently
Project description
Amazon Web Services Cloud Watch Metrics Library
Configurable client library, that supports asynchronous and buffered sending of AWS cloud watch metrics.
Usage
from awsme import create_cloud_watch
cloud_watch = create_cloud_watch(
namespace='Application',
dimensions={'version': '1.0.0'},
)
cloud_watch.log('metric', dimensions={'key': 'dim'}, value=123)
Create Options
create_cloud_watch accepts following arguments:
asynchronous (optional bool): if True (default), send metrics from a separate thread.
buffered (optional bool): if True (default), metrics will be accumulated in a buffer and sent in batches.
dummy (optional bool): if True, ignore two previous options and create dummy recorder. False by default.
dimensions: (optional Dict[str, str]): dictionary of default dimensions, that will be attached to all metrics.
All other kwargs will be bypassed to boto3.client('cloudwatch', **kwargs)
Log Options
Object, returned by create_cloud_watch has only one public method - log. It’s arguments:
name (required str): name of the metric.
dimensions (optional Dict[str, str]): additional dimensions, that will be added to default dimension from factory.
value (optional float): metric’s value, 1 by default.
unit (optional str): metric unit, e.g. Count, Seconds, Bytes, see AWS docs for a complete list of valid values.
storage_resolution (optional int): metric storage resolution in seconds, 60 by default.
AWS configuration
Awsme uses boto3 library, that takes configuration from environment variables and configuration files. To check, that you have everything configured properly to send metrics, use included command-line tool:
$ awsme-test
...
Successfully sent metric "awsme-test" to "Test Namespace"
Credits
This package was created with Cookiecutter and the elgertam/cookiecutter-pipenv project template, based on audreyr/cookiecutter-pypackage.
History
0.2.2 (2019-01-24)
Added asynchronous recorder and user documentation
0.1.0 (2018-11-13)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for awsme-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a0810f3b8cf7f2712bd78084da8c4938f0eb8ab889175f03036f82c712dae59 |
|
MD5 | 1d21a0272dfd6f3bac669e7add132b7a |
|
BLAKE2b-256 | b6bd9528e5a47349daf6948699f763976e2b6b16d4f39de92d48330c03e85cde |