-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add a OpenTSDB input protocol #870
Conversation
Thanks @tcolgate! Would it be possible to update the config so that there are different ways to map tag keys? Having tag keys mapped as columns may end up giving users very poor query performance. It's probably preferable to map the tag keys into the series names. For example:
Or something like that. |
Hi, |
Yeah, it might make it better to work with in some ways, but if people are commonly doing queries where the filter out a ton of data by doing "where tag = 'foo'" then the performance is going to be very poor. Is this something you need for yourself right now? If not, I think I'd rather hold off on this until we can address how to map OpenTSDB onto InfluxDB in a way that provides good performance. |
No urgency, we're back on to OpenTSDB for the moment, and I'll follow influx's progress. I'll have a crack at the alternative mapping at some point, if no one beats me to it. |
note: it seems we'll get this optimisation in a transparent way when we have #582 |
987efd5
to
5e9750f
Compare
@tcolgate The underlying codebase has changed a bunch for the v0.9.0 release. Is there any chance you'd be willing to update this code to work with the new codebase? The new plugins should give you a pretty good idea of how things would need to be restructured. |
+1, I'd really like this to see this re-implemented for 0.9. We can certainly offer advice along the way. |
Hi all, sorry, missed the comments. Will look into it. |
@toddboom First stab at updating for the new API, pretty much untested. |
// Spin up any OpenTSDB servers | ||
if config.OpenTSDB.Enabled { | ||
o := config.OpenTSDB | ||
db := opentsdb.DefaultDatabaseName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to do this on the config
object. In other words, the config object should have a method called "OpenTSDBDatabase()` (or something like that) and encapsulate the default-detection logic.
Thanks @tcolgate -- generally making sense. I do have some feedback, and you'll want to look into adding an integration test in |
@otoolep Cheers, will update. FWIW, the graphite and collectd plugins seemed to use different approaches for the settings so it wasn't completely clear which was the preferred option. |
@otoolep hopefully satisfied the review comments. The test doesn't pass yet, not quite sure why, but will try and fix that up as soon as possible. |
Enabled bool `toml:"enabled"` | ||
Database string `toml:"database"` | ||
RetentionPolicy string `toml:"retention-policy"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a toml
directive here, just so it's clear what it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not sure what you mean here. Each line already has the toml struct tag, and the entry in the Config struct does too (line 97)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is what I meant, I see you've got the toml
directive in the right place after all -- thanks.
Looking good, I'll wait until the tests are green before I fully review it. Can you squash the commits? |
@otoolep input unit test now passes (will add more later) |
@otoolep config test is in. Server test passes. Commits squashed |
Thanks @tcolgate -- have you signed the CLA? |
Done
|
I'm going to try and add support for the http interface (TSDB is a bit "special" in this regard, with a http and telnet inteface on the same port), so it presents an interesting challenge. |
@tcolgate -- I'm not sure I follow you. What do you mean "add support for the HTTP interface"? Do you mean propose a change to our HTTP API for writing data? |
@otoolep nope. TSDB actually provides it's telnet interface and http on the same port.The http interface supports batch upload of data so will map quite nicely to influx internal API. The telnet interface is used by tcollector (the tool I use). The http protocol is used by scollector, a newer tool, and probably other more sane tools out there. |
return o.Database | ||
} | ||
|
||
func (o OpenTSDB) ListenAddress() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function needs to take the default bind address, and use it if an address is not set for openTSDB. See https://github.com/influxdb/influxdb/blob/master/cmd/influxd/config.go#L390
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@otoolep updated and rebased as request. One point unresolved. |
Add an input collector for the OpenTSDB telnet protcol
Thanks @tcolgate for this very useful functionality. |
awesome work, thanks @tcolgate! |
Super cool @tcolgate thanks for your effort! |
👏 💃 👏 |
Thanks for merging. I've got some in progress work on support the http interface too. |
This adds an input supporting the telnet put interface from OpenTSDB.
OpenTSDB's tag keys and values and tranformed into Inlflux DB columns.
At present all values are stored as 64 bit floats.
This is based on a mix of the UDP, and Graphite APIs. I've given it a bit of initial testing with tcollector, and so far things looks OK. Not load tested it yet.
I noticed the graphite collector uses a buffered channel, where the UDP one does not. Is the buffering taken care of elsewhere now? TSDB clients will be quite bursty, so buffering may improve things if needed