From ba79b9ee659a7dfb1794724ad5690ae7f479710f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BENHADDOU=20R=C3=89DA?= Date: Wed, 7 Apr 2021 19:18:35 +0200 Subject: [PATCH] Allow influx to be called through https protocol | Allow passing an identifier to influxdb to find back the report when needed --- src/http.service.js | 2 +- src/influxdb-reporter.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/http.service.js b/src/http.service.js index d9935d7..0cd174c 100644 --- a/src/http.service.js +++ b/src/http.service.js @@ -9,7 +9,7 @@ class HttpService { constructor(context) { this.context = context; const axiosOptions = { - baseURL: `http://${this.context.server}:${this.context.port}` + baseURL: `${this.context.mode === "https" ? "https" : "http"}://${this.context.server}:${this.context.port}` }; if(this.context.version == 2) { diff --git a/src/influxdb-reporter.js b/src/influxdb-reporter.js index ab1b060..0eaf2f4 100644 --- a/src/influxdb-reporter.js +++ b/src/influxdb-reporter.js @@ -42,6 +42,7 @@ class InfluxDBReporter { this.context.username = this.reporterOptions.influxdbUsername || this.reporterOptions.username; this.context.password = this.reporterOptions.influxdbPassword || this.reporterOptions.password; this.context.mode = this.reporterOptions.influxdbMode || this.reporterOptions.mode; + this.context.identifier = this.reporterOptions.influxdbIdentifier || this.reporterOptions.identifier; this.context.debug = this.reporterOptions.influxdbDebug || this.reporterOptions.debug || false; this.context.debug = this.context.debug === 'true'; @@ -92,6 +93,7 @@ class InfluxDBReporter { const data = { collection_name: this.options.collection.name, + id: this.context.identifier, request_name: item.name, url: request.url.toString(), method: request.method,