chronograf
chronograf copied to clipboard
Query builder doesn't fetch fields for non-default RPs
To reproduce:
- Create a database with two retention policies. Make one of them the default.
- Write data into both RPs.
- In the Data Explorer, select the non-default retention policy under "Databases"
- Select a measurement that you've written to under that RP.
- Witness no fields.
- Repeat 3 & 4 for the default retention policy and see that there are fields under the "Fields" tab.
I suspect this is because the query issued below to fetch those fields doesn't explicitly include the RP. It should look like SHOW FIELD KEYS FROM "archive"."downsampled_cpu" where "archive" is the non-default RP.
{
"query":"SHOW FIELD KEYS FROM \"downsampled_cpu\"",
"db":"telegraf"
}
This was fixed by pulling the rp into the measurement name
@nhaugo I'm still able to reproduce this on master
The issue now doesn't have anything to do with the RP being default or not. The issue is that at some point (pre 1.2) measurements and tags were inserted into the database without fields. Given the new line protocol in 1.2+, this should be impossible.