Skip to content

Add mem_shared metric to CloudWatch Agent - #1792

Merged
ola-amr merged 4 commits into
mainfrom
feature/add-mem-shared-metric
Jul 29, 2025
Merged

Add mem_shared metric to CloudWatch Agent#1792
ola-amr merged 4 commits into
mainfrom
feature/add-mem-shared-metric

Conversation

@ola-amr

@ola-amr ola-amr commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

Description

This PR implements the mem_shared metric as a configuration option for the Agent to collect from the Telegraf plugin.

Description of changes

  • Added shared to the list of registered metrics for linux servers running the agent.
  • Set the shared metric's units to bytes
  • Added mem_shared to validLinuxMetrics.json for schema validation

Testing

  • Deployed a local version of the CloudWatch agent with my changes on an EC2 instance
  • Configured agent with the following configuration:
{
  "metrics": { 
    "namespace": "mem_shared_testing",
    "metrics_collected": {
      "mem": {
        "measurement": [
          "mem_shared"
        ],
        "metrics_collection_interval": 10
      }
    }
  }
}
  • Verified metrics appearing correctly in CloudWatch console
Screenshot 2025-07-29 at 8 16 13 AM
  • Validated metric accuracy by comparing with direct system values:
    $ cat /proc/meminfo | grep -i shm
    Shmem:               184 kB
  • Confirmed shared memory value (184 kB) matches between system and emitted metric

@ola-amr
ola-amr requested a review from a team as a code owner July 25, 2025 01:05
@ola-amr
ola-amr requested a review from nathalapooja July 25, 2025 01:05
@ola-amr
ola-amr requested a review from TravisStark July 28, 2025 12:55
TravisStark
TravisStark previously approved these changes Jul 28, 2025
@ola-amr ola-amr added ready for testing Indicates this PR is ready for integration tests to run enhancement New feature or request labels Jul 28, 2025
- Added mem_shared to validLinuxMetrics.json for schema validation
- Ensures Linux-specific memory metric is accepted by configuration schema
@ola-amr
ola-amr requested a review from sky333999 July 29, 2025 12:10
@ola-amr
ola-amr merged commit bbf21cd into main Jul 29, 2025
584 of 598 checks passed
@ola-amr
ola-amr deleted the feature/add-mem-shared-metric branch July 29, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready for testing Indicates this PR is ready for integration tests to run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants