Skip to content
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

Change name to measurement in JSON write schema #2564

Closed
gunnaraasen opened this issue May 13, 2015 · 12 comments
Closed

Change name to measurement in JSON write schema #2564

gunnaraasen opened this issue May 13, 2015 · 12 comments
Assignees
Milestone

Comments

@gunnaraasen
Copy link
Member

@beckettsean proposed renaming name in the JSON write schema to measurement. The justification being that "measurement" is more descriptive and less confusing than "name".

The proposed JSON payload for writing a point would change to:

{
    "database": "mydb",
    "retentionPolicy": "default",
    "points": [
        {
            "measurement": "cpu_load_short",
            "tags": {
                "host": "server01",
                "region": "us-west"
            },
            "time": "2009-11-10T23:00:00Z",
            "fields": {
                "value": 0.64
            }
        }
    ]
}
@pauldix
Copy link
Member

pauldix commented May 16, 2015

yes, +1

@pauldix pauldix added this to the 0.9.0 milestone May 16, 2015
@dgnorton dgnorton self-assigned this May 21, 2015
dgnorton added a commit that referenced this issue May 21, 2015
dgnorton added a commit that referenced this issue May 22, 2015
toddboom added a commit that referenced this issue May 27, 2015
fix #2564: Rename "name" to "measurement" in JSON for writes
@dgnorton dgnorton removed the review label May 27, 2015
@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

I could not write this exact example.

I tried writing this:

{
    "database": "mydb",
    "retentionPolicy": "default",
    "points": [
        {
            "measurement": "cpu_load_short",
            "tags": {
                "host": "server01",
                "region": "us-west"
            },
            "time": "2009-11-10T23:00:00Z",
            "fields": {
                "value": 0.64
            }
        }
    ]
}

And got the following response:

500: {"error":"bucket name required"}

see #2679

@otoolep
Copy link
Contributor

otoolep commented Jun 4, 2015

That error is a low-level error from BoltDB, FWIW.

@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

@otoolep
I can help debugging if needed, should I check logs or launch InfluxDB in debug?

@otoolep
Copy link
Contributor

otoolep commented Jun 4, 2015

The logs probably won't help, which is something we need to fix. This implies something like a destination database or series is missing.

Can you provide a complete sequence, using curl, showing the problem?

@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

I don't really know what to add:

reazem@cranberry:~$ curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE db"
{"results":[{}]}
reazem@cranberry:~$ curl -X POST -d '{ "database": "db", "retentionPolicy": "default", "points": [ { "measurement": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" },"time": "2009-11-10T23:00:00Z","fields": {"value": 0.64}}]}' 'http://localhost:8086/write'
{"error":"bucket name required"}

@otoolep
Copy link
Contributor

otoolep commented Jun 4, 2015

OK -- good enough, thanks.

@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

@otoolep
Just in case:

reazem@cranberry:~/Downloads$ sudo service influxdb stop
reazem@cranberry:~/Downloads$ sudo apt-get remove influxdb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  influxdb
0 upgraded, 0 newly installed, 1 to remove and 157 not upgraded.
After this operation, 22.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 309283 files and directories currently installed.)
Removing influxdb (0.9.0-rc31) ...
reazem@cranberry:~/Downloads$ sudo rm -rf /var/opt/influxdb
reazem@cranberry:~/Downloads$ sudo rm -rf /opt/influxdb
reazem@cranberry:~/Downloads$ sudo dpkg -i influxdb_0.9.0-rc31_amd64.deb 
Selecting previously unselected package influxdb.
(Reading database ... 309276 files and directories currently installed.)
Preparing to unpack influxdb_0.9.0-rc31_amd64.deb ...
Unpacking influxdb (0.9.0-rc31) ...
Setting up influxdb (0.9.0-rc31) ...
reazem@cranberry:~/Downloads$ sudo service influxdb start
reazem@cranberry:~/Downloads$ curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE db"
{"results":[{}]}
reazem@cranberry:~/Downloads$ curl -X POST -d '{ "database": "db", "retentionPolicy": "default", "points": [ { "measurement": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" },"time": "2009-11-10T23:00:00Z","fields": {"value": 0.64}}]}' 'http://localhost:8086/write'
{"error":"bucket name required"}
reazem@cranberry:~/Downloads$ 

@corylanou
Copy link
Contributor

We don't have default RP creation on master, is that the problem? Not sure what version he is using.

@corylanou
Copy link
Contributor

If you explicitly create the RP does it work?

@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

@corylanou : I am on 0.9.0-rc31

Also, it has a default RP. (Which I did not create)

@aviau
Copy link
Contributor

aviau commented Jun 4, 2015

This should help: Using ''name'' works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants