-
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
Writing null values via HTTP API fails #53
Comments
You should be able to write null values. It should also be a way to remove a previously existing column value if you specify a timestamp and sequence_number, since writes with those fields specified are either inserts (if non-existant) or updates. If it's an update, nulls should clear out anything that might have been there before. Thanks for the code to reproduce! |
No worries at all! To give you some background on what I'm trying to achieve here, I'm currently extending collectd's write_http plugin to support writing data to InfluxDB. The format of the data I'm currently writing looks like this: [
{
"name": "memory.memory.free",
"columns": [
"host",
"plugin",
"plugin_instance",
"type",
"type_instance",
"value",
"time"
],
"points": [
[
"influxdb-01.example.org",
"memory",
null,
"memory",
"free",
0,
1384395663179
]
]
}
] I'm writing The "name" field is a concatenation of Do you see anything particularly wrong with this approach? The only immediate issue I see is the write performance. write_http will buffer up writes, so you end up with ~20 time series per HTTP POST. The caveat is that each of those time series only has one row of points. It should be possible to batch up multiple rows of points to make them more efficient, but it would probably require building a brand new plugin, as I would have to do some pretty massive reworking of the write_http plugin to support all the different formats. For a first-pass implementation though, I think the current approach is OK. |
If you're only writing a single point per time series, you shouldn't be On Wed, Nov 13, 2013 at 9:39 PM, Lindsay Holmwood
|
This is a revelation to me. I didn't realise you could just omit columns when you have null values. Thanks for the tip! 🍰 One edge case that just came to mind: what happens when you write a time series the first time with a column omitted, but on subsequent writes you include it? My guess would be that the columns initially omitted would continue to be omitted, is that right? |
no, they will be null only for the initial points that didn't have it. On Thu, Nov 14, 2013 at 7:46 PM, Lindsay Holmwood
|
I've tried inserting null values. But I don't see them when I run a query. What am I doing wrong?
How I expected it:
What I also tried:
Lets just query without a where...
|
Also tried this:
|
;-) |
According to the HTTP API docs, it is possible to write null values into columns:
I have observed that when you do this, you get an
Unknown type <nil>
response from the HTTP API.Here is some test code to reproduce:
And this is the output I currently see when running that script:
Is this intended behaviour, or should I actually be able to write
null
values?The text was updated successfully, but these errors were encountered: