Closed carlos-jenkins closed 5 years ago
Thanks for the issue and sorry for the late reply.
The implementation seems trivial but I am not sure how to test such code.
What exactly is the environment you use InfluxDB so that you need such path
? Do you use some sort of proxy in front of InfluxDB? If so, could you share any ideas (maybe some Nginx config?) of how to launch InfluxDB at localhost:8086/some/random/path
so I could test the code.
Yes, indeed, that's exactly the case.
We are using Kubernetes to deploy our services, and depending of the configuration of the ingress, many services can share one single domain, and what Kubernetes does is putting an Nginx as reverse proxy of those services, using a path to identify them.
I'll try to fiddle with a docker stack configuration that should do the same.
Ok this deployment works to test the scenario.
Deploy stack with:
docker stack deploy --compose-file=stack.yml aioinflux
Access InfluxDB with:
curl -L -i http://127.0.0.1:8000/my/custom/path/ping?verbose=true
Connect using Sync Python client with:
from influxdb import InfluxDBClient
client = InfluxDBClient(host='127.0.0.1', port=8000, path='/my/custom/path/')
client.ping()
Thanks a lot!
If anyone comes here, this was fix-released in 0.9.0.
Hi, thanks again for this great package, been very helpful.
Sync InfluxDB client has in its constructor a
path
parameter:https://influxdb-python.readthedocs.io/en/latest/api-documentation.html#influxdb.InfluxDBClient
And the URL is built as follows:
https://github.com/influxdata/influxdb-python/blob/d5d12499f3755199d5eedd8b363450f1cf4073bd/influxdb/client.py#L123
Although in aioinflux there is no path parameter, and the URL is built as follows:
https://github.com/gusutabopb/aioinflux/blob/master/aioinflux/client.py#L163
So, it seems that I cannot connect with aioinflux to our Influx deployment, as for reasons unknown to me, it is under a path.
Currently, I created a quick monkey patch as follows:
Thanks for placing the
url
in a property, that was useful.