diff --git a/docs/gw/influxdb.rst b/docs/gw/influxdb.rst index e931c70c..b8717c48 100644 --- a/docs/gw/influxdb.rst +++ b/docs/gw/influxdb.rst @@ -48,6 +48,9 @@ Note: if you want to use SSL, please set 'protocol=https'. InfluxDB v2 (from InfluxDB v1.8.x/Flux and InfluxDB v2.x) --------------------------------------------------------- +Note: The InfluxDB v2 client (https://pypi.org/project/influxdb-client/) +is only available for Python 3.6 or higher. + The connection should be defined in the Glances configuration file as following: diff --git a/glances/exports/glances_influxdb2.py b/glances/exports/glances_influxdb2.py index 267c5bc8..1e619642 100644 --- a/glances/exports/glances_influxdb2.py +++ b/glances/exports/glances_influxdb2.py @@ -73,16 +73,17 @@ class Export(GlancesExport): logger.critical("Cannot connect to InfluxDB server '%s' (%s)" % (url, e)) sys.exit(2) else: - logger.info("Connected to InfluxDB server ({})".format(client.health())) + logger.info("Connected to InfluxDB server version {} ({})".format(client.health().version, + client.health().message)) # Create the write client write_client = client.write_api(write_options=WriteOptions(batch_size=500, - flush_interval=10_000, - jitter_interval=2_000, - retry_interval=5_000, + flush_interval=10000, + jitter_interval=2000, + retry_interval=5000, max_retries=5, - max_retry_delay=30_000, + max_retry_delay=30000, exponential_base=2)) return write_client