eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.52k stars 165 forks source link

[Bug + Feature Request] Zenoh REST plugin always return one measurement for influxdb #1515

Open arsh09 opened 1 month ago

arsh09 commented 1 month ago

Describe the bug

I have an InfluxDB running and its relevant plugin running on a Zenoh-router as well as a REST plugin.

From the influxdb-client, I can see that the key-expression has multiple rows for the series in the database. Unfortunately, when I run the following:

curl -g "http://<router-ip>:8000/test/**?_time[..]"

I only get the last timeseries row instead of all of the data. When setting the RUST_LOG=debug, and looking at the terminal output, I noticed the following SQL run on the influxdb:

Get all entries with Influx query: SELECT * FROM /^.*$/ ORDER BY time DESC LIMIT 1

Where 'limit 1' is limiting the output to 1. I do not find any documentation where the REST API can send the 'limit' in the query. I think adding a selector such as '_limit' similar to '_time' might be helpful.

To reproduce

1) Start a router with influxdb and rest api 2) Publish a few measurements via curl command 3) Try to get all the measurements (it will return only the last one).

System info

Zenoh - zenohd v1.0.0-beta.4 built with rustc 1.75.0 (82e1608df 2023-12-21) Influx - InfluxDB shell version: 1.6.7~rc0 System - Ubuntu 20.04 - Digital Ocean Droplet

Mallets commented 3 days ago

Query parameters are not supported for now in the Zenoh REST plugin so it's not possible to set the consolidation strategy.

If you are looking at using Zenoh in a web application, a TypeScript API is now available and it supports all the Zenoh options: https://github.com/eclipse-zenoh/zenoh-ts