grafana/k6

URL parsing of --out influxdb= not optimal

Open

#425 opened on Dec 18, 2017

View on GitHub
 (6 comments) (0 reactions) (1 assignee)Go (30,564 stars) (1,537 forks)batch import
bugenhancementhelp wantedtriage

Description

First off, thanks for a great piece of awesome-sauce. So far I love working with k6!

Now to what is causing me some headache. I have several InfluxDBs hosted behind a reverse proxy that uses paths to send traffic to the correct InfluxDB instance. However, the behaviour of --out influxdb only allows me to specify the hostname, and not the sub-path of the InfluxDB instance. k6 automatically interprets the path-portion of the URL to be the InfluxDB database. So using https://my.site.io/influxdbA/k6db results in k6 trying to connect to InfluxDB hosted on my.site.io and using database influxdbA/k6db. Instead of my intended behaviour of connecting to https://my.site.io/influxdbA/ and use database k6db.

Here is a few suggestions:

  • Only the last portion of the URL should be interpreted as the database name. Will be a problem if people are using database names with /, even though I'm not sure if that is allowed in InfluxDB.
  • Specify the database as an argument, like site.io/influxA?db=k6db.
  • Specify the database as a separate argument from the InfluxDB URL itself.

Contributor guide