Add support for AWS Cloudwatch

Issue #59 resolved
Christian Bjørnbak created an issue

We used JMole in Wildfly with Munin at our previous hosting partner but now we moved to AWS and is missing monitoring.

We don't want to maintain a private Munin installation but want to use Cloudwatch.

Cloudwatch does not support JMX out-of-the-box so we would love see JMole implement Cloudwatch's API.

Comments (12)

  1. Christian Bjørnbak reporter

    Yes I would love to help testing it. I am not that knowable about cloudwatch yet but I have the jmole setup that worked before so first test would be to see that the same metrics' show up in cloudwatch..

  2. Anders Welen repo owner

    Check the branch "feature/59"! For now only metrics are collected.

    • git checkout feature/59
    • mvn clean install

    The following new System properties may be of interest:

    • jmole.protocol.cloudwatch.enabled=true
    • jmole.protocol.cloudwatch.interval=60000 // The interval to send measurements
    • jmole.protocol.cloudwatch.namespace=JMole // The AWS CloudWatch namespace to use
    • aws.accessKeyId=<SEE AWS DOCS>
    • aws.secretKey=<SEE AWS DOCS>

    Please test and see if it works. Next step would be to implement the alarms as well.

    (Remember that it may cost extra to use much CloudWatch measurements)

    Regards Anders W

  3. Christian Bjørnbak reporter

    I've discovered an issue:

    I left the jmole.protocol.cloudwatch.namespace as JMole and I see metrics being drawn BUT I run 5 wildflies in docker on ECS and all update the same namespace and therefore the same metrics'.

    Of course I need to change jmole.protocol.cloudwatch.namespace to something instance specific but using the docker instance-id or ECS task-id would create a new namespace each time they are restarted.

    Apparently Cloudwatch keeps old unused metrics for 15 months now: https://stackoverflow.com/questions/23229268/how-do-you-delete-an-aws-cloudwatch-metric

    This would make lead to thousands of namespaces..

    Any idea on how to merge the data into one namespace or even how to collate the data from different wildflies into on metrics?

  4. Anders Welen repo owner

    This is more of a AWS question and have little to do with JMole ;-)

    Perhaps you can use AWS Tags to solve it. I'll see if I get the time to look into it while I continue implementing support for alarms in the branch. Note that when I think it's ok I'll merge it into the development branch.

  5. Anders Welen repo owner

    Have you tested the support for alarms? I'm planning of merging this issue into the development branch to be part of the next release.

  6. Christian Bjørnbak reporter

    I haven"t tested the alarms yet. Been busy with other things and figuring out how to solve my aws issue.

    I'll try if I can test it tomorrow.

  7. Log in to comment