crccheck / cloudwatch-to-graphite

Helper for pushing AWS CloudWatch metrics to Graphite
Apache License 2.0
55 stars 28 forks source link

how filter works? #40

Open ghost opened 8 years ago

ghost commented 8 years ago

Could you please provide example of how plumbum filter works? I wasn't able to figure out how it work and receiving errors all the time.

Traceback (most recent call last):
  File "/home/vagrant/.pyenv/versions/2.7.6/bin/plumbum", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/.pyenv/versions/2.7.6/lib/python2.7/site-packages/plumbum.py", line 222, in main
    resources = list_resources[namespace](region, filters)
  File "/home/vagrant/.pyenv/versions/2.7.6/lib/python2.7/site-packages/plumbum.py", line 136, in list_elb
    return lookup(instances, filter_by=filter_by_kwargs)
  File "/home/vagrant/.pyenv/versions/2.7.6/lib/python2.7/site-packages/plumbum.py", line 82, in lookup
    return list(filter(filter_key(filter_by), instances))
  File "/home/vagrant/.pyenv/versions/2.7.6/lib/python2.7/site-packages/plumbum.py", line 76, in filter_instance
    for key, value in filter_args.items()])
AttributeError: 'str' object has no attribute 'items'
paul-krohn commented 8 years ago

Can you provide the command/usage you employed that generated this output?

ghost commented 8 years ago

@paul-krohn Hi, this is the command that I executed. :) Thank you for the quick response.

vagrant@vagrant:~$ plumbum -r us-west-1 -f internal --toke elb.name='internal.us-west-1.elb.amazonaws.com' cloudwatch-to-graphite/sample_templates/elb.yml.j2 AWS/ELB
paul-krohn commented 8 years ago

There are a few problems here.

Can I interest you in perhaps fixing any of these things? It would be great to have another maintainer on board.

tmclaugh commented 8 years ago

There were a number of changes recently. Any idea where / when the filtering broke?

paul-krohn commented 8 years ago

I've never used the filtering, so I've no idea when it worked. :(

tmclaugh commented 8 years ago

@jasonatfleepio what version of the package? See #37 which is in release 0.9.2.

The template and namespace argument were swapped in a recent PR. I reverted it back.

ghost commented 8 years ago

uh, I'm in 0.9.0.

vagrant@vagrant:~$ plumbum --version
0.9.0
tmclaugh commented 8 years ago

Try 0.9.2 and your issue should go away.

ghost commented 8 years ago

@tmclaugh How can I install 0.9.2 with pip? I was installed with pip upgrading to 0.9.2, but still showing me 0.9.0

 $ pip install cloudwatch-to-graphite==0.9.2 --upgrade
Requirement already up-to-date: cloudwatch-to-graphite==0.9.2 in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages
Requirement already up-to-date: boto in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages (from cloudwatch-to-graphite==0.9.2)
Requirement already up-to-date: docopt in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages (from cloudwatch-to-graphite==0.9.2)
Requirement already up-to-date: PyYAML in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages (from cloudwatch-to-graphite==0.9.2)
Requirement already up-to-date: Jinja2 in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages (from cloudwatch-to-graphite==0.9.2)
Requirement already up-to-date: MarkupSafe in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages (from Jinja2->cloudwatch-to-graphite==0.9.2)
$ plumbum --version
0.9.0
paul-krohn commented 8 years ago

We'll need a push of tags 0.9.4 and 0.9.5 to PyPi before @jasonatfleepio can validate recent changes address his issue.