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

Make default InfluxDB client support custom HTTP endpoints #10294

Closed
mattiasb opened this issue Sep 20, 2018 · 6 comments
Closed

Make default InfluxDB client support custom HTTP endpoints #10294

mattiasb opened this issue Sep 20, 2018 · 6 comments

Comments

@mattiasb
Copy link

Proposal:

Make it possible to connect to an InfluxDB instance running behind a reverse proxy with a custom subpath / endpoint with the default InfluxDB client influx.

Current behavior:

I have InfluxDB, Grafana and nginx running as docker containers in a test VM at 192.168.122.26.
InfluxDB is exposed at 192.168.122.26/influxdb/

I can issue a ping command with curl but I can't log in using influx:

$ curl -sL -I l http://192.168.122.26/influxdb/ping
HTTP/1.1 204 No Content
Server: nginx/1.14.0
Date: Thu, 20 Sep 2018 11:21:11 GMT
Content-Type: application/json
Connection: keep-alive
Request-Id: 4714b565-bcc7-11e8-8009-000000000000
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.5.4
X-Request-Id: 4714b565-bcc7-11e8-8009-000000000000

$ influx -host 192.168.122.26/influxdb -port 80
Failed to connect to http://192.168.122.26%2Finfluxdb: parse http://192.168.122.26%2Finfluxdb/ping: invalid URL escape "%2F"
Please check your connection settings and ensure 'influxd' is running.

Desired behavior:

I'd like to be able to connect to a custom endpoint with influx. :)

Use case:

I'm just getting started with InfluxDB but I'd like to be able to test the database with influx as the server is set up now. I might go back to just exposing the server directly via its default port and no endpoint instead if necessary.

@dgnorton dgnorton added the 1.x label Jan 7, 2019
@stale
Copy link

stale bot commented Jul 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 24, 2019
@jimis
Copy link

jimis commented Jul 24, 2019

@Stale I'm still watching this and in need of this. AFAIK there is no workaround, so it's impossible to use the influx CLI to connect to such endpoints.

@stale stale bot removed the wontfix label Jul 24, 2019
@carlos-jenkins
Copy link

carlos-jenkins commented Sep 6, 2019

Is this still unavailable?

This is a common use case for people deploying influxdb using containers, like with docker stack or kubernetes.

Official Python client already have it:

https://github.com/influxdata/influxdb-python/blob/6baf7eee61e968c70d4c7f111e7179bc92a80e8d/influxdb/client.py#L62

Even the third party Async Client has it:

https://github.com/gusutabopb/aioinflux/blob/b3186627a5bc071be36dd91eb81c02b8f8c23943/aioinflux/client.py#L93

And the official CLI doesn't? Seems pretty trivial change to me.

CLI has a path argument but it is unrelated:

https://docs.influxdata.com/influxdb/v1.7/tools/shell/#path

If you need a setup you may use the Docker stack attached:
influxdeploy.zip

Deploy stack with:

docker stack deploy --compose-file=stack.yml influx

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()

@stale
Copy link

stale bot commented Dec 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 5, 2019
@jimis
Copy link

jimis commented Dec 6, 2019

So every few months the stale bot tries to auto-close valid and accepted issues, and we have to keep spamming them in order to keep them open...

@stale stale bot removed the wontfix label Dec 6, 2019
@dontsovcmc
Copy link

I also have topic starter's problem!
I run influxdb in docker-compose as described here: https://towardsdatascience.com/get-system-metrics-for-5-min-with-docker-telegraf-influxdb-and-grafana-97cfd957f0ac
I setup nginx as reverse proxy for ssl connection and checking link failed!

influx -ssl -host myhost.com/influxdb -port 443
Failed to connect to https://myhost.com%2Finfluxdb:443
Please check your connection settings and ensure 'influxd' is running.

It spends a lot of time for understanding, that it works!

curl -sL -I l https://myhost.com/influxdb/ping
HTTP/1.1 204 No Content
Server: nginx
Date: Sun, 22 Dec 2019 22:23:34 GMT
Content-Type: application/json
Connection: keep-alive
Request-Id: b11af176-2509-11ea-1111-0242ac181111
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.7.9
X-Request-Id: b11af176-2509-11ea-1111-0242ac181111
X-Frame-Options: SAMEORIGIN

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

No branches or pull requests

8 participants