Skip to content

Commit

Permalink
Merge pull request #17 from rbenhaddou/develop
Browse files Browse the repository at this point in the history
Allow influx to be called through https protocol | Allow passing an identifier to influxdb to find back the report when needed
  • Loading branch information
vs4vijay authored Apr 8, 2021
2 parents 4da272e + ba79b9e commit 2ad3251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/http.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/influxdb-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2ad3251

Please sign in to comment.