Skip to main content

Intercepts json formatted metrics from process stdin and sends to AWS Cloudwatch

Project description

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.

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

stdin_to_cloudwatch-0.0.16.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

stdin_to_cloudwatch-0.0.16-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file stdin_to_cloudwatch-0.0.16.tar.gz.

File metadata

  • Download URL: stdin_to_cloudwatch-0.0.16.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.5.6

File hashes

Hashes for stdin_to_cloudwatch-0.0.16.tar.gz
Algorithm Hash digest
SHA256 679510eddfc6570110e9d998f32c1b20baa7cde510a1f4b537d6a89aec6362b3
MD5 805a87ec24aa821186094ee27a247fd0
BLAKE2b-256 d52cde1d632f6294dda035f84710b5f521af0a85313ddfaf4b36f0007814ce77

See more details on using hashes here.

File details

Details for the file stdin_to_cloudwatch-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: stdin_to_cloudwatch-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.5.6

File hashes

Hashes for stdin_to_cloudwatch-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2d00814da2c4bd741ff32f37b13cb6cc0bfdb15b32a8ebb98441a58d13da9d86
MD5 3a83ae95c15d97971fbd71f6640980fa
BLAKE2b-256 f48996ffb7526283f6bf9bf8e64a1d88ebe9d47ee84bd31b07e0318126b0e48b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page