Mrart commented on a change in pull request #9773: [FLINK-14210][metrics]support connect timeout and write timeout confi… URL: https://github.com/apache/flink/pull/9773#discussion_r328505056
########## File path: flink-metrics/flink-metrics-influxdb/src/main/java/org/apache/flink/metrics/influxdb/InfluxdbReporter.java ########## @@ -77,10 +81,15 @@ public void open(MetricConfig config) { this.database = database; this.retentionPolicy = getString(config, RETENTION_POLICY); + + int connectTimeout = getInteger(config, CONNECT_TIMEOUT); + int writeTimeout = getInteger(config, WRITE_TIMEOUT); + OkHttpClient.Builder client = new OkHttpClient.Builder().connectTimeout(connectTimeout, TimeUnit.MICROSECONDS).writeTimeout(writeTimeout, TimeUnit.MICROSECONDS); + if (username != null && password != null) { - influxDB = InfluxDBFactory.connect(url, username, password); + influxDB = InfluxDBFactory.connect(url, username, password, client, InfluxDB.ResponseFormat.JSON); Review comment: We art running this plugin in product env, and have another feature want to try. I will edit the side note in other PR. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services