influxdata / influxdata/influxdb-java

How to increase the ping check period?

Open
#722 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

I've a Spring application running InfluxDB communication. On the logs of application I can see the ping Influx connection check periodically by follow log:

```
2021-01-26 14:02:31,633 INFO [http-nio-80-exec-8] class:OkHttpClient, --> GET http://influxdb.intranet/ping
2021-01-26 14:02:31,633 INFO [http-nio-80-exec-8] class:OkHttpClient, --> END GET
2021-01-26 14:02:31,637 INFO [http-nio-80-exec-8] class:OkHttpClient, <-- 204 https://influxdb.intranet/ping (3ms)
2021-01-26 14:02:31,637 INFO [http-nio-80-exec-8] class:OkHttpClient, server: nginx/1.13.0
2021-01-26 14:02:31,637 INFO [http-nio-80-exec-8] class:OkHttpClient, date: Tue, 26 Jan 2021 17:02:31 GMT
2021-01-26 14:02:31,637 INFO [http-nio-80-exec-8] class:OkHttpClient, x-influxdb-version: relay
2021-01-26 14:02:31,637 INFO [http-nio-80-exec-8] class:OkHttpClient, <-- END HTTP
```
This log check is flooding my log console and I use the connection InfluxDB 1x/min so I don't need the ping check with short period. Besides that, the threads are execute by series and this check is delayed other jobs. There are a way to increase the ping check connection period time?

Bean configuration:
```
@Bean(name = "influxDBConn")
public InfluxDB influxDB() {
try {
InfluxDB influxDB = InfluxDBFactory.connect(this.influxUri, this.influxUsername, this.influxPassword);
influxDB.setLogLevel(InfluxDB.LogLevel.FULL);
Pong response = influxDB.ping();

if (response.getVersion().equalsIgnoreCase("unknown")) {
LOGGER.error("**connectInfluxDB: Error pinging server.");
throw new RuntimeException("Error pinging InfluxDB sever");
} else {
LOGGER.info("InfluxDB ping: {}", influxDB.ping());
}

return influxDB;
} catch (InfluxDBIOException e) {
LOGGER.info("M=influxDB, Msg=Error to create InfluxDB connection bean. Error: " + e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}

return null;
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the bean configuration in the issue and trace InfluxDBFactory.connect and the ping calls to find which component performs the recurring /ping requests. The issue names no repository file or test; done means identifying whether the period is configurable and documenting or testing the supported setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.