GithubHelp home page GithubHelp logo

test-mass-forker-org-1 / amazon-cloudwatch-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/amazon-cloudwatch-agent

0.0 0.0 0.0 2.15 MB

CloudWatch Agent enables you to collect and export host-level metrics and logs on instances running Linux or Windows server.

License: MIT License

Shell 2.81% Python 0.04% Go 93.75% PowerShell 1.23% Makefile 1.04% Smarty 0.20% HCL 0.77% Dockerfile 0.16%

amazon-cloudwatch-agent's Introduction

codecov

Amazon CloudWatch Agent

The Amazon CloudWatch Agent is software developed for the CloudWatch Agent

Overview

The Amazon CloudWatch Agent enables you to do the following:

  • Collect more system-level metrics from Amazon EC2 instances across operating systems. The metrics can include in-guest metrics, in addition to the metrics for EC2 instances. The additional metrics that can be collected are listed in Metrics Collected by the CloudWatch Agent.
  • Collect system-level metrics from on-premises servers. These can include servers in a hybrid environment as well as servers not managed by AWS.
  • Retrieve custom metrics from your applications or services using the StatsD and collectd protocols. StatsD is supported on both Linux servers and servers running Windows Server. collectd is supported only on Linux servers.
  • Collect logs from Amazon EC2 instances and on-premises servers, running either Linux or Windows Server.

Amazon CloudWatch Agent uses the open-source project telegraf as its dependency. It operates by starting a telegraf agent with some original plugins and some customized plugins.

Setup

Troubleshooting

Building and Running from source

  • Install go. For more information, see Getting started

  • The agent uses go modules for dependency management. For more information, see Go Modules

  • Install rpm-build

sudo yum install -y rpmdevtools rpm-build
  • Run make build to build the CloudWatch Agent for Linux, Debian, Windows environment.

  • Run make release to build the agent. This also packages it into a RPM, DEB and ZIP package.

The following folders are generated when the build completes:

build/bin/linux/arm64/amazon-cloudwatch-agent.rpm
build/bin/linux/amd64/amazon-cloudwatch-agent.rpm
build/bin/linux/arm64/amazon-cloudwatch-agent.deb
build/bin/linux/amd64/amazon-cloudwatch-agent.deb
build/bin/windows/amd64/amazon-cloudwatch-agent.zip
build/bin/darwin/amd64/amazon-cloudwatch-agent.tar.gz
  • Install your own build of the agent

    1. rpm package

      • rpm -Uvh amazon-cloudwatch-agent.rpm
    2. deb package

      • dpkg -i -E ./amazon-cloudwatch-agent.deb
    3. windows package

      • unzip amazon-cloudwatch-agent.zip
      • ./install.ps1
    4. darwin package

      • tar -xvf amazon-cloudwatch-agent.tar.gz
      • cp -rf ./opt/aws /opt
      • cp -rf ./Library/LaunchDaemons/com.amazon.cloudwatch.agent.plist /Library/LaunchDaemons/

Building and running container

See Dockerfiles.

Make Targets

The following targets are available. Each may be run with make <target>.

Make Target Description
build build builds the agent for Linux, Debian and Windows amd64 environment
release (Default) release builds the agent and also packages it into a RPM, DEB and ZIP package
clean clean removes build artifacts
dockerized-build build using docker container without local go environment

Features

Log Filtering

CloudWatch agent supports log filtering, where the agent processes each log message with the filters that you specify, and only published events that pass all filters to CloudWatch Logs. See docs for details.

For example, the following excerpt of the CloudWatch agent configuration file publishes logs that are PUT and POST requests to CloudWatch Logs, but excluding logs that come from Firefox:

{
  "collect_list": [
    {
      "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/test.log",
      "log_group_name": "test.log",
      "log_stream_name": "test.log",
      "filters": [
        {
          "type": "exclude",
          "expression": "Firefox"
        },
        {
          "type": "include",
          "expression": "P(UT|OST)"
        }
      ]
    },
  ]
}

Example with above config:

2021-09-27T19:36:35Z I! [logagent] Firefox Detected   // Agent excludes this 
2021-09-27T19:36:35Z POST (StatusCode: 200).  // Agent would push this to CloudWatch
2021-09-27T19:36:35Z GET (StatusCode: 400). // doesn't match regex, will be excluded

Versioning

It is using Semantic versioning

Distributions

You can download the official release from S3, refer to link

Nightly s3 release are not production ready and should be used at own risk

  1. Download Binaries
    1. Linux
    2. Windows
    3. Mac
  2. Download Packages
    1. Linux
    2. Windows
    3. Mac

Security disclosures

If you think you’ve found a potential security issue, please do not post it in the Issues. Instead, please follow the instructions here or email AWS security directly.

License

MIT License

Copyright (c) 2015-2019 InfluxData Inc. Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

amazon-cloudwatch-agent's People

Contributors

haojhcwa avatar yimuniao avatar pxaws avatar sethamazon avatar pingleig avatar saxypandabear avatar khanhntd avatar zhenyutan-amz avatar adam-mateen avatar jefchien avatar jhnlsn avatar hdj630 avatar aateeqi avatar mxiamxia avatar straussb avatar asaushkin avatar kyoicito avatar zhenweig avatar darkhelmet avatar ecerulm avatar thisisqasim avatar taohungyang avatar kannoyos avatar leonsodhi-lf avatar gmealy1 avatar asakermohd avatar movence avatar guillaumebchd avatar glennchia avatar javabrett avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.