Skip to content

A tool that reads process stdout looking for metrics to publish to CloudWatch

License

Notifications You must be signed in to change notification settings

jvalduvieco/stdin_to_cloudwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stdin_to_cloudwatch

CircleCI

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:

{
  "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 units)

Usage

your_script | stdin_to_cloudwatch -i <django|none> -r <region> [-d <DimensionName=DimensionValue>]

Use stdin_to_cloudwatch -h for help.

AWS credentials are managed by boto3, so refer to boto documentation 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.

About

A tool that reads process stdout looking for metrics to publish to CloudWatch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages