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

Adds protocol class option to act as a full graphite replacement. #19

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -39,6 +39,7 @@ It does very primitive _'caching'_: aggregates all metrics and flushes them in r
| --auth-url | Keystone token URL | |
| --config | Set options from a config file | |
| --overwrite_collection_timestamp | Replace metric collection timestamp with ingest timestamp | False |
| --protocol | Listening protocol class. MetricPickleReceiver for receiving metrics from graphite, or MetricLineReceiver to act as a graphite replacement. | MetricPickleReceiver |

In case you need no authentication leave `-u`/`--user` command line argument empty (default value).
It is recommended not to set the `key` option from the command line, as that can compromise api keys. Instead, set the key in a config file and set the `--config` option to the name of the file.'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -35,7 +35,7 @@ def run_tests(self):

setup(
name='blueflood-carbon-forwarder',
version="0.4.1",
version="0.4.2",
url='https://github.com/rackerlabs/blueflood-carbon-forwarder',
license='Apache Software License',
author='Rackspace Metrics',
Expand Down
10 changes: 9 additions & 1 deletion twisted/plugins/graphite_blueflood_plugin.py
Expand Up @@ -32,6 +32,7 @@ class Options(usage.Options):
['key', 'k', '', 'Rackspace authentication password. It is recommended not to set this option from the command line, as that can compromise api keys. Instead, set the key in a config file and use the \'--config\' option below.'],
['auth_url', '', AUTH_URL, 'Auth URL'],
['limit', '', 0, 'Blueflood json payload limit, bytes. 0 means no limit'],
['protocol', '', 'MetricPickleReceiver', 'Listening protocol class. MetricPickleReceiver for receiving metrics from graphite, or MetricLineReceiver to act as a graphite replacement.'],
['overwrite_collection_timestamp', '', False, 'Replace metric time with current blueflood carbon forwarder node time'],
['config', 'c', None,
'Path to a configuration file. The file must be in INI format, with '
Expand Down Expand Up @@ -137,8 +138,15 @@ def makeService(self, options):
value = int(value)
options[key] = value

if options['protocol'] == "MetricPickleReceiver":
protocol_cls = MetricPickleReceiver
elif options['protocol'] == "MetricLineReceiver":
protocol_cls = MetricLineReceiver
Copy link
Contributor

Choose a reason for hiding this comment

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

where's MetricLineReceiver defined? Is it part of some library?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nevermind, it's part of protocol.py where MetricPickleReceiver is also defined.

else:
protocol_cls = MetricPickleReceiver

return MetricService(
protocol_cls=MetricPickleReceiver,
protocol_cls=protocol_cls,
endpoint=options['endpoint'],
interval=float(options['interval']),
blueflood_url=options['blueflood'],
Expand Down