You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/11/26 11:15:13 UTC

[skywalking] branch master updated: Fix influxdb config resubmit (#5903)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a61835  Fix influxdb config resubmit (#5903)
9a61835 is described below

commit 9a61835cb7d5a6d4ab76dc5a31c4576ae83f5f63
Author: jianweizhang <zh...@inspur.com>
AuthorDate: Thu Nov 26 19:14:48 2020 +0800

    Fix influxdb config resubmit (#5903)
---
 CHANGES.md                                                           | 3 ++-
 docs/en/setup/backend/configuration-vocabulary.md                    | 1 +
 oap-server/server-bootstrap/src/main/resources/application.yml       | 1 +
 .../skywalking/oap/server/storage/plugin/influxdb/InfluxClient.java  | 5 ++++-
 .../oap/server/storage/plugin/influxdb/InfluxStorageConfig.java      | 1 +
 5 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 4262401..2cf50a8 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -30,6 +30,7 @@ Release Notes.
 * Add `contain` and `not contain` OPS in OAL.
 * Add Envoy ALS analyzer based on metadata exchange.
 * Add `listMetrics` GraphQL query. 
+* Add group name into services of so11y and istio relevant metrics
 * Support keeping collecting the slowly segments in the sampling mechanism.
 * Support choose files to active the meter analyzer.
 * Support nested class definition in the Service, ServiceInstance, Endpoint, ServiceRelation, and ServiceInstanceRelation sources.
@@ -55,7 +56,7 @@ Release Notes.
 * Fix "transaction too large error" when use TiDB as storage.
 * Add otel rules to ui template to observe Istio control plane.
 * Remove istio mixer
-* Insert group name into services of so11y and istio relevant metrics
+* Support close influxdb batch write model.
 
 #### UI
 * Fix incorrect label in radial chart in topology.
diff --git a/docs/en/setup/backend/configuration-vocabulary.md b/docs/en/setup/backend/configuration-vocabulary.md
index 6a549ef..1b10d1a 100644
--- a/docs/en/setup/backend/configuration-vocabulary.md
+++ b/docs/en/setup/backend/configuration-vocabulary.md
@@ -138,6 +138,7 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
 | - | - | database | Database of InfluxDB. | SW_STORAGE_INFLUXDB_DATABASE | skywalking |
 | - | - | actions | The number of actions to collect. | SW_STORAGE_INFLUXDB_ACTIONS | 1000 |
 | - | - | duration | The time to wait at most (milliseconds). | SW_STORAGE_INFLUXDB_DURATION | 1000|
+| - | - | batchEnabled | If true, write points with batch api. | SW_STORAGE_INFLUXDB_BATCH_ENABLED | true|
 | - | - | fetchTaskLogMaxSize | The max number of fetch task log in a request. | SW_STORAGE_INFLUXDB_FETCH_TASK_LOG_MAX_SIZE | 5000|
 | agent-analyzer | default | Agent Analyzer. | SW_AGENT_ANALYZER | default |
 | - | -| sampleRate|Sampling rate for receiving trace. The precision is 1/10000. 10000 means 100% sample in default.|SW_TRACE_SAMPLE_RATE|10000|
diff --git a/oap-server/server-bootstrap/src/main/resources/application.yml b/oap-server/server-bootstrap/src/main/resources/application.yml
index 6551ddd..ebdcc46 100755
--- a/oap-server/server-bootstrap/src/main/resources/application.yml
+++ b/oap-server/server-bootstrap/src/main/resources/application.yml
@@ -192,6 +192,7 @@ storage:
     database: ${SW_STORAGE_INFLUXDB_DATABASE:skywalking}
     actions: ${SW_STORAGE_INFLUXDB_ACTIONS:1000} # the number of actions to collect
     duration: ${SW_STORAGE_INFLUXDB_DURATION:1000} # the time to wait at most (milliseconds)
+    batchEnabled: ${SW_STORAGE_INFLUXDB_BATCH_ENABLED:true}
     fetchTaskLogMaxSize: ${SW_STORAGE_INFLUXDB_FETCH_TASK_LOG_MAX_SIZE:5000} # the max number of fetch task log in a request
 
 agent-analyzer:
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxClient.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxClient.java
index 592128c..f49ee3e 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxClient.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxClient.java
@@ -80,7 +80,10 @@ public class InfluxClient implements Client, HealthCheckable {
             influx.query(new Query("CREATE DATABASE " + database));
             influx.enableGzip();
 
-            influx.enableBatch(config.getActions(), config.getDuration(), TimeUnit.MILLISECONDS);
+            if (config.isBatchEnabled()) {
+                influx.enableBatch(config.getActions(), config.getDuration(), TimeUnit.MILLISECONDS);
+            }
+
             influx.setDatabase(database);
             healthChecker.health();
         } catch (Throwable e) {
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxStorageConfig.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxStorageConfig.java
index c63c4e8..19f99e3 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxStorageConfig.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxStorageConfig.java
@@ -32,6 +32,7 @@ public class InfluxStorageConfig extends ModuleConfig {
 
     private int actions;
     private int duration;
+    private boolean batchEnabled = true;
 
     private int fetchTaskLogMaxSize = 5000;
 }