graphite-project / carbon

Carbon is one of the components of Graphite, and is responsible for receiving metrics over the network and writing them down to disk using a storage backend.
http://graphite.readthedocs.org/
Apache License 2.0
1.51k stars 490 forks source link

AMQP listener always takes metric name from message body #158

Closed yunmanger1 closed 4 years ago

yunmanger1 commented 11 years ago

I think that

settings.get('AMQP_METRIC_NAME_IN_BODY')

returns a string. Any non-empty string is true.

yunmanger1 commented 11 years ago

@cdavis https://github.com/graphite-project/carbon/blob/master/lib/carbon/amqp_listener.py#L118

yunmanger1 commented 11 years ago

@cdavis maybe you should do somethings like value = value == "True" and True or False https://github.com/graphite-project/carbon/blob/master/lib/carbon/conf.py#L163

mferber commented 10 years ago

I just hit the same problem. I believe a boolean default value for this setting needs to be set in conf.py:

https://github.com/graphite-project/carbon/blob/master/lib/carbon/conf.py#L31

...because the Settings module uses these initial defaults to determine the type for each setting (https://github.com/graphite-project/carbon/blob/master/lib/carbon/conf.py#L144). AMQP_METRIC_NAME_IN_BODY has no initial default value, so it's treated as a string. I think.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.