Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible Dimension #46

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Flexible Dimension #46

wants to merge 21 commits into from

Conversation

linshu
Copy link

@linshu linshu commented May 31, 2017

This is a framework implementing a way to easily add any dimension. (Issue #43)
The dimension coming in as a plugin. You can add it in dimensionplugin directory. As long as you initialize the dimension in Dimensions class init function, you can enable the dimension in the runtime by adding its name in dimensions.conf.
I have include a fix for adding Unit (Issue #42) in this request since that original request comes from a branch we can't open access to the public.

@Fodoj
Copy link

Fodoj commented Jun 1, 2017

Docs need to be updated to make people aware of how to use this feature

if self.config.DIMENSION_CONFIG_PATH != None:
d = Dimensions(self.config, self.vl)
dimensions = d.get_dimensions()
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a ASG feature pushed, it added a fixed dimension, maybe it will have some conflict with this pull request. Could you merge it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am going to merge it in my new merge request.

"Host" : self._get_host_dimension(),
"PluginInstance" : self._get_plugin_instance_dimension()
}
if self.config.DIMENSION_CONFIG_PATH != None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "if self.config.DIMENSION_CONFIG_PATH:"

If the configuration file is empty. how to handle it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the configuration file is empty, it will fall into the else case, which will use the original implementation to use the fixed dimension of "Host" and "PluginInstance".

def register_plugin(self):
self.func = dimension_get_instance_id
self.args = {
'name': "InstanceId",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the name of this dimension was "Host", now it is changed to "InstanceId", do not know if it will bring confusion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flexible dimension is configurable. We definitely can implement another Dimension_Host class with the same code. It is up to us and the user to expand the scenarios. Here, I am just giving two examples. I will write more document to explain how to use this feature.

@@ -67,3 +69,6 @@ def _add_values(self, metric, metric_map, metric_prefix):
metric_map[metric_prefix + self._STAT_MIN] = metric.statistics.min
metric_map[metric_prefix + self._STAT_SUM] = metric.statistics.sum
metric_map[metric_prefix + self._STAT_SAMPLE] = metric.statistics.sample_count

def _add_unit(self, metric, metric_map, metric_prefix):
metric_map[metric_prefix + self._UNIT_KEY] = metric.unit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that collectd give different unit every time? for example: sometimes, it is seconds, some times, it is miscroseconds.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible according to collectd protocol. We implemented that in our collectd read plugin.

self.func = dimension_get_hostname
self.args = {
'name': "Hostname",
'value': os.uname()[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not know if following issue will happen.
Return a 5-tuple containing information identifying the current operating system. The tuple contains 5 strings: (sysname, nodename, release, version, machine). Some systems truncate the nodename to 8 characters or to
the leading component; a better way to get the hostname is socket.gethostname() or even socket.gethostbyaddr(socket.gethostname()).

@yimuniao
Copy link
Contributor

This pull request has conflict with master branch, could you merge the latest codes?

@linshu
Copy link
Author

linshu commented Sep 27, 2017

I have added the explanation how to use this feature in README.md.

Thanks.

@yimuniao
Copy link
Contributor

yimuniao commented Oct 2, 2017

Please confirm this contribution is under the terms of the MIT license.
Thanks!

@linshu
Copy link
Author

linshu commented Oct 6, 2017

Yes, I confirm that this contribution is under the MIT license.
Thanks!

@Clecompt
Copy link

+1 for this feature, anything this PR is waiting on?

@yimuniao
Copy link
Contributor

Colleague in Open Source IP department is checking the license.

@yimuniao
Copy link
Contributor

Is this contribution being made on behalf of the individual or on behalf of the company?
looks like the you is employed at Palo Alto Networks

@linshu
Copy link
Author

linshu commented Oct 19, 2017

It is on behalf of the company, Palo Alto Networks.
Thanks.

@linshu
Copy link
Author

linshu commented Nov 13, 2017

What are we waiting for to merge this PR?

@yimuniao
Copy link
Contributor

Sorry. It is a little complicated. The latest reply from our security team:

Liang:
Do you anticipate this being a one time contribution? Or do you expect to receive repeated contributions from this person?
Thanks,

I replied: I expect to receive repeated contributions from this person.
I guess security guy may has some concern about the license as it is on behalf of your company.

Anyway, I need to wait for the reply from security team and then reserve some time to test it.

@linshu
Copy link
Author

linshu commented Nov 14, 2017

Thanks for the update. Yes, I might contribute more on this project if they are useful.

I can get our IP attorney to answer some further questions if needed.

Thanks.

@bidesh
Copy link

bidesh commented Dec 5, 2017

@yimuniao any update on the issue here? We are also waiting for this feature. :)

@yimuniao
Copy link
Contributor

yimuniao commented Dec 8, 2017

This contribution was approved by Security team. I will test it and if everything is ok, I will merge it soon.

@yimuniao
Copy link
Contributor

yimuniao commented Dec 8, 2017

I met following error, some metric has "none" for dimension "PluginInstance" :

[root@ip-172-31-33-105 config]# curl -i -v -connect-timeout 1 -m 3 -w %{http_code}:%{http_connect}:%{content_type}:%{time_namelookup}:%{time_redirect}:%{time_pretransfer}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} -A "collectd/1.0" 'https://monitoring.eu-west-1.amazonaws.com/?Action=PutMetricData&MetricData.member.1.Dimensions.member.1.Name=InstanceId&MetricData.member.1.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.1.Dimensions.member.2.Name=FixedDimension&MetricData.member.1.Dimensions.member.2.Value=ALL&MetricData.member.1.Dimensions.member.3.Name=PluginInstance&MetricData.member.1.Dimensions.member.3.Value=&MetricData.member.1.MetricName=cpu.percent.active&MetricData.member.1.StatisticValues.Maximum=0.300601202405&MetricData.member.1.StatisticValues.Minimum=0.1001001001&MetricData.member.1.StatisticValues.SampleCount=5&MetricData.member.1.StatisticValues.Sum=1.00414778939&MetricData.member.1.Timestamp=20171208T045358Z&MetricData.member.1.Unit=active&MetricData.member.2.Dimensions.member.1.Name=FixedDimension&MetricData.member.2.Dimensions.member.1.Value=ALL&MetricData.member.2.Dimensions.member.2.Name=PluginInstance&MetricData.member.2.Dimensions.member.2.Value=NONE&MetricData.member.2.MetricName=cpu.percent.active&MetricData.member.2.StatisticValues.Maximum=0.300601202405&MetricData.member.2.StatisticValues.Minimum=0.1001001001&MetricData.member.2.StatisticValues.SampleCount=5&MetricData.member.2.StatisticValues.Sum=1.00414778939&MetricData.member.2.Timestamp=20171208T045358Z&MetricData.member.2.Unit=active&MetricData.member.3.Dimensions.member.1.Name=InstanceId&MetricData.member.3.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.3.Dimensions.member.2.Name=FixedDimension&MetricData.member.3.Dimensions.member.2.Value=ALL&MetricData.member.3.Dimensions.member.3.Name=PluginInstance&MetricData.member.3.Dimensions.member.3.Value=&MetricData.member.3.MetricName=memory.percent.used&MetricData.member.3.StatisticValues.Maximum=6.73906803553&MetricData.member.3.StatisticValues.Minimum=6.68952473823&MetricData.member.3.StatisticValues.SampleCount=6&MetricData.member.3.StatisticValues.Sum=40.3368944217&MetricData.member.3.Timestamp=20171208T045348Z&MetricData.member.3.Unit=used&MetricData.member.4.Dimensions.member.1.Name=FixedDimension&MetricData.member.4.Dimensions.member.1.Value=ALL&MetricData.member.4.Dimensions.member.2.Name=PluginInstance&MetricData.member.4.Dimensions.member.2.Value=NONE&MetricData.member.4.MetricName=memory.percent.used&MetricData.member.4.StatisticValues.Maximum=6.73906803553&MetricData.member.4.StatisticValues.Minimum=6.68952473823&MetricData.member.4.StatisticValues.SampleCount=6&MetricData.member.4.StatisticValues.Sum=40.3368944217&MetricData.member.4.Timestamp=20171208T045348Z&MetricData.member.4.Unit=used&MetricData.member.5.Dimensions.member.1.Name=InstanceId&MetricData.member.5.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.5.Dimensions.member.2.Name=FixedDimension&MetricData.member.5.Dimensions.member.2.Value=ALL&MetricData.member.5.Dimensions.member.3.Name=PluginInstance&MetricData.member.5.Dimensions.member.3.Value=root&MetricData.member.5.MetricName=df.percent_bytes.used&MetricData.member.5.StatisticValues.Maximum=13.4382724762&MetricData.member.5.StatisticValues.Minimum=13.4382724762&MetricData.member.5.StatisticValues.SampleCount=6&MetricData.member.5.StatisticValues.Sum=80.6296348572&MetricData.member.5.Timestamp=20171208T045348Z&MetricData.member.5.Unit=used&MetricData.member.6.Dimensions.member.1.Name=FixedDimension&MetricData.member.6.Dimensions.member.1.Value=ALL&MetricData.member.6.Dimensions.member.2.Name=PluginInstance&MetricData.member.6.Dimensions.member.2.Value=root&MetricData.member.6.MetricName=df.percent_bytes.used&MetricData.member.6.StatisticValues.Maximum=13.4382724762&MetricData.member.6.StatisticValues.Minimum=13.4382724762&MetricData.member.6.StatisticValues.SampleCount=6&MetricData.member.6.StatisticValues.Sum=80.6296348572&MetricData.member.6.Timestamp=20171208T045348Z&MetricData.member.6.Unit=used&Namespace=collectd&Version=2010-08-01&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAI3SXMZHF2VA2C3ZQ%2F20171208%2Feu-west-1%2Fmonitoring%2Faws4_request&X-Amz-Date=20171208T045448Z&X-Amz-Security-Token=FQoDYXdzEJ7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDDkcP%2FfrV5eskgmoBCK3A1Gcje6AkVMDVxvfs%2B8X1DVDKgls9XHgBDEiHMWwUFX2JL%2BYoZ3yy89VEA3U1wpxZUQHlzyyEKySG64qeH%2F5v2LqmKbJcGJGzPr%2BA1FIIhJHTKxYzkBYLeMgk8%2FLVKIMGVyGyId0szWRuiwtTjVI%2BC%2BxhHaVTColwmWUMyFCC7%2BQ%2FmRI5IlwW5HfnUCB7xhUaRFh7dmM3XRCHnV0a6XuCI8Wz0vKnhOwQd%2F1gzqiKnObKJsM%2BEdlVzyfgvo92QfJj1y8e6IKD6kzNwa6GwQRQV8BN%2FBaS6ZkLPsRRe5QegpC%2B3VFKmSLf7nh1O9mLjvHHk%2B3KG6ldZpom1tB9BBLXA3xQyeNyARpYi3JgQRkjhwmG4x33KVOVRxfLncVJ7A7C%2BBrAoDuDWPNcHissPQ1na7d9UUjzix2Jp%2F48uNRInTF8GVOFwdL5xz5lG6YRzdvLRqCwHx8P538EHWCMfNcofcI5GZW1A%2BoKHg8OZnQNEUPVy1MImGKa%2B%2BQPMUbpQ0j4sKDZxy0pzwwYDNbXc6QG14Ogrv5qSlEEtv2eJHauamIEGV5LoLSmATWfyE%2FNS%2F1nfDJGToSWSYo17Ko0QU%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=279543f249bad79601d436262752a18620b9dc0901ad118123e8e98de34b8344'

  • Rebuilt URL to: 1/
  • Trying 0.0.0.1...
  • TCP_NODELAY set
  • Immediate connect fail for 0.0.0.1: Invalid argument
  • Closing connection 0
    curl: (7) Couldn't connect to server
    000:000::0.004389:0.000000:0.000000:0.000000:0.000000:0.000250:0.000* Trying 52.94.221.119...
  • TCP_NODELAY set
  • Connected to monitoring.eu-west-1.amazonaws.com (52.94.221.119) port 443 (Publish to PyPI #1)
  • Initializing NSS with certpath: sql:/etc/pki/nssdb
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
  • ALPN/NPN, server did not agree to a protocol
  • SSL connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  • Server certificate:
  • subject: CN=monitoring.eu-west-1.amazonaws.com,O="Amazon.com, Inc.",L=Seattle,ST=Washington,C=US
  • start date: Sep 26 00:00:00 2017 GMT
  • expire date: Jun 26 23:59:59 2018 GMT
  • common name: monitoring.eu-west-1.amazonaws.com
  • issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US

GET /?Action=PutMetricData&MetricData.member.1.Dimensions.member.1.Name=InstanceId&MetricData.member.1.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.1.Dimensions.member.2.Name=FixedDimension&MetricData.member.1.Dimensions.member.2.Value=ALL&MetricData.member.1.Dimensions.member.3.Name=PluginInstance&MetricData.member.1.Dimensions.member.3.Value=&MetricData.member.1.MetricName=cpu.percent.active&MetricData.member.1.StatisticValues.Maximum=0.300601202405&MetricData.member.1.StatisticValues.Minimum=0.1001001001&MetricData.member.1.StatisticValues.SampleCount=5&MetricData.member.1.StatisticValues.Sum=1.00414778939&MetricData.member.1.Timestamp=20171208T045358Z&MetricData.member.1.Unit=active&MetricData.member.2.Dimensions.member.1.Name=FixedDimension&MetricData.member.2.Dimensions.member.1.Value=ALL&MetricData.member.2.Dimensions.member.2.Name=PluginInstance&MetricData.member.2.Dimensions.member.2.Value=NONE&MetricData.member.2.MetricName=cpu.percent.active&MetricData.member.2.StatisticValues.Maximum=0.300601202405&MetricData.member.2.StatisticValues.Minimum=0.1001001001&MetricData.member.2.StatisticValues.SampleCount=5&MetricData.member.2.StatisticValues.Sum=1.00414778939&MetricData.member.2.Timestamp=20171208T045358Z&MetricData.member.2.Unit=active&MetricData.member.3.Dimensions.member.1.Name=InstanceId&MetricData.member.3.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.3.Dimensions.member.2.Name=FixedDimension&MetricData.member.3.Dimensions.member.2.Value=ALL&MetricData.member.3.Dimensions.member.3.Name=PluginInstance&MetricData.member.3.Dimensions.member.3.Value=&MetricData.member.3.MetricName=memory.percent.used&MetricData.member.3.StatisticValues.Maximum=6.73906803553&MetricData.member.3.StatisticValues.Minimum=6.68952473823&MetricData.member.3.StatisticValues.SampleCount=6&MetricData.member.3.StatisticValues.Sum=40.3368944217&MetricData.member.3.Timestamp=20171208T045348Z&MetricData.member.3.Unit=used&MetricData.member.4.Dimensions.member.1.Name=FixedDimension&MetricData.member.4.Dimensions.member.1.Value=ALL&MetricData.member.4.Dimensions.member.2.Name=PluginInstance&MetricData.member.4.Dimensions.member.2.Value=NONE&MetricData.member.4.MetricName=memory.percent.used&MetricData.member.4.StatisticValues.Maximum=6.73906803553&MetricData.member.4.StatisticValues.Minimum=6.68952473823&MetricData.member.4.StatisticValues.SampleCount=6&MetricData.member.4.StatisticValues.Sum=40.3368944217&MetricData.member.4.Timestamp=20171208T045348Z&MetricData.member.4.Unit=used&MetricData.member.5.Dimensions.member.1.Name=InstanceId&MetricData.member.5.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.5.Dimensions.member.2.Name=FixedDimension&MetricData.member.5.Dimensions.member.2.Value=ALL&MetricData.member.5.Dimensions.member.3.Name=PluginInstance&MetricData.member.5.Dimensions.member.3.Value=root&MetricData.member.5.MetricName=df.percent_bytes.used&MetricData.member.5.StatisticValues.Maximum=13.4382724762&MetricData.member.5.StatisticValues.Minimum=13.4382724762&MetricData.member.5.StatisticValues.SampleCount=6&MetricData.member.5.StatisticValues.Sum=80.6296348572&MetricData.member.5.Timestamp=20171208T045348Z&MetricData.member.5.Unit=used&MetricData.member.6.Dimensions.member.1.Name=FixedDimension&MetricData.member.6.Dimensions.member.1.Value=ALL&MetricData.member.6.Dimensions.member.2.Name=PluginInstance&MetricData.member.6.Dimensions.member.2.Value=root&MetricData.member.6.MetricName=df.percent_bytes.used&MetricData.member.6.StatisticValues.Maximum=13.4382724762&MetricData.member.6.StatisticValues.Minimum=13.4382724762&MetricData.member.6.StatisticValues.SampleCount=6&MetricData.member.6.StatisticValues.Sum=80.6296348572&MetricData.member.6.Timestamp=20171208T045348Z&MetricData.member.6.Unit=used&Namespace=collectd&Version=2010-08-01&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAI3SXMZHF2VA2C3ZQ%2F20171208%2Feu-west-1%2Fmonitoring%2Faws4_request&X-Amz-Date=20171208T045448Z&X-Amz-Security-Token=FQoDYXdzEJ7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDDkcP%2FfrV5eskgmoBCK3A1Gcje6AkVMDVxvfs%2B8X1DVDKgls9XHgBDEiHMWwUFX2JL%2BYoZ3yy89VEA3U1wpxZUQHlzyyEKySG64qeH%2F5v2LqmKbJcGJGzPr%2BA1FIIhJHTKxYzkBYLeMgk8%2FLVKIMGVyGyId0szWRuiwtTjVI%2BC%2BxhHaVTColwmWUMyFCC7%2BQ%2FmRI5IlwW5HfnUCB7xhUaRFh7dmM3XRCHnV0a6XuCI8Wz0vKnhOwQd%2F1gzqiKnObKJsM%2BEdlVzyfgvo92QfJj1y8e6IKD6kzNwa6GwQRQV8BN%2FBaS6ZkLPsRRe5QegpC%2B3VFKmSLf7nh1O9mLjvHHk%2B3KG6ldZpom1tB9BBLXA3xQyeNyARpYi3JgQRkjhwmG4x33KVOVRxfLncVJ7A7C%2BBrAoDuDWPNcHissPQ1na7d9UUjzix2Jp%2F48uNRInTF8GVOFwdL5xz5lG6YRzdvLRqCwHx8P538EHWCMfNcofcI5GZW1A%2BoKHg8OZnQNEUPVy1MImGKa%2B%2BQPMUbpQ0j4sKDZxy0pzwwYDNbXc6QG14Ogrv5qSlEEtv2eJHauamIEGV5LoLSmATWfyE%2FNS%2F1nfDJGToSWSYo17Ko0QU%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=279543f249bad79601d436262752a18620b9dc0901ad118123e8e98de34b8344 HTTP/1.1
Host: monitoring.eu-west-1.amazonaws.com
User-Agent: collectd/1.0
Accept: /

< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
< x-amzn-RequestId: 0785107f-dbd4-11e7-9d1e-45079be837f6
x-amzn-RequestId: 0785107f-dbd4-11e7-9d1e-45079be837f6
< Content-Type: text/xml
Content-Type: text/xml
< Content-Length: 399
Content-Length: 399
< Date: Fri, 08 Dec 2017 04:55:36 GMT
Date: Fri, 08 Dec 2017 04:55:36 GMT
< Connection: close
Connection: close

<


Sender
MissingParameter
The parameter MetricData.member.1.Dimensions.member.3.Value is required.
The parameter MetricData.member.3.Dimensions.member.3.Value is required.

0785107f-dbd4-11e7-9d1e-45079be837f6

  • Closing connection 1

Copy link
Contributor

@yimuniao yimuniao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more unit tests to cover your configuration change and logic?

self.func = dimension_get_plugin_instance
self.args = {
'name': "PluginInstance",
'value': self.vl.plugin_instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.vl.plugin_instance is none, you can use "NONE". Refer to https://github.com/awslabs/collectd-cloudwatch/blob/master/src/cloudwatch/modules/metricdata.py#L139

@yimuniao
Copy link
Contributor

yimuniao commented Dec 8, 2017

After change some codes like:
def dimension_get_plugin_instance(dimension, args):
dimension[args['name']] = args['value'] if args['value'] else "NONE"

Following error occurred, Could you remove the changes related to "unit". We can use another pull request to address "unit" issue.

[root@ip-172-31-33-105 dimensionplugins]# curl -i -v -connect-timeout 1 -m 3 -w %{http_code}:%{http_connect}:%{content_type}:%{time_namelookup}:%{time_redirect}:%{time_pretransfer}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} -A "collectd/1.0" 'https://monitoring.eu-west-1.amazonaws.com/?Action=PutMetricData&MetricData.member.1.Dimensions.member.1.Name=InstanceId&MetricData.member.1.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.1.Dimensions.member.2.Name=FixedDimension&MetricData.member.1.Dimensions.member.2.Value=ALL&MetricData.member.1.Dimensions.member.3.Name=PluginInstance&MetricData.member.1.Dimensions.member.3.Value=NONE&MetricData.member.1.MetricName=cpu.percent.active&MetricData.member.1.StatisticValues.Maximum=0.4&MetricData.member.1.StatisticValues.Minimum=0.0&MetricData.member.1.StatisticValues.SampleCount=6&MetricData.member.1.StatisticValues.Sum=0.6001001001&MetricData.member.1.Timestamp=20171208T062404Z&MetricData.member.1.Unit=active&MetricData.member.2.Dimensions.member.1.Name=FixedDimension&MetricData.member.2.Dimensions.member.1.Value=ALL&MetricData.member.2.Dimensions.member.2.Name=PluginInstance&MetricData.member.2.Dimensions.member.2.Value=NONE&MetricData.member.2.MetricName=cpu.percent.active&MetricData.member.2.StatisticValues.Maximum=0.4&MetricData.member.2.StatisticValues.Minimum=0.0&MetricData.member.2.StatisticValues.SampleCount=6&MetricData.member.2.StatisticValues.Sum=0.6001001001&MetricData.member.2.Timestamp=20171208T062404Z&MetricData.member.2.Unit=active&MetricData.member.3.Dimensions.member.1.Name=InstanceId&MetricData.member.3.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.3.Dimensions.member.2.Name=FixedDimension&MetricData.member.3.Dimensions.member.2.Value=ALL&MetricData.member.3.Dimensions.member.3.Name=PluginInstance&MetricData.member.3.Dimensions.member.3.Value=NONE&MetricData.member.3.MetricName=memory.percent.used&MetricData.member.3.StatisticValues.Maximum=7.55928484644&MetricData.member.3.StatisticValues.Minimum=7.54591602018&MetricData.member.3.StatisticValues.SampleCount=6&MetricData.member.3.StatisticValues.Sum=45.3329034338&MetricData.member.3.Timestamp=20171208T062404Z&MetricData.member.3.Unit=used&MetricData.member.4.Dimensions.member.1.Name=FixedDimension&MetricData.member.4.Dimensions.member.1.Value=ALL&MetricData.member.4.Dimensions.member.2.Name=PluginInstance&MetricData.member.4.Dimensions.member.2.Value=NONE&MetricData.member.4.MetricName=memory.percent.used&MetricData.member.4.StatisticValues.Maximum=7.55928484644&MetricData.member.4.StatisticValues.Minimum=7.54591602018&MetricData.member.4.StatisticValues.SampleCount=6&MetricData.member.4.StatisticValues.Sum=45.3329034338&MetricData.member.4.Timestamp=20171208T062404Z&MetricData.member.4.Unit=used&MetricData.member.5.Dimensions.member.1.Name=InstanceId&MetricData.member.5.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.5.Dimensions.member.2.Name=FixedDimension&MetricData.member.5.Dimensions.member.2.Value=ALL&MetricData.member.5.Dimensions.member.3.Name=PluginInstance&MetricData.member.5.Dimensions.member.3.Value=root&MetricData.member.5.MetricName=df.percent_bytes.used&MetricData.member.5.StatisticValues.Maximum=13.4494009018&MetricData.member.5.StatisticValues.Minimum=13.4492530823&MetricData.member.5.StatisticValues.SampleCount=6&MetricData.member.5.StatisticValues.Sum=80.6961593628&MetricData.member.5.Timestamp=20171208T062404Z&MetricData.member.5.Unit=used&MetricData.member.6.Dimensions.member.1.Name=FixedDimension&MetricData.member.6.Dimensions.member.1.Value=ALL&MetricData.member.6.Dimensions.member.2.Name=PluginInstance&MetricData.member.6.Dimensions.member.2.Value=root&MetricData.member.6.MetricName=df.percent_bytes.used&MetricData.member.6.StatisticValues.Maximum=13.4494009018&MetricData.member.6.StatisticValues.Minimum=13.4492530823&MetricData.member.6.StatisticValues.SampleCount=6&MetricData.member.6.StatisticValues.Sum=80.6961593628&MetricData.member.6.Timestamp=20171208T062404Z&MetricData.member.6.Unit=used&Namespace=collectd&Version=2010-08-01&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAJOFEYYE5BXR5KEAA%2F20171208%2Feu-west-1%2Fmonitoring%2Faws4_request&X-Amz-Date=20171208T062504Z&X-Amz-Security-Token=FQoDYXdzEJ%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDKI4S78sY4GhxnK6LCK3AxIVULxUO4T%2B97BZZiFbp8BVxQbDAzip96hpYNREGJe4VnN%2FFvqZ8nNCJBqiJnXy9KXVr4uIQVg%2BtmPs5tzHxChVNzJ%2FI%2BmArKXJvfOIe2K%2FzQiPKz52Zi4EKMjgiPOXhp%2B9oyNELcrZlMMWYwQRVxFoxd86fb6QqilVgV%2BovDau9g6E3ys7LCjhPvE1wAZMO4skweJWITn9ctvMka9p8CQZjD2851vfV3SqKokrQH6f9C3SogB86srTc8PYnHRbehqzm2CPHekZjU5TufC%2FmHA39qYqbwgg5Ly09%2FwIp1%2Fah7Gxt69Feh%2FsBgt2j4Rqbk8YSMbzn7OWC5zTaUt051rlRPQdgHjXPflNML5DEtkZqUtmaNJiBdcZs2pE349RM9GIM9C0xOkLxI0pCzg6%2BsPsCs4x8qZ0p1M%2BesmFbHQ8DLvmR1p0w4Rg7cWvLtkTv4SiwKSzH9T6VUl1MDOXHpJDwLjiQY5SIygufTzQF26ZIcX4mvi6zPurPYA5vwPYFXI7LOIUMKYpySbXz4hnWy3y42%2FOpHi8fCJx%2FUMzfIqu4S12wtraaA5mYPrkd7So07Z9fhP81cIo%2Fdyo0QU%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=f927c3933b868f1a4b53eaf8b93af96b3b508db55ac7e2672dc86fb8118b42c2'

  • Rebuilt URL to: 1/
  • Trying 0.0.0.1...
  • TCP_NODELAY set
  • Immediate connect fail for 0.0.0.1: Invalid argument
  • Closing connection 0
    curl: (7) Couldn't connect to server
    000:000::0.004288:0.000000:0.000000:0.000000:0.000000:0.000137:0.000* Trying 52.94.219.139...
  • TCP_NODELAY set
  • Connected to monitoring.eu-west-1.amazonaws.com (52.94.219.139) port 443 (Publish to PyPI #1)
  • Initializing NSS with certpath: sql:/etc/pki/nssdb
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
  • ALPN/NPN, server did not agree to a protocol
  • SSL connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  • Server certificate:
  • subject: CN=monitoring.eu-west-1.amazonaws.com,O="Amazon.com, Inc.",L=Seattle,ST=Washington,C=US
  • start date: Sep 26 00:00:00 2017 GMT
  • expire date: Jun 26 23:59:59 2018 GMT
  • common name: monitoring.eu-west-1.amazonaws.com
  • issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US

GET /?Action=PutMetricData&MetricData.member.1.Dimensions.member.1.Name=InstanceId&MetricData.member.1.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.1.Dimensions.member.2.Name=FixedDimension&MetricData.member.1.Dimensions.member.2.Value=ALL&MetricData.member.1.Dimensions.member.3.Name=PluginInstance&MetricData.member.1.Dimensions.member.3.Value=NONE&MetricData.member.1.MetricName=cpu.percent.active&MetricData.member.1.StatisticValues.Maximum=0.4&MetricData.member.1.StatisticValues.Minimum=0.0&MetricData.member.1.StatisticValues.SampleCount=6&MetricData.member.1.StatisticValues.Sum=0.6001001001&MetricData.member.1.Timestamp=20171208T062404Z&MetricData.member.1.Unit=active&MetricData.member.2.Dimensions.member.1.Name=FixedDimension&MetricData.member.2.Dimensions.member.1.Value=ALL&MetricData.member.2.Dimensions.member.2.Name=PluginInstance&MetricData.member.2.Dimensions.member.2.Value=NONE&MetricData.member.2.MetricName=cpu.percent.active&MetricData.member.2.StatisticValues.Maximum=0.4&MetricData.member.2.StatisticValues.Minimum=0.0&MetricData.member.2.StatisticValues.SampleCount=6&MetricData.member.2.StatisticValues.Sum=0.6001001001&MetricData.member.2.Timestamp=20171208T062404Z&MetricData.member.2.Unit=active&MetricData.member.3.Dimensions.member.1.Name=InstanceId&MetricData.member.3.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.3.Dimensions.member.2.Name=FixedDimension&MetricData.member.3.Dimensions.member.2.Value=ALL&MetricData.member.3.Dimensions.member.3.Name=PluginInstance&MetricData.member.3.Dimensions.member.3.Value=NONE&MetricData.member.3.MetricName=memory.percent.used&MetricData.member.3.StatisticValues.Maximum=7.55928484644&MetricData.member.3.StatisticValues.Minimum=7.54591602018&MetricData.member.3.StatisticValues.SampleCount=6&MetricData.member.3.StatisticValues.Sum=45.3329034338&MetricData.member.3.Timestamp=20171208T062404Z&MetricData.member.3.Unit=used&MetricData.member.4.Dimensions.member.1.Name=FixedDimension&MetricData.member.4.Dimensions.member.1.Value=ALL&MetricData.member.4.Dimensions.member.2.Name=PluginInstance&MetricData.member.4.Dimensions.member.2.Value=NONE&MetricData.member.4.MetricName=memory.percent.used&MetricData.member.4.StatisticValues.Maximum=7.55928484644&MetricData.member.4.StatisticValues.Minimum=7.54591602018&MetricData.member.4.StatisticValues.SampleCount=6&MetricData.member.4.StatisticValues.Sum=45.3329034338&MetricData.member.4.Timestamp=20171208T062404Z&MetricData.member.4.Unit=used&MetricData.member.5.Dimensions.member.1.Name=InstanceId&MetricData.member.5.Dimensions.member.1.Value=i-064072d9df139837d&MetricData.member.5.Dimensions.member.2.Name=FixedDimension&MetricData.member.5.Dimensions.member.2.Value=ALL&MetricData.member.5.Dimensions.member.3.Name=PluginInstance&MetricData.member.5.Dimensions.member.3.Value=root&MetricData.member.5.MetricName=df.percent_bytes.used&MetricData.member.5.StatisticValues.Maximum=13.4494009018&MetricData.member.5.StatisticValues.Minimum=13.4492530823&MetricData.member.5.StatisticValues.SampleCount=6&MetricData.member.5.StatisticValues.Sum=80.6961593628&MetricData.member.5.Timestamp=20171208T062404Z&MetricData.member.5.Unit=used&MetricData.member.6.Dimensions.member.1.Name=FixedDimension&MetricData.member.6.Dimensions.member.1.Value=ALL&MetricData.member.6.Dimensions.member.2.Name=PluginInstance&MetricData.member.6.Dimensions.member.2.Value=root&MetricData.member.6.MetricName=df.percent_bytes.used&MetricData.member.6.StatisticValues.Maximum=13.4494009018&MetricData.member.6.StatisticValues.Minimum=13.4492530823&MetricData.member.6.StatisticValues.SampleCount=6&MetricData.member.6.StatisticValues.Sum=80.6961593628&MetricData.member.6.Timestamp=20171208T062404Z&MetricData.member.6.Unit=used&Namespace=collectd&Version=2010-08-01&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAJOFEYYE5BXR5KEAA%2F20171208%2Feu-west-1%2Fmonitoring%2Faws4_request&X-Amz-Date=20171208T062504Z&X-Amz-Security-Token=FQoDYXdzEJ%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDKI4S78sY4GhxnK6LCK3AxIVULxUO4T%2B97BZZiFbp8BVxQbDAzip96hpYNREGJe4VnN%2FFvqZ8nNCJBqiJnXy9KXVr4uIQVg%2BtmPs5tzHxChVNzJ%2FI%2BmArKXJvfOIe2K%2FzQiPKz52Zi4EKMjgiPOXhp%2B9oyNELcrZlMMWYwQRVxFoxd86fb6QqilVgV%2BovDau9g6E3ys7LCjhPvE1wAZMO4skweJWITn9ctvMka9p8CQZjD2851vfV3SqKokrQH6f9C3SogB86srTc8PYnHRbehqzm2CPHekZjU5TufC%2FmHA39qYqbwgg5Ly09%2FwIp1%2Fah7Gxt69Feh%2FsBgt2j4Rqbk8YSMbzn7OWC5zTaUt051rlRPQdgHjXPflNML5DEtkZqUtmaNJiBdcZs2pE349RM9GIM9C0xOkLxI0pCzg6%2BsPsCs4x8qZ0p1M%2BesmFbHQ8DLvmR1p0w4Rg7cWvLtkTv4SiwKSzH9T6VUl1MDOXHpJDwLjiQY5SIygufTzQF26ZIcX4mvi6zPurPYA5vwPYFXI7LOIUMKYpySbXz4hnWy3y42%2FOpHi8fCJx%2FUMzfIqu4S12wtraaA5mYPrkd7So07Z9fhP81cIo%2Fdyo0QU%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=f927c3933b868f1a4b53eaf8b93af96b3b508db55ac7e2672dc86fb8118b42c2 HTTP/1.1
Host: monitoring.eu-west-1.amazonaws.com
User-Agent: collectd/1.0
Accept: /

< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
< x-amzn-RequestId: 8f7fe4ca-dbe0-11e7-9db4-35f988bffdf0
x-amzn-RequestId: 8f7fe4ca-dbe0-11e7-9db4-35f988bffdf0
< Content-Type: text/xml
Content-Type: text/xml
< Content-Length: 2700
Content-Length: 2700
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Date: Fri, 08 Dec 2017 06:25:18 GMT
Date: Fri, 08 Dec 2017 06:25:18 GMT
< Connection: close
Connection: close

<


Sender
InvalidParameterValue
The parameter MetricData.member.1.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].
The parameter MetricData.member.2.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].
The parameter MetricData.member.3.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].
The parameter MetricData.member.4.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].
The parameter MetricData.member.5.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].
The parameter MetricData.member.6.Unit must be a value in the set [ Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None ].

8f7fe4ca-dbe0-11e7-9db4-35f988bffdf0

  • Closing connection 1

@linshu
Copy link
Author

linshu commented Jan 22, 2018

@yimuniao I have fixed all the issues. Please review it.

Thanks.

@garrettwilkin
Copy link

I guess that this issue is pretty old now, but I'd love to have this feature.

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.

6 participants