awslabs / collectd-cloudwatch

A collectd plugin for sending data to Amazon CloudWatch
MIT License
200 stars 132 forks source link

proxy support #20

Open zorangagic opened 7 years ago

zorangagic commented 7 years ago

Great plugin, this combined with 15 month cloudwatch retention makes for fantastic monitoring solution.

We have hundreds of EC2 instances that are behind a proxy, unfortunately plugin does not work with proxy.

I get error: Nov 4 09:43:49 ip-172-31-10-191 collectd[21356]: [AmazonCloudWatchPlugin][cloudwatch.modules.client.putclient] Could not put metric data using the following endpoint: 'https://monitoring.ap-southeast-2.amazonaws.com/'. [Exception: HTTPSConnectionPool(host='monitoring.ap-southeast-2.amazonaws.com', port=443): Max retries exceeded with url: /?Action=PutMetricData&MetricData.member.1.Dimensions.member.1.Name=Host&MetricData.member.1.Dimensions.member.1.Value=i-2080d48f&MetricData.member.1.Dimensions.member.2.Name=PluginInstance&MetricData.member.1.Dimensions.member.2.Value=NONE&MetricData.member.1.MetricName=memory.memory.cached&MetricData.member.1.StatisticValues.Maximum=1439035392.0&MetricData.member.1.StatisticValues.Minimum=1436717056.0&MetricData.member.1.StatisticValues.SampleCount=6&MetricData.member.1.StatisticValues.Sum=8628850688.0&MetricData.member.1.Timestamp=20161103T224249Z&MetricData.member.2.Dimensions.member.1.Name=Host&MetricData.member.2.Dimensions.member.1.Value=i-2080xxxx&MetricData.member.2.Dimensions.member.2.Name=PluginInstance&MetricD

Can you add proxy support?

dparmar74 commented 7 years ago

I'm having the same issue and our EC2 instances are behind proxy

bsangwan commented 7 years ago

@sebasrp @owilk I have tested the fix for proxy support in this plugin. Should I do PR for this fix?

sebasrp commented 7 years ago

@bsangwan please do! We will be more than happy to review and merge if the PR is good.

bsangwan commented 7 years ago

@sebasrp PR #34 has been submitted for this issue. We also modified this package for silent installation for our internal use. I will create an issue for this feature and will do PR later for this.

@dparmar74 can you try using plugin with my proxy changes and update the conversation ?