HubSpot / BuckyServer

Node server that receives metric data over HTTP & forwards to your service of choice
http://github.hubspot.com/bucky
MIT License
195 stars 33 forks source link

Added module for InfluxDB 0.9 #15

Closed JSMike closed 9 years ago

JSMike commented 9 years ago

Hello,

I created a module for InfluxDB 0.9, thought I'd share.

Regards, Mike Cebrian

JSMike commented 9 years ago

@zackbloom influxDB 0.9 is now stable. Is it possible to have this PR merged? or is there something else that needs to be done on my end?

Regards, Mike Cebrian

zackbloom commented 9 years ago

Hi @JSMike, thanks. Does the current influx db logger not work with 0.9?

JSMike commented 9 years ago

The current one only works with Influxdb 0.8. influxdb 0.9 had some breaking changes: https://influxdb.com/docs/v0.9/about/release_notes.html "Note: Version 0.9.0 is a completely rewrite of the 0.8.8 codebase. Due to the many breaking changes to the API, versions 0.8 and 0.9 are not interoperable."

zackbloom commented 9 years ago

Would it be possible to end up with one connector which takes an option of which version it should be compatible with?

JSMike commented 9 years ago

What would you like it to default to if the version isn't entered? 0.8 or 0.9?

zackbloom commented 9 years ago

As long as we bump the major version of BuckyServer in the process, I believe 0.9 would be fine.

JSMike commented 9 years ago

Hi,

I've updated the module to work for either version of influxdb. The version can be set in config by changing the legacy flag, either true for influxdb 0.8 or false 0.9. This defaults to false.

I also updated the version to 0.5.0

Note: This may need another update in the future. While the influxdb change log has no mention of deprecating the JSON write protocol, I just noticed that it's listed as deprecated in their documentation. A larger rewrite will be required to use their line protocol :(

zackbloom commented 9 years ago

Re your note, why don't we change legacy flag to instead be a version string option which can be set to '0.8' or '0.9'. That way we have a clear path if we need to make another change in the future.

JSMike commented 9 years ago

Hi, I'm back. I had some other priorities come up.

I also added a fix for when running BuckyServer outside of the BuckyServer path. I ran into this issue when running BuckyServer as a service through forever. It's an issue with the config module, it looks for the config directory using process.cwd() and when the process is started outside of the BuckyServer path it's unable to find the config and fails. The fix is simple, server.coffee sets the process directory.

JSMike commented 9 years ago

@zackbloom Let me know if any other changes are necessary.