├── .codecov.yml
├── .github
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
└── workflows
│ ├── autoapprove.yml
│ ├── automerge.yml
│ ├── build_and_test.yml
│ ├── build_and_test_release_latest.yml
│ └── release_latest.repos
├── .rosinstall.master
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── cloudwatch_metrics_collector
├── CMakeLists.txt
├── LICENSE.txt
├── NOTICE.txt
├── config
│ └── sample_configuration.yaml
├── include
│ └── cloudwatch_metrics_collector
│ │ ├── metrics_collector.hpp
│ │ └── metrics_collector_parameter_helper.hpp
├── launch
│ ├── cloudwatch_metrics_collector.launch
│ └── sample_application.launch
├── package.xml
├── src
│ ├── main.cpp
│ ├── metrics_collector.cpp
│ └── metrics_collector_parameter_helper.cpp
└── test
│ ├── cloudwatch_metrics_collector_test.cpp
│ └── test_cloudwatch_metrics_collector.test
└── wiki
└── images
├── cpu.svg
└── memory.svg
/.codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | ignore:
3 | - "**/test/*"
4 | status:
5 | # doc: https://docs.codecov.io/docs/commit-status
6 | project:
7 | default:
8 | # will use the coverage from the base commit (pull request base or parent commit) coverage to compare against.
9 | target: auto
10 | threshold: null
11 | # will use the pull request base if the commit is on a pull request. If not, the parent commit will be used.
12 | base: auto
13 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | *Issue #, if available:*
2 |
3 | *Description of changes:*
4 |
5 |
6 | By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
7 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: github-actions
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "16:00"
8 | open-pull-requests-limit: 10
9 |
10 |
--------------------------------------------------------------------------------
/.github/workflows/autoapprove.yml:
--------------------------------------------------------------------------------
1 | name: Auto approve
2 |
3 | on: pull_request
4 |
5 | jobs:
6 | # Auto-approve dependabot PRs since this repo requires at least one approving review.
7 | # Dependabot will automatically merge minor version upgrades
8 | # (see .dependabot/config.yml for more info).
9 | auto-approve-dependabot:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: hmarr/auto-approve-action@v2.0.0
13 | if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
14 | with:
15 | github-token: "${{ secrets.GITHUB_TOKEN }}"
--------------------------------------------------------------------------------
/.github/workflows/automerge.yml:
--------------------------------------------------------------------------------
1 | name: Auto merge
2 |
3 | on:
4 | pull_request:
5 | branches:
6 | master
7 | pull_request_review:
8 | types:
9 | - submitted
10 | check_suite:
11 | types:
12 | - completed
13 | status: {}
14 | jobs:
15 | # Automatically merge approved and green dependabot PRs.
16 | auto-merge-dependabot:
17 | runs-on: ubuntu-latest
18 | steps:
19 | - uses: pascalgn/automerge-action@v0.13.1
20 | if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
21 | env:
22 | GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
23 | MERGE_LABELS: "dependencies"
24 | MERGE_METHOD: "squash" # Sqush and merge
25 | MERGE_COMMIT_MESSAGE: "pull-request-title-and-description"
26 | MERGE_RETRY_SLEEP: "1200000" # Retry after 20m, enough time for check suites to run
27 | UPDATE_RETRIES: "6"
28 | UPDATE_METHOD: "rebase" # Rebase PR on base branch
29 | UPDATE_RETRY_SLEEP: "300000"
--------------------------------------------------------------------------------
/.github/workflows/build_and_test.yml:
--------------------------------------------------------------------------------
1 | name: Build & Test
2 | on:
3 | pull_request:
4 | push:
5 | branches:
6 | - master
7 | schedule:
8 | # Run every hour. This helps detect flakiness,
9 | # and broken external dependencies.
10 | - cron: '0 * * * *'
11 |
12 | jobs:
13 | build_and_test_master:
14 | name: Build and Test Master ROS ${{ matrix.ros_version }} ${{ matrix.ros_distro }}
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | ros_distro: [kinetic, melodic]
20 | include:
21 | - ros_distro: kinetic
22 | ubuntu_distro: xenial
23 | - ros_distro: melodic
24 | ubuntu_distro: bionic
25 | container:
26 | image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}-ros-base-latest
27 | env:
28 | # Needed for the CMakeLists.txt setup
29 | ROS_DISTRO: ${{ matrix.ros_distro }}
30 | ROS_VERSION: 1
31 | steps:
32 | # Needed to access the vcs repos file from the workspace
33 | - name: Checkout source
34 | uses: actions/checkout@v2
35 | - name: Run action-ros-ci to build and test
36 | uses: ros-tooling/action-ros-ci@0.1.2
37 | with:
38 | target-ros1-distro: ${{ env.ROS_VERSION == '1' && matrix.ros_distro || '' }}
39 | target-ros2-distro: ${{ env.ROS_VERSION == '2' && matrix.ros_distro || '' }}
40 | package-name: cloudwatch_metrics_collector
41 | vcs-repo-file-url: ''
42 | - name: Upload resulting colcon logs
43 | uses: actions/upload-artifact@v2.2.2
44 | with:
45 | name: colcon-logs-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}
46 | path: ros_ws/log
47 | log_workflow_status_to_cloudwatch:
48 | runs-on: ubuntu-latest
49 | container:
50 | image: ubuntu:bionic
51 | needs:
52 | - build_and_test_master
53 | # Don't skip if prior steps failed, but don't run on a fork because it won't have access to AWS secrets
54 | if: ${{ always() && ! github.event.repository.fork && ! github.event.pull_request.head.repo.fork }}
55 | steps:
56 | - name: Configure AWS Credentials
57 | uses: aws-actions/configure-aws-credentials@v1
58 | with:
59 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
60 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
61 | aws-region: ${{ secrets.AWS_REGION }}
62 | - uses: ros-tooling/action-cloudwatch-metrics@0.0.5
63 | with:
64 | # Checks if any of the jobs have failed.
65 | #
66 | # needs.*.result is returns the list of all success statuses as an
67 | # array, i.e. ['success', 'failure, 'success']
68 | # join() converts the array to a string 'successfailuresuccess'
69 | # contains() checks whether the string contains failure
70 | metric-value: ${{ ! contains(join(needs.*.result, ''), 'failure') && ! contains(join(needs.*.result, ''), 'cancelled') }}
71 |
--------------------------------------------------------------------------------
/.github/workflows/build_and_test_release_latest.yml:
--------------------------------------------------------------------------------
1 | name: Build & Test release-latest
2 | on:
3 | schedule:
4 | # Run every hour. This helps detect flakiness,
5 | # and broken external dependencies.
6 | - cron: '0 * * * *'
7 |
8 | jobs:
9 | build_and_test_release_latest:
10 | name: Build and Test Release Latest ROS ${{ matrix.ros_version }} ${{ matrix.ros_distro }}
11 | runs-on: ubuntu-latest
12 | strategy:
13 | fail-fast: false
14 | matrix:
15 | ros_distro: [kinetic, melodic]
16 | include:
17 | - ros_distro: kinetic
18 | ubuntu_distro: xenial
19 | - ros_distro: melodic
20 | ubuntu_distro: bionic
21 | container:
22 | image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}-ros-base-latest
23 | env:
24 | # Needed for the CMakeLists.txt setup
25 | ROS_DISTRO: ${{ matrix.ros_distro }}
26 | ROS_VERSION: 1
27 | steps:
28 | # Needed to access the vcs repos file from the workspace
29 | - name: Checkout source
30 | uses: actions/checkout@v2
31 | - name: Run action-ros-ci to build and test
32 | uses: ros-tooling/action-ros-ci@0.1.2
33 | with:
34 | target-ros1-distro: ${{ env.ROS_VERSION == '1' && matrix.ros_distro || '' }}
35 | target-ros2-distro: ${{ env.ROS_VERSION == '2' && matrix.ros_distro || '' }}
36 | package-name: cloudwatch_metrics_collector
37 | # schedule runs against the default branch (master), so specify release-latest via repos file
38 | vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/release_latest.repos"
39 | - name: Upload resulting colcon logs
40 | uses: actions/upload-artifact@v2.2.2
41 | with:
42 | name: colcon-logs-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}
43 | path: ros_ws/log
44 | log_workflow_status_to_cloudwatch:
45 | runs-on: ubuntu-latest
46 | container:
47 | image: ubuntu:bionic
48 | needs:
49 | - build_and_test_release_latest
50 | # Don't skip if prior steps failed, but don't run on a fork because it won't have access to AWS secrets
51 | if: ${{ always() && ! github.event.repository.fork && ! github.event.pull_request.head.repo.fork }}
52 | steps:
53 | - name: Configure AWS Credentials
54 | uses: aws-actions/configure-aws-credentials@v1
55 | with:
56 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
57 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
58 | aws-region: ${{ secrets.AWS_REGION }}
59 | - uses: ros-tooling/action-cloudwatch-metrics@0.0.5
60 | with:
61 | metric-dimensions: >-
62 | [
63 | { "Name": "github.event_name", "Value": "${{ github.event_name }}" },
64 | { "Name": "github.ref", "Value": "release-latest" },
65 | { "Name": "github.repository", "Value": "${{ github.repository }}" }
66 | ]
67 | # Checks if any of the jobs have failed.
68 | #
69 | # needs.*.result is returns the list of all success statuses as an
70 | # array, i.e. ['success', 'failure, 'success']
71 | # join() converts the array to a string 'successfailuresuccess'
72 | # contains() checks whether the string contains failure
73 | metric-value: ${{ ! contains(join(needs.*.result, ''), 'failure') && ! contains(join(needs.*.result, ''), 'cancelled') }}
74 |
--------------------------------------------------------------------------------
/.github/workflows/release_latest.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | cloudwatchmetrics-ros1:
3 | type: git
4 | url: https://github.com/aws-robotics/cloudwatchmetrics-ros1
5 | version: release-latest
6 |
--------------------------------------------------------------------------------
/.rosinstall.master:
--------------------------------------------------------------------------------
1 | - git:
2 | uri: https://github.com/aws-robotics/utils-common.git
3 | local-name: utils-common
4 | version: master
5 | - git:
6 | uri: https://github.com/aws-robotics/utils-ros1.git
7 | local-name: utils-ros1
8 | version: master
9 | - git:
10 | uri: https://github.com/aws-robotics/cloudwatch-common.git
11 | local-name: cloudwatch-common
12 | version: master
13 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4 | opensource-codeofconduct@amazon.com with any additional questions or comments.
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guidelines
2 |
3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4 | documentation, we greatly value feedback and contributions from our community.
5 |
6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7 | information to effectively respond to your bug report or contribution.
8 |
9 |
10 | ## Reporting Bugs/Feature Requests
11 |
12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13 |
14 | When filing an issue, please check [existing open](https://github.com/aws-robotics/cloudwatchmetrics-ros1/issues), or [recently closed](https://github.com/aws-robotics/cloudwatchmetrics-ros1/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16 |
17 | * A reproducible test case or series of steps
18 | * The version of our code being used
19 | * Any modifications you've made relevant to the bug
20 | * Anything unusual about your environment or deployment
21 |
22 |
23 | ## Contributing via Pull Requests
24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25 |
26 | 1. You are working against the latest source on the *master* branch.
27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29 |
30 | To send us a pull request, please:
31 |
32 | 1. Fork the repository.
33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34 | 3. Ensure local tests pass.
35 | 4. Commit to your fork using clear commit messages.
36 | 5. Send us a pull request, answering any default questions in the pull request interface.
37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38 |
39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41 |
42 |
43 | ## Finding contributions to work on
44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-robotics/cloudwatchmetrics-ros1/labels/help%20wanted) issues is a great place to start.
45 |
46 |
47 | ## Code of Conduct
48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50 | opensource-codeofconduct@amazon.com with any additional questions or comments.
51 |
52 |
53 | ## Security issue notifications
54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55 |
56 |
57 | ## Licensing
58 |
59 | See the [LICENSE](https://github.com/aws-robotics/cloudwatchmetrics-ros1/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60 |
61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
62 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # cloudwatch_metrics_collector
2 |
3 |
4 | ## Overview
5 | The `cloudwatch_metrics_collector` ROS Node publishes your robot's metrics to the cloud to enable you to easily track the health of a fleet with the use of automated monitoring and actions for when a robot's metrics show abnormalities. You can easily track historic trends and profile behavior such as resource usage. Out of the box it provides a ROS interface to take a ROS message defining a metric and publish it to Amazon CloudWatch Metrics. The only configuration required to get started is setting up AWS Credentials and Permissions for your robot.The CloudWatch Metrics Node can be used with existing ROS Nodes that publish metric messages or with your own nodes if you instrument them to publish your own custom metrics.
6 |
7 | **Amazon CloudWatch Metrics Summary**: Amazon CloudWatch is a monitoring and management service built for developers, system operators, site reliability engineers (SRE), and IT managers. CloudWatch provides you with data and actionable insights to monitor your applications, understand and respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing you with a unified view of AWS resources, applications and services that run on AWS, and on-premises servers. You can use CloudWatch to set high resolution alarms, visualize logs and metrics side by side, take automated actions, troubleshoot issues, and discover insights to optimize your applications, and ensure they are running smoothly.
8 |
9 | **Keywords**: ROS, AWS, CloudWatch, Metrics
10 |
11 | ### License
12 | The source code is released under an [Apache 2.0].
13 |
14 | **Author**: AWS RoboMaker
15 | **Affiliation**: [Amazon Web Services (AWS)]
16 |
17 | RoboMaker cloud extensions rely on third-party software licensed under open-source licenses and are provided for demonstration purposes only. Incorporation or use of RoboMaker cloud extensions in connection with your production workloads or commercial product(s) or devices may affect your legal rights or obligations under the applicable open-source licenses. License information for this repository can be found [here](https://github.com/aws-robotics/cloudwatchmetrics-ros1/blob/master/LICENSE). AWS does not provide support for this cloud extension. You are solely responsible for how you configure, deploy, and maintain this cloud extension in your workloads or commercial product(s) or devices.
18 |
19 | ### Supported ROS Distributions
20 | - Kinetic
21 | - Melodic
22 |
23 | ## Installation
24 |
25 | ### AWS Credentials
26 | You will need to create an AWS Account and configure the credentials to be able to communicate with AWS services. You may find [AWS Configuration and Credential Files] helpful. Specifying AWS [credentials by setting environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html) is not supported.
27 |
28 | This node will require the following AWS account IAM role permissions:
29 | - `cloudwatch:PutMetricData`
30 |
31 | ### Building from Source
32 |
33 | To build from source you'll need to create a new workspace, clone and checkout the latest release branch of this repository, install all the dependencies, and compile. If you need the latest development features you can clone from the `master` branch instead of the latest release branch. While we guarantee the release branches are stable, __the `master` should be considered to have an unstable build__ due to ongoing development.
34 |
35 | - Install build tool: please refer to `colcon` [installation guide](https://colcon.readthedocs.io/en/released/user/installation.html)
36 |
37 | - Create a ROS workspace and a source directory
38 |
39 | mkdir -p ~/ros-workspace/src
40 |
41 | - Clone the package into the source directory .
42 |
43 | cd ~/ros-workspace/src
44 | git clone https://github.com/aws-robotics/cloudwatchmetrics-ros1.git -b release-latest
45 |
46 | - Install dependencies
47 |
48 | cd ~/ros-workspace
49 | sudo apt-get update && rosdep update
50 | rosdep install --from-paths src --ignore-src -r -y
51 |
52 | _Note: If building the master branch instead of a release branch you may need to also checkout and build the master branches of the packages this package depends on._
53 |
54 | - Build the packages
55 |
56 | cd ~/ros-workspace && colcon build
57 |
58 | - Configure ROS library Path
59 |
60 | source ~/ros-workspace/install/setup.bash
61 |
62 | - Build and run the unit tests
63 |
64 | colcon build --packages-select cloudwatch_metrics_collector --cmake-target tests
65 | colcon test --packages-select cloudwatch_metrics_collector cloudwatch_metrics_common && colcon test-result --all
66 |
67 |
68 | ## Launch Files
69 | In order to include a `cloudwatch_metrics_collector` in your launch file, you should add `` to your launch file. The launch file uses the following arguments:
70 |
71 | | Arg Name | Description |
72 | | --------- | ------------ |
73 | | node_name | (optional) The name the metrics node should be launched with. If not provided the node will default to "cloudwatch_metrics_collector" |
74 | | config_file | (optional) A path to a rosparam config file. If provided the launch file will use rosparam to load the configuration into the private namespace of the node. |
75 |
76 | An example launch file called `sample_application.launch` is included in this project that gives an example of how you can include this node in your project and provide it with arguments.
77 |
78 |
79 | ## Usage
80 |
81 | ### Run the node
82 | - **With** launch file using parameters in .yaml format (example provided)
83 | - ROS: `roslaunch cloudwatch_metrics_collector sample_application.launch --screen`
84 |
85 | ### Send a test metric
86 | - `rostopic pub /metrics ros_monitoring_msgs/MetricList '[{header: auto, metric_name: "ExampleMetric", unit: "sec", value: 42, time_stamp: now, dimensions: []}, {header: auto, metric_name: "ExampleMetric2", unit: "count", value: 22, time_stamp: now, dimensions: [{name: "ExampleDimension", value: "1"}]}]'`
87 |
88 |
89 | ## Configuration File and Parameters
90 | An example configuration file named `sample_configuration.yaml` is provided that contains a detailed example configuration for the Node.
91 |
92 | All parameters to the Node are provided via the parameter server when the node is started. When loading configuration the Node will start looking for each setting inside of its private namespace and then search up the namespace heirarchy to the global namespace for the parameters.
93 |
94 | | Parameter Name | Description | Type | Default |
95 | | ------------- | -----------------------------------------------------------| ------------- | ------------ |
96 | | aws_metrics_namespace | If provided it will set the namespace for all metrics provided by this node to the provided value. If the node is running on AWS RoboMaker then the provided launch file will ignore this parameter in favor of the namespace specified by the AWS RoboMaker ecosystem | *string* | ROS |
97 | | aws_monitored_metric_topics | An optional list of topics to listen to. If not provided or is empty the node will just listen on the global "metrics" topic. If this list is not empty then the node will not subscribe to the "metrics" topic and will only subscribe to the topics in the list. | *array of strings* | metrics |
98 | | storage_directory | The location where all offline metrics will be stored | *string* | ~/.ros/cwmetrics/ |
99 | | storage_limit | The maximum size of all offline storage files in KB. Once this limit is reached offline logs will start to be deleted oldest first. | *int* | 1048576 |
100 | | aws_client_configuration | If given the node will load the provided configuration when initializing the client. If a specific configuration setting is not included in the map then it will search up the namespace hierarchy for an 'aws_client_configuration' map that contains the field. In this way, a global configuration can be provided for all AWS nodes with only specific values overridden for a specific Node instance if needed | *map* | |
101 | | storage_resolution | The storage resolution level for presenting metrics in CloudWatch. For more information, see [high-resolution-metrics](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html). | *int* | 60 |
102 |
103 |
104 | ### Advanced Configuration Parameters
105 | Most users won't need to touch these parameters, they are useful if you want fine grained control over how your metrics are stored offline and uploaded to CloudWatch.
106 |
107 | | Parameter Name | Description | Type | Default |
108 | | ------------- | -----------------------------------------------------------| ------------- | ------------ |
109 | | batch_max_queue_size | The maximum number metrics items to add to the CloudWatch upload queue before they start to be written to disk | *int* | 1024 |
110 | | batch_trigger_publish_size | Only publish metrics to CloudWatch when there are this many items in the queue. When this is set the publishing of metrics on a constant timer is disabled. This must be smaller than batch_max_queue_size. Metrics uploaded from offline storage are not affected by this. | *int* | *unset* |
111 | | file_max_queue_size | The max number of batches in the queue, each of size file_upload_batch_size, when reading and uploading from offline storage files | *int* | 5 |
112 | | file_upload_batch_size | The size of each batch of metrics in the queue, when reading and uploading from offline storage files | *int* | 50 |
113 | | file_prefix | A prefix to add to each offline storage file so they're easier to identify later | *string* | cwmetric |
114 | | file_extension | The extension for all offline storage files | *string* | .log |
115 | | maximum_file_size | The maximum size each offline storage file in KB | *int* | 1024 |
116 | | stream_max_queue_size | The maximum number of batches in the queue to stream to CloudWatch. If this queue is full subsequent batches of metrics will be written to disk. | *int* | 3 |
117 |
118 |
119 | ## Node
120 |
121 | ### cloudwatch_metrics_collector
122 | Sends metrics in a ROS system to AWS CloudWatch Metrics service.
123 |
124 | #### Subscribed Topics
125 | - **`Configurable (default="/metrics")`**
126 |
127 | The node can subscribe to a configurable list of topic names. If no list in provided then it will default to subscribing to a global topic names `/metrics`.
128 | Message Type: `ros_monitoring_msgs/MetricList`
129 |
130 | #### Published Topics
131 | None
132 |
133 | #### Services
134 | None
135 |
136 | [Amazon Web Services (AWS)]: https://aws.amazon.com/
137 | [Apache 2.0]: https://aws.amazon.com/apache-2-0/
138 | [AWS Configuration and Credential Files]: https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html
139 | [high-resolution-metrics]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics
140 | [Issue Tracker]: https://github.com/aws-robotics/cloudwatchmetrics-ros1/issues
141 | [ROS]: http://www.ros.org
142 |
--------------------------------------------------------------------------------
/cloudwatch_metrics_collector/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(cloudwatch_metrics_collector)
3 |
4 | ## Compile as C++11, supported in ROS Kinetic and newer
5 | set(CMAKE_CXX_STANDARD 14)
6 |
7 | # Enable strict compiler flags if possible.
8 | include(CheckCXXCompilerFlag)
9 | # Removed -Wmissing-declarations until gmock is ignored
10 | # removed -Werror=pedantic until ros.h is fixed
11 | set(FLAGS -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings)
12 | foreach(FLAG ${FLAGS})
13 | check_cxx_compiler_flag(${FLAG} R${FLAG})
14 | if(${R${FLAG}})
15 | set(WARNING_CXX_FLAGS "${WARNING_CXX_FLAGS} ${FLAG}")
16 | endif()
17 | endforeach()
18 |
19 | if(NOT DEFINED CXX_DISABLE_WERROR)
20 | set(WARNING_CXX_FLAGS "-Werror ${WARNING_CXX_FLAGS}")
21 | endif()
22 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_CXX_FLAGS}")
23 |
24 | ## Compile as C++11, supported in ROS Kinetic and newer
25 | add_compile_options(-std=c++11)
26 |
27 | find_package(dataflow_lite REQUIRED)
28 | find_package(file_management REQUIRED)
29 | find_package(cloudwatch_metrics_common REQUIRED)
30 |
31 | ## Find catkin macros and libraries
32 | find_package(catkin REQUIRED COMPONENTS
33 | cloudwatch_metrics_common
34 | roscpp
35 | aws_common
36 | aws_ros1_common
37 | rosgraph_msgs
38 | ros_monitoring_msgs
39 | std_srvs
40 | std_msgs)
41 |
42 | ###################################
43 | ## catkin specific configuration ##
44 | ###################################
45 | catkin_package()
46 |
47 | ###########
48 | ## Build ##
49 | ###########
50 |
51 | ## Specify additional locations of header files
52 | include_directories(${catkin_INCLUDE_DIRS})
53 |
54 | ## Declare a C++ executable
55 | add_library(${PROJECT_NAME}_lib SHARED src/metrics_collector.cpp src/metrics_collector_parameter_helper.cpp)
56 |
57 | target_include_directories(${PROJECT_NAME}_lib PUBLIC include ${catkin_INCLUDE_DIRS} ${dataflow_lite_INCLUDE_DIRS})
58 | target_link_libraries(${PROJECT_NAME}_lib ${catkin_LIBRARIES} ${dataflow_lite_common_LIBRARIES})
59 |
60 | target_include_directories(${PROJECT_NAME}_lib PUBLIC include ${catkin_INCLUDE_DIRS} ${file_management_INCLUDE_DIRS})
61 | target_link_libraries(${PROJECT_NAME}_lib ${catkin_LIBRARIES} ${file_management_LIBRARIES})
62 |
63 | target_include_directories(${PROJECT_NAME}_lib PUBLIC include ${catkin_INCLUDE_DIRS} ${cloudwatch_metrics_common_INCLUDE_DIRS})
64 | target_link_libraries(${PROJECT_NAME}_lib ${catkin_LIBRARIES} ${cloudwatch_metrics_common_LIBRARIES})
65 |
66 | add_executable(${PROJECT_NAME} src/main.cpp)
67 | target_include_directories(${PROJECT_NAME} PRIVATE include ${catkin_INCLUDE_DIRS} ${cloudwatch_metrics_common_INCLUDE_DIRS})
68 | target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_lib ${cloudwatch_metrics_common_LIBRARIES})
69 |
70 | #############
71 | ## Install ##
72 | #############
73 |
74 | ## Mark executables and/or libraries for installation
75 | install(TARGETS ${PROJECT_NAME}
76 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
77 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
78 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
79 | )
80 |
81 | install(TARGETS ${PROJECT_NAME}_lib
82 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
83 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
84 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
85 | )
86 |
87 | install(DIRECTORY
88 | config
89 | launch
90 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
91 | )
92 |
93 | #############
94 | ## Testing ##
95 | #############
96 |
97 | ## Add gtest based cpp test target and link libraries
98 | if(CATKIN_ENABLE_TESTING)
99 | set(CW_METRICS_COLLECTOR_TEST test_cloudwatch_metrics_collector)
100 | find_package(rostest REQUIRED)
101 | find_package(GMock QUIET)
102 | if(GMOCK_FOUND)
103 | add_rostest_gmock(${CW_METRICS_COLLECTOR_TEST}
104 | test/test_cloudwatch_metrics_collector.test
105 | test/cloudwatch_metrics_collector_test.cpp
106 | )
107 | target_include_directories(${CW_METRICS_COLLECTOR_TEST} PRIVATE
108 | include
109 | ${catkin_INCLUDE_DIRS}
110 | ${cloudwatch_metrics_collector_INCLUDE_DIRS}
111 | ${GMOCK_INCLUDE_DIRS}
112 | )
113 | target_link_libraries(${CW_METRICS_COLLECTOR_TEST}
114 | ${PROJECT_NAME}_lib
115 | ${catkin_LIBRARIES}
116 | ${GMOCK_BOTH_LIBRARIES}
117 | )
118 | else()
119 | include_directories(/usr/include/gmock /usr/src/gmock)
120 | add_library(${PROJECT_NAME}_libgmock SHARED /usr/src/gmock/src/gmock-all.cc)
121 |
122 | add_rostest_gtest(${CW_METRICS_COLLECTOR_TEST}
123 | test/test_cloudwatch_metrics_collector.test
124 | test/cloudwatch_metrics_collector_test.cpp
125 | )
126 | target_include_directories(${CW_METRICS_COLLECTOR_TEST} PRIVATE
127 | include
128 | ${catkin_INCLUDE_DIRS}
129 | ${cloudwatch_metrics_collector_INCLUDE_DIRS}
130 | )
131 | target_link_libraries(${CW_METRICS_COLLECTOR_TEST}
132 | ${PROJECT_NAME}_lib
133 | ${catkin_LIBRARIES}
134 | ${PROJECT_NAME}_libgmock
135 | )
136 | endif()
137 | endif()
138 |
--------------------------------------------------------------------------------
/cloudwatch_metrics_collector/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2018 Amazon.com, Inc. or its affiliates
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/cloudwatch_metrics_collector/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 |
3 | This product includes software developed by
4 | Amazon Technologies, Inc (http://www.amazon.com/).
5 |
--------------------------------------------------------------------------------
/cloudwatch_metrics_collector/config/sample_configuration.yaml:
--------------------------------------------------------------------------------
1 | # An optional metric namespace parameter. If provided it will set the namespace for all metrics provided by this node to
2 | # the provided value. If the node is running on AWS RoboMaker, then the provided launch file will ignore this parameter in
3 | # favor of the namespace specified by the AWS RoboMaker ecosystem
4 | aws_metrics_namespace: "ros_metrics_collector"
5 |
6 | # An optional list of topics to listen to. If not provided or is empty the node will just listen on the global "metrics"
7 | # topic. If this list is not empty then the node will not subscribe to the "metrics" topic and will only subscribe to the
8 | # topics in the list.
9 | #aws_monitored_metric_topics: ["metrics"]
10 |
11 | # The absolute path to a folder that all offline metric files will be stored in
12 | storage_directory: "~/.ros/cwmetrics/"
13 |
14 | # The maximum size of all files in offline storage in KB
15 | storage_limit: 1048576
16 |
17 | # This is the AWS Client Configuration used by the AWS service client in the Node. If given the node will load the
18 | # provided configuration when initializing the client.
19 | aws_client_configuration:
20 | # Specifies where you want the client to communicate. Examples include us-east-1 or us-west-1. You must ensure that
21 | # the service you want to use has an endpoint in the region you configure.
22 | region: "us-west-2"
23 |
24 | # Built in the constructor and pulls information from your operating system. Do not alter the user agent.
25 | #user_agent: ""
26 |
27 | # Use this to override the http endpoint used to talk to a service. If you set this, you must also set authenticationRegion.
28 | #endpoint_override: ""
29 |
30 | # These settings allow you to configure a proxy for all communication with AWS. Examples of when this functionality
31 | # might be useful include debugging in conjunction with the Burp suite, or using a proxy to connect to the Internet.
32 | #proxy_host: ""
33 | #proxy_port: 0
34 | #proxy_user_name: ""
35 | #proxy_password: ""
36 |
37 | # Enables you to tell the HTTP client where to find your SSL certificate trust store (for example, a directory
38 | # prepared with OpenSSL's c_rehash utility). You shouldn't need to do this unless you are using symlinks in your
39 | # environment. This has no effect on Windows or OS X.
40 | #ca_path: ""
41 | #ca_file: ""
42 |
43 | # Values that determine the length of time, in milliseconds, to wait before timing out a request. You can increase
44 | # this value if you need to transfer large files, such as in Amazon S3 or Amazon CloudFront.
45 | request_timeout_ms: 2000
46 | connect_timeout_ms: 2000
47 | max_retries: 1
48 | no_retry_strategy: true
49 |
50 | # The maximum number of allowed connections to a single server for your HTTP communications. The default value is 25.
51 | # You can set this value as high as you can support the bandwidth. We recommend a value around 25.
52 | #max_connections: 25
53 |
54 | # Use dual stack endpoint in the endpoint calculation. You must ensure that the service you want to use supports ipv6 in the region you select.
55 | #use_dual_stack: false
56 |
57 | # Enable adjustment for clock skew
58 | #enable_clock_skew_adjustment: true
59 |
60 | # If set to true the http stack will follow redirect codes
61 | #follow_redirects: false
62 |
63 | # Specifies whether to enable SSL certificate verification. If necessary, you can disable SSL certificate verification by setting verifySSL to false.
64 | #verify_SSL: true
65 |
66 | # This is the storage resolution level for presenting metrics in CloudWatch.
67 | # Valid values are 1 and 60. Setting this to 1 specifies this metric as a
68 | # high-resolution metric, so that CloudWatch stores the metric with sub-minute
69 | # resolution down to one second. Setting this to 60 specifies this metric as a
70 | # regular-resolution metric, which CloudWatch stores at 1-minute resolution.
71 | # Currently, high resolution is available only for custom metrics. For more
72 | # information about high-resolution metrics, see http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
73 | storage_resolution: 60
74 |
--------------------------------------------------------------------------------
/cloudwatch_metrics_collector/include/cloudwatch_metrics_collector/metrics_collector.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://aws.amazon.com/apache2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | #pragma once
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include
26 | #include
27 |
28 | #include
29 | #include