librato / collectd-librato Goto Github PK
View Code? Open in Web Editor NEWCollectd Plugin for Librato Metrics
License: Apache License 2.0
Collectd Plugin for Librato Metrics
License: Apache License 2.0
we're adding this to our chef recipes, need this version to be easily accessible, thanks!
I am still pretty new to collectd. Playing around with this plugin I got an error:
Oct 29 12:26:18 titan collectd[20703]: Unhandled python exception in write callback: KeyError: 'floor_time_secs', file: collectd-librato.py,
I popped it in a try block:
# Floor measure time?
m_time = int(v.time)
try:
if config['floor_time_secs']:
m_time /= config['floor_time_secs']
m_time *= config['floor_time_secs']
except:
pass
This is around line 311.
I am also pretty new to open source collaboration. I can certainly edit the file and check in the change. I haven't done it before to someone else's repository, but, if this is a valid change I'd be happy to try it.
Best,
-greg
This and IncludeRegex would be mutually exclusive.
Collectd's configuration supports multiple TypesDB configuration directives, however it seems that the plugin is only aware of one.
Please see http://collectd.org/documentation/manpages/types.db.5.shtml#custom_types for further documentation of this.
Thank you! ๐ฎ
Been attempting to deploy the collectd-librato plugin using the Chef cookbook as well. I am able to successfully run the cookbook and launch collectd, however it looks like urllib2 is reaching an IOError:
Mar 25 17:55:31 localhost.localdomain collectd[11012]: Collectd-Librato.py: Error when sending metrics Librato ([Errno 13] Permission denied)
Mar 25 17:56:01 localhost.localdomain collectd[11012]: Collectd-Librato.py: Error when sending metrics Librato ([Errno 13] Permission denied)
Here is my configuration for the plugin:
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
<LoadPlugin python>
Globals true
</LoadPlugin>
<Plugin python>
ModulePath "/usr/lib64/collectd"
ModulePath "/opt/collectd-librato-0.0.10/lib"
Import "collectd-librato"
<Module "collectd-librato">
APIToken "#####"
Email "######"
</Module>
</Plugin>
I'm assuming this is a permissions issue, however unsure the files in question that would be causing this.
Collectd-librato uses the configured Hostname from the main collectd configuration as the metric source name. Add an option to collectd-librato's configuration section that allows the source name to be overridden.
Hello, here is a snippet of my collectd configuration:
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
# collectd-librato.py is at /opt/collectd-librato-0.0.10/lib/collectd-librato.py
ModulePath "/opt/collectd-librato-0.0.10/lib"
Import "collectd-librato"
<Module "collectd-librato">
Email "<email>"
APIToken "<token>"
LowercaseMetricNames true
MetricPrefix ""
IncludeRegex "^cpu\..+$,^df\.mnt.+$,^df\.root\..+$,^memory\.memory\..+$,^ping\.ping_droprate\..+$,^swap\.swap\..+$"
</Module>
</Plugin>
For the most part this configuration is working as expected, however the swap.swap_io.in
and swap.swap_io.out
metrics are being not being filtered out.
I do not believe this to be a problem with the regex, as the following Python snippets properly filter out those metrics:
>>> import re
>>> "^cpu\..+$,^df\.mnt.+$,^df\.root\..+$,^memory\.memory\..+$,^ping\.ping_droprate\..+$,^swap\.swap\..+$".split(',')[5]
'^swap\\.swap\\..+$'
>>> re.match("^cpu\..+$,^df\.mnt.+$,^df\.root\..+$,^memory\.memory\..+$,^ping\.ping_droprate\..+$,^swap\.swap\..+$".split(',')[5], "swap.swap.cached")
<_sre.SRE_Match object at 0x10465d168>
>>> re.match("^cpu\..+$,^df\.mnt.+$,^df\.root\..+$,^memory\.memory\..+$,^ping\.ping_droprate\..+$,^swap\.swap\..+$".split(',')[5], "swap.swap_io.in")
>>>
Any help would be greatly appreciated.
Hey Guys,
I got the plugin working but after a few hours it stops sending metrics and I have to restart collectd service.
When I restart collectd, I get this error below, but if I open the conf file and do anything like remove a line return or even some whitespace and save the file, collectd is able to restart without a problem and metrics start to enter librato. Any Ideas?
Restarting statistics collection and monitoring daemon: collectdParse error in file /etc/collectd/plugins/librato.conf', line 54 near
': syntax error, unexpected $end, expecting EOL
yyparse returned error #1
configfile: Cannot read file /etc/collectd/plugins/librato.conf'. Parse error in file
/etc/collectd/plugins/librato.conf', line 54 near ': syntax error, unexpected $end, expecting EOL yyparse returned error #1 configfile: Cannot read file
/etc/collectd/plugins/librato.conf'.
<LoadPlugin "python">
Globals true
<Plugin "python">
# collectd-librato.py is at /opt/collectd-librato-0.0.8/lib/collectd-librato.py
ModulePath "/opt/collectd-librato-0.0.8/lib"
Import "collectd-librato"
<Module "collectd-librato">
APIToken "<API TOKEN HERE>"
Email "[email protected]"
Source "app01"
</Module>
</Plugin>
running 0.0.2 of collectd-librato on debian 6, and python 2.6.6 getting the following error when checking my collectd config with the -t flag:
unhandled python exception in loading module: AttributeError: 'tuple' object has no attribute 'major'
I believe I've tracked down this issue to the following line:
https://github.com/librato/collectd-librato/blob/master/lib/collectd-librato.py#L117
if I run python REPL, and type sys.version_info, the tuple I get in py 2.6 looks like this:
(2, 6, 6, 'final', 0)
calling major on that results in an identical error message. I could patch this, but I am uncertain how you'd like to handle this scenario.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.