https://github.com/jvalduvieco/stdin_to_cloudwatch
A tool that reads process stdout looking for metrics to publish to CloudWatch
https://github.com/jvalduvieco/stdin_to_cloudwatch
Last synced: 2 months ago
JSON representation
A tool that reads process stdout looking for metrics to publish to CloudWatch
- Host: GitHub
- URL: https://github.com/jvalduvieco/stdin_to_cloudwatch
- Owner: jvalduvieco
- License: mit
- Created: 2018-12-10T08:43:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-29T18:42:26.000Z (about 4 years ago)
- Last Synced: 2024-12-12T09:15:15.776Z (6 months ago)
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stdin_to_cloudwatch
[](https://circleci.com/gh/jvalduvieco/stdin_to_cloudwatch/tree/master)
[](https://pypi.org/project/stdin-to-cloudwatch/)This tool is intended to process input fromstdin and publish some metrics encoded in the log stream.
It looks for log lines that match a certain format and publishes to Cloudwatch metrics. The lines that not match are neither
filtered nor altered and are written to stdout.
The format for the metrics follows:
```json
{
"Environ/SomeNamespace":
[
{
"AMetricName": 2558219,
"Units": "Milliseconds",
}
]
}
```Possible values for `Units` are:
```
"Seconds"|"Microseconds"|"Milliseconds"|"Bytes"|"Kilobytes"|"Megabytes"|"Gigabytes"|"Terabytes"|"Bits"|"Kilobits"|"Megabits"|"Gigabits"|"Terabits"|
"Percent"|"Count"|"Bytes/Second"|"Kilobytes/Second"|"Megabytes/Second"|"Gigabytes/Second"|"Terabytes/Second"|"Bits/Second"|"Kilobits/Second"|"Megabits/Second"|
"Gigabits/Second"|"Terabits/Second"|"Count/Second"|"None"
```(Same as [`put-metric-data`](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/put-metric-data.html) units)
## Usage
```
your_script | stdin_to_cloudwatch -i -r [-d ]
```Use `stdin_to_cloudwatch -h` for help.
AWS credentials are managed by boto3, so refer to boto [documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration) for further information.
## Intention
Intention behind this tool is to decouple metrics publishing from the main app. With this tool publishing is a responsibility of infrastructure.