hi,
new to influxdb. I set everything up & have a go client write to my custom bucket. it seems to work fine & I can see the data directory on my disk growing (already at 200mb after a few weeks, I can even see scrambled data if I directly look into some of the db files).
however, when I query data (via query builder, flux, go client, api, you name it) I always get an empty result set. query builder doesn’t even show my measurements.
schema.measurements correctly returns all my measurements for this bucket.
schema.fieldKeys does not return anything though, neither does schema.measurementFieldKeys.
schema.tagKeys and schema.measurementTagKeys return “_start” & “_stop”, but afaik my only tag should be “sensor_value”.
am I missing something essential here?
Hello @marrrc,
Welcome! Can you please share your script? As well as the resulting line protocol from your script? And finally your flux query?
I would first test your script by printing the resulting line protocol and seeing if you can successfully write that line of line protocol to your influxdb instance with cURL or the cli:
curl --request POST "http://example.com:8080/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \
--header "Authorization: Token YOURAUTHTOKEN" \
--data-raw "
mem,host=host1 used_percent=23.43234543 1556896326
"
https://docs.influxdata.com/influxdb/v2.0/write-data/developer-tools/api/#example-api-write-request
or
influx write \
-b bucketName \
-o orgName \
-p s \
-t token \
'myMeasurement,host=myHost testField="testData" 1556896326'
As an aside you should consider creating an influxdb cli configuration because it makes working with the cli way easier:
Finally you can also try writing the line protocol through the UI.
Thank you for taking time to look into this. I tried with printing the line protocol and using a cURL request like you suggested, and it worked without issue. It turns out I had a timestamp corruption along the lines of my script, which resulted in all timestamps defaulting to january 1st 1970. So everything fine with my bucket, thank you again because it helped me to find a stupid mistake.
Hello @marrrc,
Sure no problem.