Skip to content

Conversation

@musa-asad
Copy link
Contributor

@musa-asad musa-asad commented Oct 1, 2024

Description of changes

  • Added missing metrics from the ContainerInsights dashboard not included in the agent's solution for JMX.
    • Compared the current spec files for JVM and Tomcat with the dashboard to see what was missing.
    • Set up an EC2 cluster, a Tomcat application, and JMXTerm to find the bean and metric names for the missing metrics.
    • Added these to the spec file based on appropriate types and the naming convention from OTel.
    • Then, the ADOT Jar image was built and tested with the amazon-cloudwatch-agent-operator and helm-charts on an EKS cluster with a custom Tomcat deployment, which correctly produced the correct metrics:
      • ./scripts/local_patch.sh && ./gradlew build
      • docker build --platform linux/amd64 -t adot-autoinstrumentation-java .
      • [add docker image to ECR]

Manual testing

For testing, I decided to use this built image with the CloudWatch Agent to see if these metrics are able to be emitted and tracked on the CW console.

Configuration

    {
      "metrics": {
        "namespace": "tomcat",
        "metrics_collected": {
          "jmx": {
            "jvm": {
              "measurement": [
                "jvm.system.swap.space.total",
                "jvm.system.swap.space.free",
                "jvm.system.physical.memory.total",
                "jvm.system.physical.memory.free",
                "jvm.system.available.processors",
                "jvm.system.cpu.utilization",
                "jvm.open_file_descriptor.count",
                "jvm.daemon_threads.count",
                "jvm.threads.count"
              ]
            },
            "tomcat": {
              "measurement": [
                "tomcat.rejected_sessions",
                "tomcat.sessions"
              ]
            }
          }
        }
      }
    }

CW Console

Screenshot 2024-10-04 at 11 08 51 AM

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@musa-asad musa-asad marked this pull request as ready for review October 3, 2024 17:39
@musa-asad musa-asad requested a review from a team as a code owner October 3, 2024 17:39
@bjrara
Copy link
Member

bjrara commented Oct 8, 2024

Can you rebase your changes?

bjrara
bjrara previously approved these changes Oct 9, 2024
@musa-asad musa-asad changed the base branch from runtime-feature to main October 10, 2024 20:34
@musa-asad musa-asad dismissed bjrara’s stale review October 10, 2024 20:34

The base branch was changed.

bjrara
bjrara previously approved these changes Oct 11, 2024
bjrara
bjrara previously approved these changes Oct 11, 2024
@bjrara bjrara merged commit e144053 into aws-observability:main Oct 11, 2024
4 checks passed
@jefchien jefchien mentioned this pull request Oct 23, 2024
bjrara pushed a commit that referenced this pull request Nov 1, 2024
*Description of changes:* Adds contract tests to verify the expected
behavior of the following changes:
-
#817
-
#898
-
#901

Starts up sample apps with the instrumented SDK and verifies that
metrics are received for each of the supported JMX target systems.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants