-
Notifications
You must be signed in to change notification settings - Fork 317
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
Compatible with the bucket
parameter for influxdb line protocol
#3413
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Related InfluxeDB docs -
It seems that v1 use |
@tisonkun if this is not a super urgent one (say, I have a week or two) I'd like giving it a shot |
@etolbakov Thanks! It should not be urgent. Feel free to send a patch and ping me as the reviewer :D |
@tisonkun
I understand that the current implementation doesn't have any issues and matches the influxdb API. @nicecui Out of curiosity I tried providing a different name for the schema, please find the results below: http://localhost:4000/v1/influxdb/api/v2/write?db=evttestat 13:35:38 ❯ curl -v --location --request POST 'http://localhost:4000/v1/influxdb/api/v2/write?db=evttest' \
--header 'Content-Type: application/json' \
--data-raw 'datum,host=host2 cpu=1.4 1664370459457010101'
* Trying 127.0.0.1:4000...
* Connected to localhost (127.0.0.1) port 4000 (#0)
> POST /v1/influxdb/api/v2/write?db=evttest HTTP/1.1
> Host: localhost:4000
> User-Agent: curl/8.0.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 44
>
< HTTP/1.1 500 Internal Server Error
< content-type: application/json
< content-length: 55
< date: Sat, 02 Mar 2024 13:36:24 GMT
<
* Connection #0 to host localhost left intact
{"error":"Failed to find schema, schema info: evttest"}% http://localhost:4000/v1/influxdb/api/v2/write?bucket=evttestcurl -v --location --request POST 'http://localhost:4000/v1/influxdb/api/v2/write?bucket=evttest' \
--header 'Content-Type: application/json' \
--data-raw 'datum,host=host3 cpu=1.5 1664370459457010102'
* Trying 127.0.0.1:4000...
* Connected to localhost (127.0.0.1) port 4000 (#0)
> POST /v1/influxdb/api/v2/write?bucket=evttest HTTP/1.1
> Host: localhost:4000
> User-Agent: curl/8.0.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 44
>
< HTTP/1.1 204 No Content
< date: Sat, 02 Mar 2024 13:35:38 GMT Please let me know what do you think? |
@etolbakov Thanks a lot for your time to investigate this. I agree that the implementation seems correct. @nicecui This seems some incorrect docs issue? I share the question -
@etolbakov have you checked if InfluxDB has this default schema name manner? Or it returns an error if bucket unspecified. |
Looks like for the As for the UPD: it returns bucket not found. I've downloaded the influxdb docker image and tried the {
"code": "not found",
"message": "bucket not found"
} |
@etolbakov Thank you for your interest in this issue! We need the
|
Here is a bug: If the database specified by the |
Thanks for explaining the desired behaviour @nicecui.
just to confirm, this endpoint supports the I'm happy to give this ticket a go but I'd like to have a confirmation from Greptime team that it's fine to go ahead and proceed with the proposed logic(@tisonkun could you please help me with that?). In my opinion the client code should decided which endpoint ( |
@etolbakov The |
Confirmed that #3413 (comment) is reasonable. cc @etolbakov |
Maybe. But the related code snippet here is about the server side. I don't find influx client code in our repository ... |
Something related: p = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
bucket = 'xxx-public'
client = InfluxDBClient(url="https://yyy.greptime.cloud/v1/influxdb/", token="username:password", org="my-org")
write_api = client.write_api(write_options=SYNCHRONOUS)
write_api.write(bucket=bucket, record=p) This would fail with:
It can be a separate issue but still relevant (bucket param doesn't switch the database). I'm digging into it but post here for your information. |
Located. It's related to this issue and the real related code for this issue is: greptimedb/src/servers/src/http/authorize.rs Lines 140 to 154 in 5d644c0
|
Thanks @tisonkun!
I'll try to come up with the PR shortly so we can have a discussion (how/where that should be addressed) |
@nicecui just to let you know the fix has been merged. Please let us know once you have a moment to test it (assume you need to wait for new release)? |
@etolbakov Thank you very much! I have tested it from the |
Closed as resolved. Thanks for @nicecui reporting and @etolbakov fixing! |
What type of enhancement is this?
API improvement
What does the enhancement do?
The influxdb line protocol v2 and v3 use the
bucket
parameter to indicate the database name, for example:GreptimeDB uses the
db
parameter to indicate the database name:When using the client libs of InfluxDB, users cannot change the
bucket
parameter todb
parameter.Does Greptime plan to support the
bucket
parameter to indicate the database?Implementation challenges
No response
The text was updated successfully, but these errors were encountered: